I have 2 bedroom side lights powered from Sonoff Basics and controlled by their own RF light switches and a Main switch Sonof T1) in the entrance to the room that uses a rule to turn the sidelights on at the same time.
Because the side lights can be turned off independently after they are BOTH turned on from the main entrance switch i am looking for rule that will report back to the main switch once both side lights are off.
All Sonoff items are running Tasmota and are set up already communicating to the MQTT server
These RF light switches are receivers only. They cannot feed back their state to the RF bridge and therefore to openHAB.
Unless you find a way to feed back to openHAB the actual state of the light switches, your requirement cannot be met.
Unfortunately, 433MHz tech is very limited. I suggest that you get two more sonoffs for your bedside lamps
I think you miss understand, the Bedside Lights are switched on and off with a Sonoff basic on each light. These are controlled via the RF Control switch via the sonoff bridge.
No I donât
I asked you what RF technology you used for the lights and you said 433Mhz. So I answered accordingly.
How are the two sonoffs configured? Are you using them with the original firware or have you flashed them with something like tasmota?
Yes, All items are configured with tasmota and running via the MQTT server.
This is the bit i am struggling with. I want to set up a rule that triggers when BOTH are off though. I can work out the singe trigger easy, i am trying to work out how create on that is for example:
âIF L/H Side light AND R.H Side Light is off THEN Send command OFF to Main Light Switchâ
So the main switch is reflecting the state of the side lights
rule "Both switches off"
when
item Right_Switch changed or
item Left_Switch changed
then
if (Right_Switch.state == OFF && Left_Switch.state == OFF) {
Main_Switch.sendCommand(OFF)
}
end
You canât. OH rules are triggered by events. This was why I suggested rethinking. (The suggestions donât do that either.)
When you think about, it would be a bit useless anyway - the rule would run all the time both are OFF.
If you want to compare steady states, you can of course do that within a rule. So when should the rule be run? When any of the states you are interested in changes.
Itâs just a case of getting your head around the event-driven system to grasp rule triggering, itâll come