Piston - Device Status not running?


#1

1) Give a description of the problem
(PUT YOUR INFO HERE) I created a piston that seems to match others I found here on the forum exactly (I hope) yet it isn’t running. The status changed to offline, yet I have not received any type of alert, email or SMS. Currently the device is OFFline, yet it is showing that is ONline.

2) What is the expected behaviour?
(PUT YOUR INFO HERE) I expect the piston to run and check the status of the device, send an email and sms message if the device is offline.

3) What is happening/not happening?
(PUT YOUR INFO HERE) The piston is not checking the device.

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

1/16/2020, 8:44:02 AM +66ms
+1ms ╔Received event [X].time = 1579182242506 with a delay of -440ms
+151ms ║RunTime Analysis CS > 33ms > PS > 57ms > PE > 60ms > CE
+153ms ║Runtime (39930 bytes) successfully initialized in 57ms (v0.3.110.20191009) (151ms)
+154ms ║╔Execution stage started
+177ms ║║Condition #6 evaluated false (11ms)
+178ms ║║Condition group #2 evaluated false (state did not change) (12ms)
+180ms ║║Cancelling statement #7’s schedules…
+186ms ║║Calculating (string) All devices are online as of + (string) Thu, Jan 16 2020 @ 8:44:02 AM EST >> (string) All devices are online as of Thu, Jan 16 2020 @ 8:44:02 AM EST
+188ms ║║Calculating (string) All devices are online as of Thu, Jan 16 2020 @ 8:44:02 AM EST + (string) ! >> (string) All devices are online as of Thu, Jan 16 2020 @ 8:44:02 AM EST!
+191ms ║║Executed virtual command setState (0ms)
+196ms ║╚Execution stage complete. (42ms)
+206ms ║Setting up scheduled job for Thu, Jan 16 2020 @ 9:14:02 AM EST (in 1800.234s)
+213ms ╚Event processed successfully (213ms)


#2

Your trigger (IF BLOCK) is CHANGES TO, and your timer is set to 30 minutes.
For this piston to execute, 30 minutes and CHANGES TO must be at the very exact second, which is impossible…

Change your IF block to,
IF device status IS OFLINE

or get rid of the timer and keep the original if block
and it will be your main trigger for the piston.


#3

You can’t subscribe to $status trigger so you’re on the right track with polling.


#5

I changed it to IS offline, and it doesn’t make a difference, it is not recognizing a device that I know is offline. Any help is appreciated!


#6

So what does your piston look like at the moment? And can you show some full logs of it not working?


#7

That’s the thing, it is running, it is just not picking up that the device is down.

