DeviceWatch-DeviceStatus doesn't work


#1

1) Give a description of the problem
One of my pistons controlling a smart socket have stopped working since of october 5th.
I suspect it could have something to do with the parameter DeviceWatch-DeviceStatus under “Current States” in SmartThings IDE not being updated. When hovering that parameter in any of my connected units, that parameter hasn’t been updated since before Oct. 5th.

2) What is the expected behaviour?
The DeviceWatch-DeviceStatus parameter is supposed to hold information about the units current state - offline or online. In my piston I use an IF to check for DeviceWatch-DeviceStatus if the light in my kitchen is changed to offline (turned OFF on the wall switch) or changed to online (turned ON on the wall switch). If changed to offline/online, do this or that.

3) What is happening/not happening?
Nothing is happening. It’s like the piston doesn’t get or catch that information when the state changes. The state doesn’t change in SmartThings IDE either.

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full

14.10.2020 21.04.31 +815ms
+0ms ╔Starting piston... (v0.3.110.20191009)
+134ms ║╔Subscribing to devices...
+164ms ║║Subscribing to Køkkenbord lys.DeviceWatch-DeviceStatus...
+218ms ║║Subscribing to Elkedel...
+220ms ║╚Finished subscribing (93ms)
+271ms ╚Piston successfully started (271ms)
14.10.2020 18.47.10 +972ms
+1ms ╔Starting piston... (v0.3.110.20191009)
+140ms ║╔Subscribing to devices...
+174ms ║║Subscribing to Køkkenbord lys.DeviceWatch-DeviceStatus...
+261ms ║║Subscribing to Elkedel...
+263ms ║╚Finished subscribing (132ms)
+315ms ╚Piston successfully started (314ms)
14.10.2020 18.22.48 +954ms
+1ms ╔Starting piston... (v0.3.110.20191009)
+165ms ║╔Subscribing to devices...
+203ms ║║Subscribing to LeKlint.DeviceWatch-DeviceStatus...
+406ms ║║Subscribing to Elkedel...
+407ms ║╚Finished subscribing (253ms)
+463ms ╚Piston successfully started (461ms)
14.10.2020 17.54.20 +270ms
+1ms ╔Received event [Mit hjem].test = 1602690860267 with a delay of 2ms
+161ms ║RunTime Analysis CS > 23ms > PS > 4ms > PE > 135ms > CE
+164ms ║Runtime (37095 bytes) successfully initialized in 4ms (v0.3.110.20191009) (161ms)
+165ms ║╔Execution stage started
+180ms ║║Condition #2 evaluated false (8ms)
+182ms ║║Condition group #1 evaluated false (state did not change) (9ms)
+191ms ║║Condition #4 evaluated false (6ms)
+192ms ║║Condition group #3 evaluated false (state did not change) (7ms)
+197ms ║╚Execution stage complete. (32ms)
+199ms ╚Event processed successfully (199ms)
14.10.2020 10.39.48 +970ms
+1ms ╔Starting piston... (v0.3.110.20191009)
+132ms ║╔Subscribing to devices...
+163ms ║║Subscribing to Køkkenbord lys.DeviceWatch-DeviceStatus...
+213ms ║║Subscribing to Elkedel...
+214ms ║╚Finished subscribing (90ms)
+241ms ║Cancelling condition #2's schedules...
+242ms ║Cancelling condition #1's schedules...
+266ms ╚Piston successfully started (266ms)
5.10.2020 14.46.57 +658ms
+1ms ╔Received event [Køkkenbord lys].DeviceWatch-DeviceStatus = online with a delay of 44ms
+69ms ║RunTime Analysis CS > 21ms > PS > 4ms > PE > 45ms > CE
+72ms ║Runtime (37109 bytes) successfully initialized in 4ms (v0.3.110.20191009) (70ms)
+73ms ║╔Execution stage started
+80ms ║║Comparison (string) online changes_to (string) online = true (1ms)
+82ms ║║Cancelling condition #2's schedules...
+83ms ║║Condition #2 evaluated true (6ms)
+84ms ║║Cancelling condition #1's schedules...
+85ms ║║Condition group #1 evaluated true (state changed) (8ms)
+87ms ║║Cancelling statement #7's schedules...
+104ms ║║Executed physical command [Elkedel].on() (14ms)
+105ms ║║Executed [Elkedel].on (16ms)
+111ms ║║Comparison (string) online changes_to (string) offline = false (1ms)
+113ms ║║Cancelling condition #4's schedules...
+114ms ║║Condition #4 evaluated false (6ms)
+115ms ║║Cancelling condition #3's schedules...
+116ms ║║Condition group #3 evaluated false (state changed) (8ms)
+118ms ║╚Execution stage complete. (46ms)
+119ms ╚Event processed successfully (119ms)
5.10.2020 07.36.22 +940ms
+1ms ╔Received event [Køkkenbord lys].DeviceWatch-DeviceStatus = offline with a delay of 55ms
+96ms ║RunTime Analysis CS > 26ms > PS > 4ms > PE > 65ms > CE
+98ms ║Runtime (37112 bytes) successfully initialized in 4ms (v0.3.110.20191009) (96ms)
+99ms ║╔Execution stage started
+108ms ║║Comparison (string) offline changes_to (string) online = false (0ms)
+109ms ║║Cancelling condition #2's schedules...
+110ms ║║Condition #2 evaluated false (6ms)
+112ms ║║Cancelling condition #1's schedules...
+113ms ║║Condition group #1 evaluated false (state changed) (8ms)
+119ms ║║Comparison (string) offline changes_to (string) offline = true (0ms)
+120ms ║║Cancelling condition #4's schedules...
+121ms ║║Condition #4 evaluated true (6ms)
+122ms ║║Cancelling condition #3's schedules...
+123ms ║║Condition group #3 evaluated true (state changed) (8ms)
+126ms ║║Cancelling statement #5's schedules...
+153ms ║║Executed physical command [Elkedel].off() (22ms)
+154ms ║║Executed [Elkedel].off (24ms)
+157ms ║╚Execution stage complete. (58ms)
+158ms ╚Event processed successfully (158ms)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Can you control the device from the ST app? It sounds as though it may be out of range from the hub. Have you removed or moved any devices which could change the network mesh?


