OpenHAB and "System Health"

526 views
Skip to first unread message

Kjetil Asdal

unread,
Jan 22, 2015, 3:14:05 AM1/22/15
to ope...@googlegroups.com
Hi, 
I am currently evaluating OpenHAB (installed on Ubuntu server 14.04.1) before deciding whether to "go live", or not. 

I have played around with groups, items, rules and sitemaps for a while, and I am starting to get a good feel for the possibilities (and limitations) of the system. 

I have also successfully installed, configured and used some of the bindings that I believe I will be using in my production setup (e.g. zwave, http, astro, etc.). 

Just recently I added persistence (using MySQL) into the mix - and after just a few hours of reading up on how to add users, fix permissions, etc., I managed to get this working as well, :-) 

All-in-all, I am quite happy with the system so far, however, there is one more thing that I would like to address before taking the plunge and leaving my house in the hands of OpenHAB. 

Given that openHAB will be doing automated control of certain functions in the house (like heating for instance) it is very important to me that I know at all times whether the system is healthy, or not. I would like to be able to check this from time to time, but more importantly be notified immediatley if the system can no longer be considered healthy. For the immediate notification, I plan to send "alarms" using a push/notification service. 

Now, to cut a long story short (or maybe that is already too late), here are some of the "health checks" that I am considering:

1) Server (hardware and OS) - ping the machine that is running OpenHAB to check that it is alive. 

One problem with this is where to ping from. OpenHAB will be running on a standalone PC on my LAN. There are other computers on the LAN, but none of these are always-on. I could of course add another always-on computer to ping the OpenHAB computer, but then I guess I would have to monitor that computer as well... 

I guess the better solution is to monitor ("ping") the system from the outside (from some kind of cloud service that you trust to have a reasonable up-time). Is this a function that is already part of (or planned to be part of) 'my.openhab'? 

2) OpenHAB core application - check that OpenHAB "core application" is running. 

How can this be done? I can of course check the status of the openhab service/daemon and possibly check for some specific processes to be running on my system, but that would not really tell me if OpenHAB is "behaving well". It would be good if OpenHAB itself could provide a status. Maybe some kind of watch-dog functionality to determine whether the system is doing its "normal loop" or if it is stuck somewhere?

3) Bindings (and other addons) - check that binding is running...

Similar as for the OpenHAB core, it would be good to know the status of a specific binding. In addition to status about the binding itself, it would also be good to know what is happening on the "other side of the binding". 

Example: 
I am using the zwave binding with a lot of zwave devices in my network. I would very much like to get an indication if the zwave network is not well, e.g. a device has dropped off, or something. So basically comparing the network setup (configuration) with what is actually on the air at any given time. 

==

I realize that I may be asking a lot, but I think this kind of functionality is very important to a control system (if you leave control in the hands of someone else, you'd better make sure that they can handle it - and if they don't, that you are notified!).

I appreciate all thoughts, comments and suggestions on this topic. Also, I would be very happy to see some real-life examples of how you have addressed this in your system. 

BR
Kjetil


Christoph Wempe

unread,
Jan 22, 2015, 3:45:47 AM1/22/15
to ope...@googlegroups.com
I din't think, there functions are implemented yet.

But I belive these would be great improvements to oopenhab.
Maybe they already are planed for openhab2.

Ben Jones

unread,
Jan 22, 2015, 5:23:58 AM1/22/15
to ope...@googlegroups.com
The ZWave binding can be configured to update an item if a node 'dies', as well as reporting network statistics, so it is quite easy to 'keep an eye' on the ZWave side of things. I have a rule that notifies me immediately if any of my ZWave nodes die.

I think my.openhab will also report a notification if it loses connectivity with your openHAB instance - although I am not certain as I don't use my.openhab currently.

Gaël L'hopital

unread,
Jan 22, 2015, 10:24:00 AM1/22/15
to
To monitor openHAB aliveness, you can use my.openhab that reports a notification when openhab is online/offline.
To check it locally, I personally use munin.

Kjetil Asdal

unread,
Jan 22, 2015, 4:54:28 PM1/22/15
to ope...@googlegroups.com
Hi, 
Could you please provide some more details on how you enable/implement the reporting you mention using the ZWave binding? I have read through the information on the Wiki and cannot find and reference to these features.
/Kjetil

Ben Jones

unread,
Jan 22, 2015, 4:57:26 PM1/22/15
to ope...@googlegroups.com
Sure, here is my item file for the ZWave monitoring stuff;

zwave.items
Group     ZWave

Group:Switch:OR(ON, OFF) ZWaveNodeDead    "Dead Nodes [(%d)]"         <zwavedead>    (ZWave)

