Hello everyone,
This is probably very low level for most of you here but it’s breaking my head a bit so I’m asking for help
I have a few situations where I have a disconnected switch, that when pressed turns on a remote relay.
Two concrete examples are:
A two gang switch on the wall:
Gang 1 turns on - Shelly plug turns on
Gang 2 turns on - a group of zigbee lights turn on.
Likewise when gangs turn off, their respective paired item also turns off.
The logic isn’t the problem for me, the problem is that I’m looking at my rules growing with basic logic that ideally should be done in one place, instead of multiple rules.
As it is right now I’m using OpenHABs “if this then that but only if” rule engine so I have:
A rule for when the gang is on, turns on the plug.
Another for the the gang 2 is on, turns on the lights.
A third and forth for when the gangs are off.
And just now I noticed that, obviously, when someone changes the state of the item that the gangs control, the gang itself does not reflect the state because I haven’t got a rule for that.
At this point I have to admit that I’m certain that I’m being dumb and that there must be a simpler way to achieve the same logic.
Help anyone?