#3

Yes, I can control the devices from the ST app and from GH. In the ST app I made an automation for a button to turn the socket on/off, which also works fine.
But the piston that’s supposed to turn same socket on/off is not working.
I haven’t removed anything, and I can see in the SmartThings IDE that the devices are working properly, and are reconnecting without problems after having been switched off for a while. But the DeviceWatch-DeviceStatus will not update.


#4

Can you remember when your hub was updated? Wonder if that could have made a change?
Can webcore receive any other events from the device?


#5

The piston and the logs don’t seem to match.

The piston is using $status which is a fake attribute that calls device.getStatus() and can’t really be subscribed to even though it looks like it has been. getStatus() is what the IDE used to show for status (offline/online/inactive/active). I don’t know if this has been affected by the changes to device health. Quite possibly.

The logs are showing several piston starts which show a subscription to DeviceWatch-DeviceStatus. An online event and and offline event from DeviceWatch-DeviceStatus are tr working as expected and turning a switch on and off (at least from webCoRE’s point of view).

14.10.2020 21.04.31 +815ms
+164ms ║║Subscribing to Køkkenbord lys.DeviceWatch-DeviceStatus…
+218ms ║║Subscribing to Elkedel…

14.10.2020 18.47.10 +972ms
+174ms ║║Subscribing to Køkkenbord lys.DeviceWatch-DeviceStatus…
+261ms ║║Subscribing to Elkedel…

14.10.2020 18.22.48 +954ms
+203ms ║║Subscribing to LeKlint.DeviceWatch-DeviceStatus…
+406ms ║║Subscribing to Elkedel…

14.10.2020 17.54.20 +270ms
+1ms ╔Received event [Mit hjem].test = 1602690860267 with a delay of 2ms

14.10.2020 10.39.48 +970ms
+163ms ║║Subscribing to Køkkenbord lys.DeviceWatch-DeviceStatus…
+213ms ║║Subscribing to Elkedel…

5.10.2020 14.46.57 +658ms
+1ms ╔Received event [Køkkenbord lys].DeviceWatch-DeviceStatus = online with a delay of 44ms
+80ms ║║Comparison (string) online changes_to (string) online = true (1ms)
+104ms ║║Executed physical command [Elkedel].on() (14ms)
+111ms ║║Comparison (string) online changes_to (string) offline = false (1ms)

5.10.2020 07.36.22 +940ms
+1ms ╔Received event [Køkkenbord lys].DeviceWatch-DeviceStatus = offline with a delay of 
+108ms ║║Comparison (string) offline changes_to (string) online = false (0ms)
+119ms ║║Comparison (string) offline changes_to (string) offline = true (0ms)
+153ms ║║Executed physical command [Elkedel].off() (22ms)

#6

I have a piston that monitors a device–I have the “changes to” trigger and it never will trigger. In the same piston, I have a part that just runs every 15 minutes that looks at the status and if it is offline, it will run. I’m surprised to see yours used to work!


#7

Yeah, I’ve made some minor changes to the piston, but I noticed, like you pointed out, that $status doesn’t work.
Like I wrote in the descr. of the problem in my first post, the piston worked fine until October 5th., which you can see on the dates in the log.

Here the offline/online attributes is not parsed to webCoRE.
14.10.2020 21.04.31 +815ms
+164ms ║║Subscribing to Køkkenbord lys.DeviceWatch-DeviceStatus…
+218ms ║║Subscribing to Elkedel…

