Piston Not Activating Certain Routine


#1

I’m trying to set the security system on the house to send me an intruder alert and put my bedside lamp on.

The exception to this is when my wife or myself are on a late shift and come home after the other one of us has gone to bed and the system is in armed/stay mode.

What I’m hoping is for the presence sensors to be picked up as they enter the radius set around my home and when that happens then the security should set to “I’m Back” therefore preventing the alarm from triggering.

This was finally tested this morning. I didn’t get the security alert, expected behaviour as I was home and my wife was returning from a night shift. The lights came on downstairs and went off 10 mins later - expected behaviour.

But, the Piston Didn’t execute the routine ‘Goodnight’ which should have re-armed the alarm after 10 minutes.

I’m not sure if this will run the alarm if it’s an attempt to force entry on the front door.

Can someone please take a look at my Piston and see if you can pick up any errors.

Please help me to begin to understand!!! :wink:

Rich


#2

Taking a stab at this… your piston isn’t going to set Goodnight routine since it’s tied to your presence moving away from present on line 23. What I’d suggest without any other modification to the piston is just moving the Wait 10 mins, and Exec routine Good Night right after line 28.


#3

Yeah, looks like you basically need to lose the ELSE part of that statement.

Although, I don’t think this one is going to work the way you expect it to either. Likely the same fix will be needed.


#4

Thanks both. I’ll modify it by taking out the Else statement as suggested.

Mike, the lights did turn off as expected (the bottom image you uploaded) even with the Else statement.


#5

By chance does the routine, “I’m back” turn them ON?

Or do they only turn on with the routine “I’m back…at night”?


#6

Only with the one - At Night.

I’m back is the default Smarthings routine that disables the alarm.


#7

I’ve run them as a routine as I don’t like the colour temperature using the preset on WebCoRE.


#8

Then I have no idea why the lights would have went out, because logically that section of the piston should not run…especially considering you’re saying that the I"m back at Night" routine did run. Which is in the “THEN” section.

IF A then B else C. So if B runs, then C should never run, or if C runs then B should never run.

So that makes no sense to me.


#9

If you’re just turning on lights they should retain the value that they had when they were turned off. I don’t believe webCoRE defaults them to any particular color or temperature. Having said that…you can also tell webCoRE to turn on the lights at any color and temperature that you prefer. All those settings are in there. I’ve found that (especially for Hue bulbs) looking in the ST IDE will tell me what they are set to currently so that I can duplicate those settings in wC.


#10

Thats what I mean Mike. I want them on in a certain colour and I don’t like the WebCoRE presets. So I set up a routine using Smartthings (so I can choose the Hue).

With regards the lights going out - they should, thats what I’ve set the Piston to do - I want them to go out after 10 mins and the alarm to set back to Armed/Stay also after 10 mins.

The initial statement should run - I’m Back but only when the system is in Night - because I have it run Goodnight at 23:00 every day which arms the alarm - I’m back simply disarms it and doesn’t mess with the mode. Then I want it to stay disarmed for 10 mins and then to run Goodnight and turn off the lights. Goodnight is the stock routine that arms the alarm.

The issue now is that I need to wait until one of us comes home from work after 23:00 to see if the whole Piston runs how I want it too.

I’ve taken your advice and moved the Else statement into the Do at line 29.

Rich

Edit:

In explanation - my wife and I work different shifts and often one of us is in bed with the alarm armed after 23:00. I don’t want the alarm warning to go off when one of us comes home and the other is in bed - especially when we come home at 3am!!! Imagine the pain I’d suffer if I woke up my wife with a red light!

The 10 minute wait is to allow us to get in, dump our stuff and then head upstairs.

However, if it is a real break in attempt on the front door then I want the alarm to trigger and the light in the bedroom to come on red in colour at 100% to give us time to grab something and scare the living poo out of any burglars that manage to break in!