Christmas Lighting Piston Help


#1

1) Give a description of the problem
I’m trying to design a piston that will:

  1. Turn on the outdoor lights and then check to see if anyone is home (via presence sensors which are our phones) before turning on our live tree lights indoors. I don’t need to burn down the house while we aren’t there.

2) What is the expected behavior?
I expect it to turn on the outdoor lights at sunset regardless then check the status of the presence sensors and if anyone is home turn the indoor tree lights on. If no one is home to leave it off and then continue checking for presence sensors and turn the indoor lights on if someone enters the geo fence. Then continue checking once the indoor lights are on to be sure that someone is still inside the geo fence and if everyone leaves to shut off just the indoor lights. Then I would like the system to turn all the lights off at 2230.

3) What is happening/not happening?
I can get it to turn on lights at sunset and check the status of a presence sensor but then the piston stops.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
Pulled up the logs but didn't see the log for this piston.


#2

I don’t think I’ll be able to help with your presence detection issue but I’m having a similar issue for when a device changes to offline and receiving a notification. I believe to do with the fact that your piston only has two actions (visible by the icon on rows 17 and 54). I think you may need to do another timer statement then define the frequency to run every X minutes, but I imagine there’s a much better way to accomplish your goal that the experts here can provide. I’m hopeful that whatever solution works for your situation can also work for mine as I’m not a fan of my piston doing checks once an hour (as I’d like more immediate results without running a piston every minute or whatever). :slight_smile:


#3

I just changed the time in the piston to check that it will shut off my lights at the “end time”. It worked as expected. I think the hiccup is the middle part where it verifies and continually checks the status of the presence sensors. :slight_smile: BTW I did figure out how to send SMS to multiple phones upon alarm from either a contact sensor or a motion sensor this afternoon. I know that is a super requested feature!! I’d be happy to share that if you PM me or want me to post another thread.


#4

Ok so here is an updated version. I think I may have it sorted out correctly. What say the EXPERTS???


#5

Not an expert, otherwise some of my pistons wouldn’t take multiple multiple builds to Get sort of right. But, how about this.

It also Check to see if you all leave once things are on, to turn the tree off.


#6

NIce! Much cleaner than my code. This is only my true second piston. My SMS pistons were mirrors of each other with the difference being all contacts vs all motions. :slight_smile:


#7

I had a problem with Gopack2’s code. Don’t recall what it was but I created virtual presence sensors and worked it all out. Now I’d like to add that if the day is Saturday, Sunday or 12/24, 25, 31 and 1/1 to turn on the Christmas tree earlier in the day and then still follow the presence sensor rules. Any input as to how to do that?


#8

I fixed it by adding conditions. Thanks.