/19/2020, 10:02:21 AM +406ms
+0ms ╔Received event [X].time = 1579446142216 with a delay of -811ms
+139ms ║RunTime Analysis CS > 32ms > PS > 53ms > PE > 54ms > CE
+141ms ║Runtime (39938 bytes) successfully initialized in 53ms (v0.3.110.20191009) (140ms)
+142ms ║╔Execution stage started
+161ms ║║Comparison (string) HUB_DISCONNECTED is (string) OFFLINE = false (1ms)
+165ms ║║Condition #6 evaluated false (14ms)
+166ms ║║Condition group #2 evaluated false (state did not change) (15ms)
+168ms ║║Cancelling statement #7’s schedules…
+175ms ║║Calculating (string) All devices are online as of + (string) Sun, Jan 19 2020 @ 10:02:21 AM EST >> (string) All devices are online as of Sun, Jan 19 2020 @ 10:02:21 AM EST
+177ms ║║Calculating (string) All devices are online as of Sun, Jan 19 2020 @ 10:02:21 AM EST + (string) ! >> (string) All devices are online as of Sun, Jan 19 2020 @ 10:02:21 AM EST!
+180ms ║║Executed virtual command setState (1ms)
+183ms ║╚Execution stage complete. (41ms)
+184ms ║Setting up scheduled job for Sun, Jan 19 2020 @ 10:17:22 AM EST (in 900.626s)
+207ms ╚Event processed successfully (207ms)
1/19/2020, 9:47:21 AM +220ms
+0ms ╔Received event [X].time = 1579445242216 with a delay of -996ms
+300ms ║RunTime Analysis CS > 221ms > PS > 33ms > PE > 46ms > CE
+302ms ║Runtime (39939 bytes) successfully initialized in 33ms (v0.3.110.20191009) (301ms)
+303ms ║╔Execution stage started
+318ms ║║Comparison (string) HUB_DISCONNECTED is (string) OFFLINE = false (1ms)
+321ms ║║Condition #6 evaluated false (10ms)
+322ms ║║Condition group #2 evaluated false (state did not change) (11ms)
+325ms ║║Cancelling statement #7’s schedules…
+330ms ║║Calculating (string) All devices are online as of + (string) Sun, Jan 19 2020 @ 9:47:21 AM EST >> (string) All devices are online as of Sun, Jan 19 2020 @ 9:47:21 AM EST
+333ms ║║Calculating (string) All devices are online as of Sun, Jan 19 2020 @ 9:47:21 AM EST + (string) ! >> (string) All devices are online as of Sun, Jan 19 2020 @ 9:47:21 AM EST!
+335ms ║║Executed virtual command setState (0ms)
+338ms ║╚Execution stage complete. (35ms)
+340ms ║Setting up scheduled job for Sun, Jan 19 2020 @ 10:02:22 AM EST (in 900.657s)
+349ms ╚Event processed successfully (349ms)
1/19/2020, 9:32:21 AM +321ms
+0ms ╔Received event [Lanesville].time = 1579444342216 with a delay of -895ms
+139ms ║RunTime Analysis CS > 27ms > PS > 43ms > PE > 68ms > CE
+142ms ║Runtime (39938 bytes) successfully initialized in 43ms (v0.3.110.20191009) (141ms)
+143ms ║╔Execution stage started
+171ms ║║Comparison (string) HUB_DISCONNECTED is (string) OFFLINE = false (3ms)
+176ms ║║Condition #6 evaluated false (17ms)
+177ms ║║Condition group #2 evaluated false (state did not change) (19ms)
+179ms ║║Cancelling statement #7’s schedules…
+187ms ║║Calculating (string) All devices are online as of + (string) Sun, Jan 19 2020 @ 9:32:21 AM EST >> (string) All devices are online as of Sun, Jan 19 2020 @ 9:32:21 AM EST
+191ms ║║Calculating (string) All devices are online as of Sun, Jan 19 2020 @ 9:32:21 AM EST + (string) ! >> (string) All devices are online as of Sun, Jan 19 2020 @ 9:32:21 AM EST!
+193ms ║║Executed virtual command setState (1ms)
+196ms ║╚Execution stage complete. (53ms)
+197ms ║Setting up scheduled job for Sun, Jan 19 2020 @ 9:47:22 AM EST (in 900.698s)
+206ms ╚Event processed successfully (206ms)


#8

Hi there,
your emails are visible just so you know…


#9

And what is the contact sensors status in ST App…


#10

ugh, thanks!


#11

Right now it is showing as Offline.

Also if I take a green snapshot, I thought the email was supposed to go away?


#12

Your sensor is actually in the HUB_DISCONNECTED state, but the mobile app shows that as offline for whatever reason. I’ve never understood how devices get into that state, though rebooting the hub via the IDE tends to clear it. I get it occasionally, sometimes with just one device, sometimes several at once.

So you need to check for both OFFLINE and HUB_DISCONNECTED. Oh and probably INACTIVE too as that is a state used by devices that don’t support Device Health.


#13

When sharing a piston, Email/web addresses

  • that are set in the define section are not anonymized…
  • that are in the body of the piston are anonymized…

#14

Thanks @orangebucket, adding INACTIVE and HUB_DISCONNECTED did the trick!