move the controller init code from objects to an own function and call from states and objects "connected" methods including checks to make sure it only runs once when both are connected successfully
move the controller init code from objects to an own function and call from states and objects "connected" methods including checks to make sure it only runs once when both are connected successfully

ioBroker/ioBroker.js-controller,ioBroker/ioBroker.js-controller,ioBroker/ioBroker.js-controller