Using OpenHAB As A Monitoring Platform

We work in building science and have Vera systems deployed which, at the minimum base-level install, monitor humidity levels in various locations.

I have been watching OpenHAB develop over the last couple of years and feel that it’s about the right time for us to start transitioning. I have a few questions regarding our use-case and what I can expect.

  1. We want to install OH on a RP, install a weather binding, and have it start a 24 hour timer if the humidity is above x% inside when it is above x deg. outside. If the RH stays above X for 24 hrs. We want an alert email sent to us and our client. If the RH drops below x% during the 24 hr. period the condition should expire with no action. I presently achieve this in Vera with the excellent Reactor Plugin.

Can I do this in OH with the rules engine, or will I be writing a script?

If it will take a script is this pretty easy cut & paste action or am I going down a rabbit hole?

  1. Is the rules engine the only thing available for doing this kind of thing from the UI?

  2. We also want to be able to graph out RH data. I think I saw that is native in OH?

  3. Holy grail - We would ideally like to have a single place where we could see all of our RH graphs. I tried a while back with our Vera systems but it seemed unreliable. Is anyone using a service like this with OH?

No problem.

umm, unclear about the question. Rules is rules, like a script. Independent of any UI. Of course, you can look at results on UI or “do things” to influence rules to run or not.

Rules may be scripted in one or all of several available scripting languages.

There is very basic charting function built in. Many users with more fancy requirements opt to add on Grafana which readily operates with OH produced data. “Fancy” in this context includes “show me the month before last” - the basic chart is really basic.

No… There is no reason to use such a service, if you alreay have openhab running, since openhab can trigger, or active other stuff on request and do notifications for you. It´s just a question of creating the right rules :smiley:

I believe by that you mean the “Rules” menu option in the (orange) Paper UI ?

You could but you’ll NOT want to use that, and least not in the long run.
You’ll want write a set of rules using OH’s Java-like DSL (Domain Specific Language) which in your terms would be a “script”.
These capabilities are NOT accessible through the UI. It means to write text files to contain DSL code.

It’s no rabbit hole but prepare yourself to learn OH rules programming independent of and before you start implementing so you have collected some experience in how to best approach a problem (and be it as simple as the one you described). Expect to implement all the data handling and logic yourself.
This is nothing less than programming. Powerful but it has its pitfalls and it’s not quick to learn, let alone point-and-click as most HA system interfaces.

Make sure your start into OH is comprehensive. Start with the docs.
Select a suitable HW and install method, learn the concepts, then move on to rules programming.

1 Like
  1. Pretty simple to do. Shouldn’t take more than a couple dozen lines of code really.

As others have said, the question doesn’t make much sense. I can guess what you really mean is creating Rules from PaperUI. In which case…

  1. Yes, the only way to do this in openHAB through a UI is to use the PaperUI created Rules. It should be noted that the “rule engine” that executes these rule as well as Python/JavaScript/Groovy text based Rules is the same.

  2. Mostly native. It does support charting but you will have to save your readings to a database. There are embedded databases (rrd4j) but you will probably want to choose MySQL/MariaDB or InfluxDB.

  3. Don’t use an external service. If you use one of the DBs mentioned above you can use Grafana to generate your charts.

If you really do want graphical UI based rules development something like NodeRed could be an option. But frankly, if this is all you want to do with this system I think openHAB is going to be way overkill. NodeRed all by itself might be a better fit.

Thanks for the responses.

Yes I meant the rule engine add on.

For the holy grail, I meant a place for us to see ALL of our graphs, from 30 something sensors residing on 15 or so buildings (at this point).

This is not all we need to do with OH, just the most basic system we install and a good place to start I think.

I will take a look at Grafana and look into writing some simple rules to see how it goes.

Thats the spirit!

Are you thinking multiple local openHAB instances, or a central system with remote sensing?

Either can be done, but bear in mind it’s a home automation system and is not optimized for interlinked instances.

If local instances, you might have them post raw data to some “HQ system” which can be potent enough to do fancy graphing.

Yes multiple instances. That’s what does .

OK, simpler question in teh same vein:

What is the easiest way to create a rule that starts a timer when my RH level hits a given point, cancel teh timer if it falls below that point, and send an email notification if it times out? I am assuming this has been done many times before - no need to start from scratch?

Like a freezer door open alarm?

Hi @fullmoonguru , I am Stan, one of the people behind We are actually out of our crib. If you still want to get your graphs easier way I am sure I can help you with that.

Can you tell me what was the issue you have experienced?

@Stan, that post was from 2 yrs. ago. I’m good with graphs now, thanks.