I tried to make a rule to get notify on Offline devices with http request rule like Josh explained in this post: Labs: SmartThings Health and Battery Reports
The problem is that I dont get notified by email.
And when I post my URL with the token I get a list of devices that are offline, but not all of them.
So my question are:
why I dont get an email
why not all of my devices are shown when I run the URL with my token.
There’s a few things I would check with your rule configuration:
The condition will never be valid as the content of textSummary is not going to be ' Offline'. If you want a notification only when there are devices that are offline, change the condition to be not and empty string (eg. add a space and then delete it, so the field is blank)
$context.response.data.textSummary is not ‘’
I’m not sure what the $context.response.data.textSummary` is in your HTTP Action. That line should be the exact same URL that you put into your browser to get the result in your last screenshot.
The email action was not shown in your screenshots above, but if I had to guess, the action has the text$context.response.data.textSummary in it rather than having used the +VARIABLE button next to the input to insert a variable.
The text should be a blue color if it’s using a variable as shown in the example we discussed on Facebook:
Maybe sharing some screenshots of what you’re seeing would help?
As mentioned above, this labs endpoint queries all of the devices in the SmartThings API for their reported health status and checks for their offline status. If the status is exactly'OFFLINE', then its added to the list of offline devices.
You could query the status of that individual device directly as shown in the following thread to see what the SmartThings API is reporting for it. It’s a bit more of a pain to test as you can’t do it in your browser and instead have to put some headers together.