Post by papa on Aug 21, 2017 19:34:54 GMT
Using ESP82xx RSSI (Signal Strength or Possibly Offline)
By default, the ESP82xx sketches periodically send RSSI, WiFi signal strength to MQTT. How might one use this information via OpenHAB? Using entries like below, OpenHAB could display WiFi signal strength for each ESP82xx device OR "Offline?" if the RSSI value has gone stale for an allotted time. Displayed RSSI values could tell us how well our WiFi router & nodes are communicating & whether we need to consider different placement. ESP82xx nodes temporarily & strategically placed around a building could help us know how well WiFi signals are covering the area & placement might be improved.
The following requires the Expire Binding to be installed for OpenHAB. See this thread.
.items file for ESP82xx Node 61
String Node61Rssi "LR_61_RSSI (db)[%s]" <network> (Nodes) {mqtt="<[mosquitto:home/esp_gw/nb/node61/dev02:state:default]", expire="3m,Offline?" }
.sitemap (to display new page of all items in the Nodes group)
Group item=Nodes label="__Node Health__" icon="nodes"
OR .sitemap (to display just the one item)
Text item=Node61Rssi
If the node is disconnected more than 3 minutes, OpenHAB's Expire binding reports the item's status as Offline? Offline? status indicates that Node61 may be offline. The status is "stale" or unchanged for more than 3 minutes. For sure, the nodes disconnection could generate that status. However, Node61 may be connected, but has a RSSI that stays the same for at least 3 minutes. Increasing the Expire binding's time limit might decrease Offline? reports that happen while Node61 is connected.
With the following addition, OpenHAB could send us a message that a key node is possibly offline.
.rules file
rule "Is Living Room Node Offline" // checked every 10 minutes
when
Time cron "0 0/10 * * * ?"
then
if(Node61Rssi.state == "Offline?")
{
sendMail("YourEmail@gmail.com","from openhab","Living Room Node may be offline.")
}
end
By default, the ESP82xx sketches periodically send RSSI, WiFi signal strength to MQTT. How might one use this information via OpenHAB? Using entries like below, OpenHAB could display WiFi signal strength for each ESP82xx device OR "Offline?" if the RSSI value has gone stale for an allotted time. Displayed RSSI values could tell us how well our WiFi router & nodes are communicating & whether we need to consider different placement. ESP82xx nodes temporarily & strategically placed around a building could help us know how well WiFi signals are covering the area & placement might be improved.
The following requires the Expire Binding to be installed for OpenHAB. See this thread.
.items file for ESP82xx Node 61
String Node61Rssi "LR_61_RSSI (db)[%s]" <network> (Nodes) {mqtt="<[mosquitto:home/esp_gw/nb/node61/dev02:state:default]", expire="3m,Offline?" }
.sitemap (to display new page of all items in the Nodes group)
Group item=Nodes label="__Node Health__" icon="nodes"
OR .sitemap (to display just the one item)
Text item=Node61Rssi
If the node is disconnected more than 3 minutes, OpenHAB's Expire binding reports the item's status as Offline? Offline? status indicates that Node61 may be offline. The status is "stale" or unchanged for more than 3 minutes. For sure, the nodes disconnection could generate that status. However, Node61 may be connected, but has a RSSI that stays the same for at least 3 minutes. Increasing the Expire binding's time limit might decrease Offline? reports that happen while Node61 is connected.
With the following addition, OpenHAB could send us a message that a key node is possibly offline.
.rules file
rule "Is Living Room Node Offline" // checked every 10 minutes
when
Time cron "0 0/10 * * * ?"
then
if(Node61Rssi.state == "Offline?")
{
sendMail("YourEmail@gmail.com","from openhab","Living Room Node may be offline.")
}
end