Power Outage piston to do things


#1

1) Give a description of the problem
I’ve seen a few various ways of doing this, but non are exactly what I’m looking for. I have my router and my hub on an UPS. I guess I dont really need the hub on UPS, since it has batteries, so I’d consider taking it off the UPS if it would help with the piston I’m trying to figure out

2) What is the expected behavior?
Keep the current state of all of my hue bulbs, I have 11 bulbs, some color, some white, and some light strips. If power goes out, and comes back on later, they come back on at 100% and white. I’d like to set them back to their previous state. I’ve seen a few pistons that use a “canary” bulb. I have a couple in wall GE outlets, I was thinking maybe I could monitor those? If they lose power then the power is out, right? Can that be done?

So goals -
keep state of 11 bulbs, including level, on/off, color when applicable.
Monitor a hardwired outlet or switch if possible for online status
Detect power being restored and set lights back to their previous state.

Thanks in advance for any help or recommendations


#2

I’m thinking about this. Is there a way to say if two bulbs change to on and the mode is night then turn off all the rest.

I’d pick two bulbs in different areas of the house where the chances of them being turned on at night would be very unlikely.

My question is if I say ALL change to ON, that might not work right, since they timing could be off by a second or so?


#3

If you don’t use “changes” then you can use “all are on” which will produce your desired result here.

If you build a piston without any formal Triggers in it then WC will use the conditions as Triggers and it will subscribe to the events of those lights.

So this piston will fire if any of the lights turn on, it will also fire when the Mode changes. But it will only evaluate to True when both bulbs are on and the Mode is night. So it would not matter which one came on first. It will fire again when the second one does…even if that’s a minute or an hour later.