Hi Patrick et all!
having some troubles with a z-wave sensor (aeotec ZW116) I have that controls a small heated tile inside a pets cage. I have this thing setup with a lovely reactor timer to turn on the heated tiles at night (9pm to 9 am). It works beautifully.
Now, the ZW116 is also wired into a switch, so that someone can manually turn it on during the daytime if desired also.
Of course (I should have anticipated this), what’s happening is the kids are of course hitting the switch sometime after 9pm, when reactor has triggered and the activity has turned on the heated tiles. So well meaning intentions, what they’re doing is turning it off. grrr…
is there some way I can check if the device to be controlled (device #21) is actually turned on? every half hour or so? and if someone accidentally turned it off, have my reactor sensor sorta re-trip and have the activity turn device #21 on again?
I was thinking about creating an expression inside the reactor sensor that checks the status of device #21… with one of Patrick’s previous code examples.
len(iterate( list(21), if(getstate( dev, "urn:upnp-org:serviceId:SwitchPower1", "Status" )=="0", 1, null ), "dev" ))
But i’m lost about where to go from there… I think it has something to do with using the sustained for on this expression?
Or perhaps I’m going about this wrong.
Is there an easy way to check if someone accidentally turned off a device during an interval where it should be ON, and then having a reactor sensor re-trip and send the trip actions?
open to ideas!!