/* Controller stick statistics */
Group     ZWaveStats                                                                 (ZWave)
Number    ZWaveStats_SOF              "Start Of Frames [%d]"          <calculator>   (ZWaveStats)     { zwave="1:command=INFO,item=SOF" }
Number    ZWaveStats_CAN              "Cancelled Frames [%d]"         <calculator>   (ZWaveStats)     { zwave="1:command=INFO,item=CAN" }
Number    ZWaveStats_NAK              "Not Acknowledged Frames [%d]"  <calculator>   (ZWaveStats)     { zwave="1:command=INFO,item=NAK" }
Number    ZWaveStats_OOF              "Out Of Order Frames [%d]"      <calculator>   (ZWaveStats)     { zwave="1:command=INFO,item=OOF" }
Number    ZWaveStats_ACK              "Acknowledged Frames [%d]"      <calculator>   (ZWaveStats)     { zwave="1:command=INFO,item=ACK" }
Number    ZWaveStats_TimeOut          "Timed Out Packets [%d]"        <calculator>   (ZWaveStats)     { zwave="1:command=INFO,item=TIME_OUT" }

/* Controller information */
Switch    ZWaveNode1Dead              "Node 1 - Controller"           <zwavedead>    (ZWaveNodeDead)  { zwave="1:command=INFO,item=DEAD" }
Switch    ZWaveNode3Dead              "Node 3 - Fern Garden Light"    <zwavedead>    (ZWaveNodeDead)  { zwave="3:command=INFO,item=DEAD" }
Switch    ZWaveNode4Dead              "Node 4 - Entry Lights"         <zwavedead>    (ZWaveNodeDead)  { zwave="4:command=INFO,item=DEAD" }
Switch    ZWaveNode7Dead              "Node 7 - Stair Lights"         <zwavedead>    (ZWaveNodeDead)  { zwave="7:command=INFO,item=DEAD" }
Switch    ZWaveNode8Dead              "Node 8 - Garden Lights"        <zwavedead>    (ZWaveNodeDead)  { zwave="8:command=INFO,item=DEAD" }
Switch    ZWaveNode10Dead             "Node 10 - Garage Sensor"       <zwavedead>    (ZWaveNodeDead)  { zwave="10:command=INFO,item=DEAD" }
Switch    ZWaveNode11Dead             "Node 11 - Kitchen Lights"      <zwavedead>    (ZWaveNodeDead)  { zwave="11:command=INFO,item=DEAD" }
Switch    ZWaveNode12Dead             "Node 12 - Alarm Panel"         <zwavedead>    (ZWaveNodeDead)  { zwave="12:command=INFO,item=DEAD" }
Switch    ZWaveNode13Dead             "Node 13 - Dining Lights"       <zwavedead>    (ZWaveNodeDead)  { zwave="13:command=INFO,item=DEAD" }
Switch    ZWaveNode15Dead             "Node 15 - Sunseat Lights"      <zwavedead>    (ZWaveNodeDead)  { zwave="15:command=INFO,item=DEAD" }
Switch    ZWaveNode16Dead             "Node 16 - TV Lights"           <zwavedead>    (ZWaveNodeDead)  { zwave="16:command=INFO,item=DEAD" }
Switch    ZWaveNode17Dead             "Node 17 - Flood Sensor"        <zwavedead>    (ZWaveNodeDead)  { zwave="17:command=INFO,item=DEAD" }
Switch    ZWaveNode20Dead             "Node 20 - Front Door Sensor"   <zwavedead>    (ZWaveNodeDead)  { zwave="20:command=INFO,item=DEAD" }
Switch    ZWaveNode21Dead             "Node 21 - Hallway Sensor"      <zwavedead>    (ZWaveNodeDead)  { zwave="21:command=INFO,item=DEAD" }
Switch    ZWaveNode22Dead             "Node 22 - Bathroom Fan/Towels" <zwavedead>    (ZWaveNodeDead)  { zwave="22:command=INFO,item=DEAD" }
Switch    ZWaveNode23Dead             "Node 23 - Hallway Lights"      <zwavedead>    (ZWaveNodeDead)  { zwave="23:command=INFO,item=DEAD" }
Switch    ZWaveNode24Dead             "Node 24 - Garage Lights"       <zwavedead>    (ZWaveNodeDead)  { zwave="24:command=INFO,item=DEAD" }
Switch    ZWaveNode26Dead             "Node 26 - Ensuite Lights"      <zwavedead>    (ZWaveNodeDead)  { zwave="26:command=INFO,item=DEAD" }
Switch    ZWaveNode27Dead             "Node 27 - Ensuite LED/Towels"  <zwavedead>    (ZWaveNodeDead)  { zwave="27:command=INFO,item=DEAD" }
Switch    ZWaveNode28Dead             "Node 28 - Coffee Machine"      <zwavedead>    (ZWaveNodeDead)  { zwave="28:command=INFO,item=DEAD" }
Switch    ZWaveNode29Dead             "Node 29 - Back Door Sensor"    <zwavedead>    (ZWaveNodeDead)  { zwave="29:command=INFO,item=DEAD" }
Switch    ZWaveNode31Dead             "Node 31 - Ensuite Sensor"      <zwavedead>    (ZWaveNodeDead)  { zwave="31:command=INFO,item=DEAD" }
Switch    ZWaveNode32Dead             "Node 32 - Washing Machine"     <zwavedead>    (ZWaveNodeDead)  { zwave="32:command=INFO,item=DEAD" }
Switch    ZWaveNode33Dead             "Node 33 - Laundry Door Sensor" <zwavedead>    (ZWaveNodeDead)  { zwave="33:command=INFO,item=DEAD" }

