Spent a few hours reading through posts and still confused. Actually more confused. So many ways to alert. I just want a simple alert that will ping the zwave device every XX minutes and if its OFFLINE then report as such. Not on and off, but OFFLINE.
This is what I have tried:
rule "Tower One Check"
when
Time cron "0 0/30 * 1/1 * ? *"
or
Thing "zwave:device:e06c6069:node5" changed from ONLINE to OFFLINE
then
if (Thing "zwave:device:e06c6069:node5" == OFFLINE)
logInfo("Tower One Offline", "Tower One is OFFLINE!")
//and do other things
end
I get this:
has errors, therefore ignoring it: [18,8]: no viable alternative at input 'Thing'
[18,14]: missing ')' at '"zwave:device:e06c6069:node5"'
[18,47]: no viable alternative at input 'OFFLINE'
In the logs, when the device goes offline it reports at “OFFLINE”
Here’s the what you can do in a rule to test for an OFFLINE state (irrespective of the type of OFFLINE state):
var Status = ThingAction.getThingStatusInfo("zwave:device:e06c6069:node5").getStatus()
if status.startsWith("OFFLINE") {
// Do something if the status changed to one of the OFFLINE states
}