Piston ignoring restrictions?


#1

1) Give a description of the problem
I have the attached piston created to turn on a light at sunset everyday, only if location mode is in a certain mode. The piston is firing regardless of the location mode.

2) What is the expected behavior?
The light should only turn on if location mode is set to “home” or “evening”.

3) What is happening/not happening?
The light is turning on regardless of what location mode is active.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
11/17/2017, 5:51:18 PM +733ms +102ms ╔Stopping piston... +179ms ╚Piston successfully stopped (77ms) 11/17/2017, 4:40:59 PM +202ms +0ms ╔Received event [Home].time = 1510958460000 with a delay of -799ms +254ms ║Runtime (37906 bytes) successfully initialized in 111ms (v0.2.0fe.20171109) (253ms) +256ms ║╔Execution stage started +315ms ║║Executed [Light - Kitchen].on (21ms) +343ms ║║Executed virtual command [Josh Nexus 5X].sendPushNotification (19ms) +346ms ║╚Execution stage complete. (91ms) +348ms ║Setting up scheduled job for Sat, Nov 18 2017 @ 4:40:00 PM CST (in 86340.451s) +363ms ╚Event processed successfully (363ms)


#3

When using ‘every…’ put the restriction within the ‘with’ sections, so for your case that means duplicating it twice I’m afraid :frowning:


#4

so like this?


#5

yup


#6

OK, I can do that with all my pistons that are similar, shouldn’t be too difficult. It is a little odd that the top restriction doesn’t cancel the entire piston though.

One more quick question while I’m on the topic… is my current piston setup the best way to get notifications for when the piston runs? I like to get a notification for some pistons whenever they run, just as a heads up for myself.


#7

It will work fine as it is but there is no need to put it in a seperate IF…Just place the send push action within the first IF after the ‘turn on’ command… hey, that saves your duplicated restrictions too lol

Personally I prefer using SMS as it never overwites the record (ST gives you 7 days).

You could also consider writing to a fuel stream causing peaks in a line chart for each piston event…


#8

or

I prefer the first one.

J


#9

I agree. The first one is better because I can trigger multiple actions off the 1 restriction/condition.