After Sunset Executing When SHM Status Changes


#1

**1) Give a description of the problem
Piston that executes after Sunrise suddenly executing when SHM Status changes to Armed

2) What is the expected behavior?
Piston only executes when time changes to after Sunrise

3) What is happening/not happening?
The Piston is executing whenever I change SHM Status to Armed manually (testing other stuff). This Piston has been working for many months without issue. I can’t figure out what’s happening from the Log, I do see a timer setup for the coming midnight, this makes sense. Can’t imagine why its popping now, and why setting the SHM Status would have any affect on this.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
╔Received event [Home].alarmSystemStatus = off with a delay of 70ms
+401ms ║RunTime Analysis CS > 22ms > PS > 323ms > PE > 56ms > CE
+413ms ║Piston waited at a semaphore for 264ms
+415ms ║Runtime (40330 bytes) successfully initialized in 323ms (v0.2.0fa.20171011) (413ms)
+416ms ║╔Execution stage started
+452ms ║║Comparison (time) 78422795 is_after (time) 1508671080000 = true (5ms)
+453ms ║║Time restriction check passed
+454ms ║║Condition #8 evaluated true (32ms)
+455ms ║║Cancelling statement #8’s schedules…
+460ms ║║Requesting time schedule wake up at Mon, Oct 23 2017 @ 12:00:00 AM EDT
+463ms ║║Condition group #1 evaluated true (state did not change) (41ms)
+465ms ║║Cancelling statement #4’s schedules…
+491ms ║║Executed virtual command setAlarmSystemStatus (23ms)
+492ms ║║Skipping task 6 because of mode restrictions
+504ms ║║Executed virtual command sendPushNotification (8ms)
+507ms ║║Cancelling statement #2’s schedules…
+518ms ║║Skipped execution of physical command [Back Porch Light].off([]) because it would make no change to the device. (7ms)
+518ms ║║Executed [Back Porch Light].off (7ms)
+524ms ║║Skipped execution of physical command [Driveway Light].off([]) because it would make no change to the device. (3ms)
+525ms ║║Executed [Driveway Light].off (5ms)
+531ms ║║Skipped execution of physical command [Foyer Light].off([]) because it would make no change to the device. (3ms)
+532ms ║║Executed [Foyer Light].off (4ms)
+536ms ║║Skipped execution of physical command [Front Porch Light].off([]) because it would make no change to the device. (2ms)
+537ms ║║Executed [Front Porch Light].off (4ms)
+544ms ║║Skipped execution of physical command [Garage Lights].off([]) because it would make no change to the device. (5ms)
+545ms ║║Executed [Garage Lights].off (7ms)
+550ms ║║Skipped execution of physical command [Living Room Table Light].off([]) because it would make no change to the device. (3ms)
+551ms ║║Executed [Living Room Table Light].off (5ms)
+559ms ║║Skipped execution of physical command [Outdoor Landscape].off([]) because it would make no change to the device. (6ms)
+560ms ║║Executed [Outdoor Landscape].off (7ms)
+565ms ║║Skipped execution of physical command [Wine Rack Light].off([]) because it would make no change to the device. (3ms)
+566ms ║║Executed [Wine Rack Light].off (5ms)
+575ms ║║Comparison (string) off is (string) off = true (2ms)
+577ms ║║Condition #12 evaluated true (7ms)
+578ms ║║Condition group #9 evaluated true (state did not change) (9ms)
+580ms ║║Cancelling statement #10’s schedules…
+588ms ║║Skipped execution of physical command [Driveway Camera].off([]) because it would make no change to the device. (3ms)
+589ms ║║Executed [Driveway Camera].off (4ms)
+595ms ║║Skipped execution of physical command [Front Porch Camera].off([]) because it would make no change to the device. (2ms)
+595ms ║║Executed [Front Porch Camera].off (4ms)
+601ms ║║Skipped execution of physical command [Left Yard Camera 1].off([]) because it would make no change to the device. (3ms)
+602ms ║║Executed [Left Yard Camera 1].off (4ms)
+608ms ║║Skipped execution of physical command [Left Yard Camera 2].off([]) because it would make no change to the device. (3ms)
+609ms ║║Executed [Left Yard Camera 2].off (4ms)
+614ms ║║Skipped execution of physical command [Patio Door Camera].off([]) because it would make no change to the device. (3ms)
+615ms ║║Executed [Patio Door Camera].off (4ms)
+621ms ║║Skipped execution of physical command [Patio Left Camera].off([]) because it would make no change to the device. (3ms)
+622ms ║║Executed [Patio Left Camera].off (5ms)
+632ms ║║Skipped execution of physical command [Patio Right Camera].off([]) because it would make no change to the device. (7ms)
+633ms ║║Executed [Patio Right Camera].off (8ms)
+636ms ║╚Execution stage complete. (220ms)
+638ms ║Setting up scheduled job for Mon, Oct 23 2017 @ 12:00:00 AM EDT (in 7976.99s)
+671ms ╚Event processed successfully (671ms)


#2

whenever SHM status changes the if condition at line 29 is acting as a trigger causing the piston to be executed. if you dont want the piston to run when the SHM status changes click on the if condition and change the subscription method to never under options.

you may also want to consider changing the first if condition to time happens daily at sunrise. instead of time is after sunrise. if you do this there is no need to change the subscription method for line 29.


#3

Hi bangali, I was thinking that through just now but I never had this issue before and I change the status throughout the day for many reasons (for example if the house is empty and status goes to armed). Tonight is the first time this behavior occurred. I was making a lot of changes to other pistons, I swear I didn’t touch this one! I know I know, that sounds completely unrealistic. Anyway, yes I’ll unsubscribe it, I only want it to execute when the time pops. Thank you as always, and can you think of any reason why this would have worked previously, that is if you believe that i made no changes to it LOL.

And of course, yep that worked. I am perplexed.


#4

o i believe you. i am puzzled also. i see this piston was created a couple of months ago … may be there was a fix and now its behaving as it should? :slight_smile:

also changing the first if to happens daily at might be a better option.


#5

Yes, I’ll go with that - a fix! Then I can’t stop thinking about it :laughing:

Thanks again!


#6

you are welcome.