I’ve connected my Lock with a Plug
I’ll be switching off the Plug then its status will be shown as OFFLINE by health API
Lock status should also OFFLINE but it is still shown as ONLINE by this API.
After CheckInterval duration is completed its status is turned to OFFLINE.
At this point when plug is turned on; plug turns ONLINE
Lock is showing ONLINE immediately using Refresh and then checking with Health API.
Why Lock is not shown as OFFLINE immediatly?
Welcome to the SmartThings Community, @vishal_g!
Can you provide more details about your use case, please?
- Are you using a Groovy DTH to integrate those devices or these actions are done through a Groovy SmartApp?
- Which Health API are you using to change the device health?
checkInterval is only used in Groovy-based handlers. Which are part of the Legacy platform, so I suggest you don’t rely too much on that.
Also, I’ve seen the health endpoint is used as read-only. When the API returns an “accepted” response, it doesn’t mean the command is executed correctly.
In the new way of integrating Hub-Connected devices (Edge drivers), Health Check is controlled by the Hub automatically. The healthCheck capability (to which
checkInterval belongs) is not used anymore.
Something I don’t quite understand is why the lock is connected to a plug, does that mean that the lock isn’t a smart device?
Open this section for other useful information as a reference:
- Edge drivers will replace the Groovy DTH, they don’t have a “graphic” environment so far, you can get the device information by making requests to the API or using the CLI.
- The health check in Edge depends on the reports made by the device. For example, some Z-Wave devices specifically have the “sleepy device” configuration and stop reporting their status which will make them offline.
a. It cannot be modified. Only the LAN devices (that are also Hub-connected) allow more control over the health status because the connection is different (but not through the healthCheck capability)
- A great place to start is checking the official drivers released by SmartThings:
No, that’s for devices created using a SmartApp which cannot be used for Hub-Connected devices. To change the value of an attribute, you can use “execute a command”.
It will depend on the commands available for each capability. And, you can also create custom ones to define your own values for internal use for example.
Just as a reference to others, the question in
1 was answered in the post above: