Piston using armed state


#1

Problem
Sometimes, when power is lost and then restablished my smart things hub has this weird response of turning on lots of things (esp lights) the house.nb that it isn’t always the same things that get turned on but it is always more than 3 of them.

This is particularly frustrating as it can mean we return from holiday to find everything turned on and it’s been on half the time we have been away.

Piston solution
So id like a piston that if lights turn on when we are away and they arent triggered by motion (smarthome moitor armed away is set to use some to ‘alert with lights’ when motion detected) then turn off the lights.

I think that could look somethung like this:

IF alarm state is ARMED AWAY
AND
None of 5 motion sensors have detected motion in last 2 minutes

AND more than 3 of these 8 lights turn on.

THEN turn off those lights

Help needed
I’m new to webcore and although I’ve done super basic, single argument Piston, I can’t fathom what I need to do /click/select in webcore to group the logic above appropriately and build the piston.

Can you help ? Please


#2

Lights turning on after power failure is normally related to device hardware, not the hub (the hub has battery backup).

Smart bulbs typically turn on after a power failure.

Other devices often have parameter settings to choose what happens.

Suggest you just setup a simple timer:

Every hour
IF
Location mode is away
With all lights
turn off


#3

I use a smartbulb that i never run at 100% as a “canary” for checking if the power has gone out. So, I have a WebCore rule that says that if this bulb has been at 100% for the last 20 minutes, then do this. I even tried it by simulating a power failure by flipping my circuit breakers and it worked.

EDIT: One thing to keep in mind, some smartbulbs don’t report back their status changes if it happens locally (Cree bulbs) but there is SmartApp called Pollster that can tell smartthings to check their status/level every so often.


#4

Thanks. I dont have any batteries in my hub at the moment.

Any idea about the piston?

Thanks


#5

It would need to be something like:

Define
device variable lightsOn

Only when mode is x
Only When Presence is x

Every x minutes

IF any of x y or z’s lights are on
save matching devices to lightsOn

IF count(lightsOn) IS greater than 3
THEN
With lightsOn
turn off