Hello, new to Rule Machine here.
I'm trying to set up a single Rule Machine rule that will control my aquarium lighting's virtual switches on/off states. I have the below rule created however I cannot find a way to turn off the unused switches and leave only the most recently activated switch on. As of now, when I try to turn on the Blue switch, since Aqua is still ON, the first IF statement takes effect before getting to the ELSE-IF. What I need for it to do is instead of the IF looking for the switch state ON, I need for it to determine if Aqua was the last triggered switch, or if Blue was the last triggered switch. My most recent attempt as you can see tried using Last Event Device, but that did not solve my problem. - Thank you for your help!
Cancel Delayed Actions
Off: Aquarium 40 Light Blue, Aquarium 40 Light Aqua, Aquarium 40 Light White
IF (Last Event Device switch on(F) [FALSE]) THEN
On: Aquarium 40 Light Aqua
Send POST to: http://192.168.2.55:9876/send?deviceMac=34ea34cce4ff&codeId=l1559071026279
Send POST to: http://192.168.2.55:9876/send?deviceMac=34ea34cce4ff&codeId=l1559069120415 --> delayed: 0:00:01 (cancelable)
Set color: Fish Rack ->Custom color ->Hue: 48 ->Sat: 100 ->Level: 70
ELSE-IF (Last Event Device switch on(F) [FALSE]) THEN
On: Aquarium 40 Light Blue
Send POST to: http://192.168.2.55:9876/send?deviceMac=34ea34cce4ff&codeId=l1559071026279
Send POST to: http://192.168.2.55:9876/send?deviceMac=34ea34cce4ff&codeId=l1559068347266 --> delayed: 0:00:01 (cancelable)
Set color: Fish Rack ->Blue ->Level: 70
END-IF