Away from Home lighting


#1

1) Give a description of the problem
Checking logic used to control house lights whilst I’m away but overide if I come home

2) What is the expected behavior?
Kitchen and lounge lights to turn on whilst I’m not home after Sunset and then to turn off all lights at midnight. However, if I come home then don’t perform the lights off section as other control pistons will take over.

3) What is happening/not happening?
Haven’t tested yet as involves me being away

4) Post a Green Snapshot of the pistonimage

Looking for advice on the logic used in above piston. I want some of the house lights to come on whilst I’m away and if I stay away, they will turn back off at midnight. However if I come home then the piston doesn’t run the switch off section and my main lighting pistons take over. Hopefully that makes sense.


#2

How about changing your first statement to - If time is between Sunset +30 and Midnight.
Then deleting the time after midnight in the else.
Or change the whole thing to a WHILE.
Here is something I do that works.
Just get rid of the random turning off bit.


#3

Thanks, good suggestions.

I’ll have a play with both and see which one works best for my needs. Not thought about using a While statement before so that could open up some more options in my logic.

Being new to this I don’t yet fully understand the Piston state and why I sometimes see these as cancelled in the settings? What is the purpose of this?


#4

So this is how it looks now.
I’ve removed the Away condition as I didn’t see the point of that due to using my presence.
Also playing with Global variable for All_Lights which I have defined separately.


#5

When you look at the dashboard you can see all your pistons listed.
You can probably see true or false next to them in grey text.
If you disable piston state you can specify what is displayed.
In the one I posted it tells you if the light is on or not.
Here is a screen shot of what is possible.
People do a lot more than I do. I like things simple.



#6

Here are some examples that you can import if you wish.


#7

Brilliant, more to learn :smiley: I have some tiles enabled from Pistons I had restored but I didn’t know you could do this. I’ll do some more reading.

BTW, Away Piston activated today without issue which is the first step. I know need to see if it ignores the turn off of lights tonight and then I need to be away overnight to see if it then does as planned.

Thanks.