A compact nanogrid for home applications with a behaviour-tree-based central controller