And here it’s just fine and dandy:
5.10.2020 14.46.57 +658ms
+1ms ╔Received event [Køkkenbord lys].DeviceWatch-DeviceStatus = online with a delay of 44ms
+80ms ║║Comparison (string) online changes_to (string) online = true (1ms)
+104ms ║║Executed physical command [Elkedel].on() (14ms)
+111ms ║║Comparison (string) online changes_to (string) offline = false (1ms)


#8

Yes, it worked finw until Oct. 5th.

See:
5.10.2020 14.46.57 +658ms
+1ms ╔Received event [Køkkenbord lys].DeviceWatch-DeviceStatus = online with a delay of 44ms
+80ms ║║Comparison (string) online changes_to (string) online = true (1ms)
+104ms ║║Executed physical command [Elkedel].on() (14ms)
+111ms ║║Comparison (string) online changes_to (string) offline = false (1ms)

DeviceWatch-DeviceStatus parsed the online attribute, like it’s supposed to.

But now:
14.10.2020 21.04.31 +815ms
+164ms ║║Subscribing to Køkkenbord lys.DeviceWatch-DeviceStatus…
+218ms ║║Subscribing to Elkedel…

It’s just saying “Subscribing to…” and it’s like the DeviceWatch-DeviceStatus is now “empty”.


#9

In SmartThings IDE, under My Hubs:
Last Updated: 2020-10-05 2:31 PM UTC

I tried changing the piston to check for changes in light level on my HUE strip, and then the piston worked as supposed to, so the connectivity is fine, and the piston works.
I’m pretty sure this has something to do with the latest update, which was pushed the following few days from Oct. 2nd, I’m sure a read somewhere.


#10

95% of the time, attributes that begin with “$” cannot be used as a trigger.
(IE: you got lucky before, but now you are in the same boat as the rest of us, LOL)


#11

Eeerrr… Like I said, $status didn’t work, which I kinda expected it wouldn’t.
DeviceWatch-DeviceStatus which doesn’t have a “$” used to work fine.


#12

Sorry, I should have elaborated… Let me try again.

95% of the time, attributes that begin with “$” or pic cannot be used as a trigger .


pic


#13

That is the ‘Starting piston’ log. It is what you see when the piston starts up after a saved edit or after a resume. The piston works its way through the code working out what device attributes to subscribe to, setting up initial scheduled executions etc. In this case the piston subscribes to the DeviceWatch-DeviceStatus attribute of the kitchen table light, and also fakes a subscription to the kettle so the piston appears in ‘In use by’ in the IDE.

Yes, this time a DeviceWatch-DeviceStatus event has occurred and the piston is handling it.


#14

Ok… Do you happen to know if any documentation about this is available anywhere?
I tried searching the SmartThings documentation, and found nothing. Didn’t want to browse though it like looking for a needle in a haystack =)

Oh, I see… But do not quite understand. It subscribes, but doesn’t actually get anything from that in this case - and the process just kind of halts?


#15

Yes, each piston is implemented as a SmartThings SmartApp. Like any SmartApp, when it starts up it does some housekeeping and then it sleeps until an event of interest occurs. So for a piston, it looks to see what device attribute changes are significant to it and “subscribes” to the those events, and also looks to see if it needs to be woken at a particular time to do something. Then it just sleeps until an event arrives. Executing pistons are event handlers.


#16

Ok then… makes sense, but I didn’t learn what could suddenly have changed that caused my piston to stop working. Keep in mind it used to work until Oct. 5th - same day my Hub was updated.
Do you use DeviceWatch-DeviceStatus in any of your pistons?


#17

October 5th is about the time the last hub firmware update was processed, and that included the code to implement device health on the hub instead of in the cloud for hub connected devices. So things could have changed. Certainly I am not seeing any Health Check attributes being populated in the IDE any more, apart from checkInterval. Same for the REST API. Actually I’ll correct that. The only populated values are the ones that have been explicitly set.

However your piston logs show that DeviceWatch-DeviceStatus events are still occuring and your piston is responding to them and turning a device on and off.

I have never seen any documentation on the Health Check capability and the only examples of any of the capabilities being used has been their being set manually.

In the ‘new’ environment, there is a Health API that is separate to the capabilities.


#18

If you check again, you will notice the piston hasn’t been activated by the DeviceWatch-DeviceStatus event since Oct. 5th. The other events are from when I ran a test in the webCoRE editor.

Anyway, are you aware of any other methods to check if my HUE lightstrip is offline/online?


#19

There are tidbits scattered all throughout this forum, but my statement above is actually based on personal observations over the years while working with hundreds of different devices.

IE: I suspect that very few have compatible code in the handler.


#20

Yes, I stand corrected and that is at least more consistent.

It does seem to leave legacy app users lacking any way of triggering on changes.