Hi everyone.
This is my first post, so I would like to thank you all for your support in the forums. I tried to find troubleshooting around a similar case, and I found this topic, but I cannot adapt to my use case (and it's my first attempt with Rule Machine).
I am in the process of adding all my devices to Hubitat. I have around 50 Shelly devices, a Philips Hue hub and some lights, and some ZigBee sensors (and repeaters). They were all running (poorly) in Homebridge, with the sensors connected to a ConBee stick on a Synology NAS. Since Synology announced they would remove USB support for non-disk devices in the new OS, I decided it was time for a change.
And after many hours digging in the forums for solutions, I noticed a trend in which users and developers were shifting from ST to HE, so I decided this might be the best solution, and I am finding it amazing!!
Now, back to the Towel Warmer scenario:
When planning my home renovation, I decided to install Shelly devices on almost all the physical switches, and some Shelly 1 PM (power meter) in the Towel Warmers circuit (hidden, inside the wall).
The Towel Warmers have a button (on/off), but the Shelly 1 PM Switch is ALWAYS ON and can monitor power usage (when ON, it uses around 500W).
That way, I imagined creating a Rule to turn off the switch after 30 minutes when we forget the Towel Warmer ON (i.e., if the power consumption is above 100). After turning off the switch, the Towel Warmer restarts and the switch should be turned on again (so we can use it in the future).
The switch status (and power consumption) is refreshed every minute, but that granularity is enough for this Rule.
The Rule should also include the following: IF the Towel Warmer button is turned off before the timer ends [power consumption is null], RM should cancel the delay/timer.
That is to prevent the following: If someone turns on the Towel Warmer after some minutes, it should start the countdown from 30 mins again, instead of continuing the previous timer > that could result in having just some minutes remaining and could result in an inconsistent behaviour and my wife would not enjoy it
So, the logic might be something like this?
The only thing working is the Trigger... I don't know if the Private Boolean is even necessary, and the IF ELSE logic is wrong... Please help!
I really appreciate any help you can provide.