And then I have a simple rule;

zwave.rules
rule "Dead ZWave node"
when
    Item ZWaveNodeDead changed to ON
then
    Notify_Warn.postUpdate("A ZWave node has died!!!")
end

You don't get the name of the node that has died, but whenever i get as notification I just open up my sitemap and have a look to see which one is being reported as dead.

home.sitemap (subset)
Frame label="ZWave" {
Text label="ZWave Network" icon="calculator" {
Frame label="ZWave Network Statistics" {
Text item=ZWaveStats_SOF
Text item=ZWaveStats_CAN
Text item=ZWaveStats_NAK
Text item=ZWaveStats_OOF
Text item=ZWaveStats_ACK
Text item=ZWaveStats_TimeOut
}
}
Text item=ZWaveNodeDead label="ZWave Nodes" {
Text item=ZWaveNode1Dead
Text item=ZWaveNode3Dead
Text item=ZWaveNode4Dead
Text item=ZWaveNode7Dead
Text item=ZWaveNode8Dead
Text item=ZWaveNode10Dead
Text item=ZWaveNode11Dead
Text item=ZWaveNode12Dead
Text item=ZWaveNode13Dead
Text item=ZWaveNode15Dead
Text item=ZWaveNode16Dead
Text item=ZWaveNode17Dead
Text item=ZWaveNode20Dead
Text item=ZWaveNode21Dead
Text item=ZWaveNode22Dead
Text item=ZWaveNode23Dead
Text item=ZWaveNode24Dead
Text item=ZWaveNode26Dead
Text item=ZWaveNode27Dead
Text item=ZWaveNode28Dead
Text item=ZWaveNode29Dead
Text item=ZWaveNode31Dead
Text item=ZWaveNode32Dead
Text item=ZWaveNode33Dead
}
}

Kjetil Asdal

unread,
Jan 23, 2015, 10:39:37 AM1/23/15
to
Thanks a lot!

I will add this to my setup for sure and see how it works. BTW; I found some info regarding the statistics in the examples section of the ZWave Wiki page, but nothing about the "dead" feature. Where did you get this information? Am I missing an important source of information about ZWave in particular or OpenHAB in general?

BR
Kjetil


torsdag 22. januar 2015 22.57.26 UTC+1 skrev Ben Jones følgende:
Sure, here is my item file for the ZWave monitoring stuff;
...

Jason Brunk

unread,
Jan 23, 2015, 1:00:54 PM1/23/15
to ope...@googlegroups.com
I don't have a lot of zwave stuff but this would be very helpful to know when and what dies.


On Friday, January 23, 2015 at 10:39:37 AM UTC-5, Kjetil Asdal wrote:
Thanks a lot!

I will add this to my setup for sure and see how it works. BTW; I found some info regarding the statistics in the examples section of the ZWave Wiki page, but nothing about the "dead" feature. Where did you get this information? Am I missing an important source of information about ZWave in particular or OpenHAB in general?

BR
Kjetil


torsdag 22. januar 2015 22.57.26 UTC+1 skrev Ben Jones følgende:
Sure, here is my item file for the ZWave monitoring stuff;
...

Ben Jones

unread,
Jan 23, 2015, 2:23:12 PM1/23/15
to ope...@googlegroups.com
I have had this stuff for ages, not sure when it was added, I think during the early days of the Zwave binding development, before even Chris got involved! The stats and these Dead flag is the only 'extras' that I am aware of.
Reply all
Reply to author
Forward
0 new messages