Besides simple "on" and "off", I've also created rules for the buttons to toggle the relay.
Works fine.
But I have also set two of the relays to be switched on after reboot. It works, the two relays are activated. But after that the two corresponding buttons have no effect!
In detail: relais 1 and 4 are switched off, 2 and 3 are switched on after reboot.
Then buttons 1 and 4 work fine, buttons 2 and 3 not.
It can be solved by sending an "off" command, then buttons 2 and 3 are OK again.
I tested this using the command field: evoking my "toggle" rule has no effect, turning it "off" resets the state and from that moment on everything works.
It feels like turning the relay on after boot "freezes" that state until an explicite "off" is done.
What is wrong here? Am I doing something wrong or is this a bug?
Another thing I noticed: the relay devices are defined with both "send boot state" and "send data", but the two relays that are switched on after reboot show up in Domoticz as "off", even though they are really on.
Here's a part of the rules (I copied only the relevant rules):
Code: Select all
On TurnOn1 do
gpio, 12, 1
endon
On TurnOff1 do
gpio, 12, 0
endon
On TurnOn2 do
gpio, 5, 1
endon
On TurnOff2 do
gpio, 5, 0
endon
On TurnOn3 do
gpio, 4, 1
endon
On TurnOff3 do
gpio, 4, 0
endon
On TurnOn4 do
gpio, 15, 1
endon
On TurnOff4 do
gpio, 15, 0
endon
on System#Boot do
Event TurnOff1
Event TurnOn2
Event TurnOn3
Event TurnOff4
endon

Screenshot of one of the buttons:
