Post by papa on Aug 17, 2017 19:34:15 GMT
Have OpenHAB Report an Offline RFM69 Gateway,
At one point, one of my RFM69 Gateways (I have 2 so far) was offline & not monitoring moisture in my garden. How might I have the system let me know that the Gateway might be offline?
If you don't see the Expire Binding to install it: When we first installed openHAB, it asked what package we wanted: Simple or Standard or Expert. We need to be in either Standard or Expert to see the 1.x bindings. To fix this I believe you can edit \conf\services\addons.cfg. Find the line that includes "#package = " & change it to "package = standard" or "package = expert" (no "#" to begin & disable the setting). Save the edited file & perhaps restart openHAB.
The following is based on my garden node. Adapt to your node:
From my .items file (Updated)
No additions needed for the .rules file so far.
To a .sitemap file, add the equivalent for your node:
Step 1, Report Possibly Offline Nodes
Updated April 21, 2020: OpenHAB 2.5.x & Using Uptime
At one point, one of my RFM69 Gateways (I have 2 so far) was offline & not monitoring moisture in my garden. How might I have the system let me know that the Gateway might be offline?
In this thread, I reported how OpenHAB's Expire Binding could be used to flag possibly offline nodes. At that point, when nodes' RSSI signals did not change for more than 3 minutes, I had those items report themselves "Offline?" via the Expire binding. Expire binding should be used with a value that normally changes during the time Expire binding allots. Update: The following reflects how, instead of RSSI, I now use Expire with Node Uptime. Always changing once a minute, Uptime is more reliable.
Update: Using Uptime required a small change in the node's firmware programming. Find here the Latest Choose Nodes sketch. As of April 17, 2020, that version reports node uptime to openHAB, but did not before that date. So download & customize the latest version to features the node needs. (Fairly late in the sketch at "// send0 = true; // send uptime" I deleted the initial "//" so node Uptime is sent to openHAB.)
Go to PaperUI/Add-ons/Bindings & install Expire Binding. (This will help us know if a device is offline.)
If you don't see the Expire Binding to install it: When we first installed openHAB, it asked what package we wanted: Simple or Standard or Expert. We need to be in either Standard or Expert to see the 1.x bindings. To fix this I believe you can edit \conf\services\addons.cfg. Find the line that includes "#package = " & change it to "package = standard" or "package = expert" (no "#" to begin & disable the setting). Save the edited file & perhaps restart openHAB.
The following is based on my garden node. Adapt to your node:
From my .items file (Updated)
String Node12UpTime "Gardn_12_Up [%s mins]" <network> (Nodes) { channel="mqtt:embedded-mqtt-broker:topic:mything:Node12Channel00", expire="3m,Offline?" }
[Caution: Do not omit the comma (,) before "expire." If you omit the comma, that won't throw an error, but stale values will not be reported.] From the first part of this post, adapt creating a Thing for your node.
Go to your equivalent of PaperUI/Configuration/Things/Node12garden.
Click on the blue disc beside your Uptime channel. Link it to your UpTime item.
Click on the blue disc beside your Uptime channel. Link it to your UpTime item.
No additions needed for the .rules file so far.
To a .sitemap file, add the equivalent for your node:
Text item=Node12UpTime
So far, the openHAB UserInterface/sitemap should report when the node is offline. (To test, you can remove the node from power.)