best way to sync relay node plus button node with light
-
Right now I have:
1 working relay node with 4 buttons and
1 working button controller node with 4 buttons and 4 lightsI would like the buttons to control the relays and the button lights match the state of the relays even if the relays were toggled via the domoticz interface.
Right now I have the relays nodes set up as V_LIGHTS and my buttons as separate V_LIGHTS. Then in Blocky I did a long if/else statement if one of them changed to change the state of the other device. I think it would sometimes confuse blocky and I would start an endless cycle of toggling the buttons. (this was my first attempt with blocky)
In the future I would like to add more of my button controllers to control the same set of relays.
Is there a more elegant way to make the state of two separate devices equal.
Thanks in advance
Troy
-
@TEStevens This is two separate nodes, correct? As I understand what you described: you have a 4-relay node and you have a node with four buttons and four lights, are these LEDs on the node or switched lights?
If this is a separate node from the relays, I would use S_SCENE_CONTROLLER for the buttons and S_LIGHT for the LEDs and use logic on your controller to send V_LIGHT commands to both the LEDs on the button node and to the relay node when a scene is switched 'on' or 'off' from any of your proposed "button controllers".