Piston only works sometimes


#1

1) Give a description of the problem
My piston used to work fine before, but recently I have noticed that it works randomly.

2) What is the expected behavior?
When a presence Sensor changes to present 30mins before sunset, some lights should go on.

3) What is happening/not happening?
This piston used to work fine till a few months back, and now it works only once in a while, even though its way past sunset.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)

WORKING Piston:
26/09/2018, 22:56:15 +97ms
+2ms ╔Received event [BMW].presence = present with a delay of 185ms
+121ms ║RunTime Analysis CS > 20ms > PS > 61ms > PE > 40ms > CE
+124ms ║Runtime (38290 bytes) successfully initialized in 61ms (v0.3.108.20180906) (121ms)
+125ms ║╔Execution stage started
+172ms ║║Comparison (time) 82575228 is_between (time) 1537984260000 … (time) 1537941180000 = true (14ms)
+173ms ║║Time restriction check passed
+175ms ║║Condition #9 evaluated true (45ms)
+189ms ║║Comparison (enum) present changes_to (string) present = true (1ms)
+192ms ║║Cancelling condition #10’s schedules…
+193ms ║║Condition #10 evaluated true (17ms)
+194ms ║║Cancelling condition #1’s schedules…
+195ms ║║Condition group #1 evaluated true (state changed) (65ms)
+198ms ║║Cancelling statement #2’s schedules…
+219ms ║║Executed physical command [Garage Light].on() (15ms)
+220ms ║║Executed [Garage Light].on (17ms)
+259ms ║║Executed physical command [Patio Light].on() (36ms)
+260ms ║║Executed [Patio Light].on (38ms)
+283ms ║║Executed physical command [Porch Light].on() (20ms)
+285ms ║║Executed [Porch Light].on (22ms)
+309ms ║║Executed physical command [Shed Light].on() (21ms)
+310ms ║║Executed [Shed Light].on (23ms)
+314ms ║║Executed virtual command [Garage Light, Patio Light, Porch Light, Shed Light].wait (1ms)
+316ms ║║Requesting a wake up for Wed, Sep 26 2018 @ 11:03:15 PM BST (in 420.0s)
+321ms ║╚Execution stage complete. (197ms)
+323ms ║Setting up scheduled job for Wed, Sep 26 2018 @ 11:03:15 PM BST (in 419.995s)
+331ms ╚Event processed successfully (331ms)

FAILED Piston:
28/09/2018, 19:59:46 +415ms
+1ms ╔Received event [Vierka].presence = present with a delay of 75ms
+118ms ║RunTime Analysis CS > 16ms > PS > 47ms > PE > 55ms > CE
+120ms ║Runtime (38288 bytes) successfully initialized in 47ms (v0.3.108.20180906) (119ms)
+122ms ║╔Execution stage started
+171ms ║║Comparison (time) 71986544 is_between (time) 1538156760000 … (time) 1538114160000 = true (14ms)
+173ms ║║Time restriction check passed
+175ms ║║Cancelling condition #9’s schedules…
+176ms ║║Condition #9 evaluated true (48ms)
+191ms ║║Comparison (enum) present changes_to (string) present = false (1ms)
+193ms ║║Cancelling condition #10’s schedules…
+195ms ║║Condition #10 evaluated false (17ms)
+196ms ║║Condition group #1 evaluated false (state did not change) (68ms)
+199ms ║╚Execution stage complete. (77ms)
+200ms ╚Event processed successfully (201ms)


#2

I’m wondering if the issue stems from the use of sunset of the current day to sunrise of the same day. There are other $next sunrise and sunset system variables that might resolve the situation that you are experiencing.


#3

Have you confirmed your presence sensor is actually working? Are these phones or actual presence sensors? Because I’ve noticed with the latest update to the ST classic app my mobile presence doesn’t update for like 10 minutes after I arrive home.


#4

I think you might be right that’s it’s problems with smartthings, because since the past few months (all of a sudden) sometimes (not all times) both mobile presence Sensors now take a while to update. I normally park my car, come in and 5 mins later the sensor updates, where as it used to do that when I was 300 meters away from my house before. But the odd thing is that somes time while 300 metres away it shows the presence sensor has arrived, but the lights till don’t go on.

Oh well, I think there is nothing I can do about it, but I thought it was worth mentioning in case there was something obviously wrong with my piston, but I have updated the value to $next sunrise, so let me see if that helps.


#5

You might want to try deleting and re-adding your mobile presence sensor in SmartThings. Sometimes that clears it up. Also make sure that ST has background update permissions and isn’t being killed by any batter saving functions on your phone. For example, the new Android OS will kill background processes that aren’t whitelisted.