Interoperability with other OpenHAB instance

It works pretty much the same as the /etc/openhab2 files but you want to stop openHAB first.

I submitted a PR with all the changes to github here.

You will notice there are three root directories.

  • home/pi/scripts : Needs to be copied to /home/pi/scripts
  • etc/openhab2 : Needs to be copied to /etc/openhab2
  • var/lib/openhab2 : Needs to be copied to /var/lib/openhab2

To upgrade you would follow the following steps:

  1. sudo apt update
  2. sudo apt upgrade, accept all the upgrades and make sure that openHAB is in the list of upgrades and it is upgrading to 2.5.3-1. This might take awhile.
  3. Stop openhab.
  4. Run /home/pi/scripts/backup.sh and move the backup.zip file somewhere safe.
  5. git clone https://github.com/rkoshak/hestia-touch-openhab.git to pull down the new configs.
  6. mv /home/pi/scripts /home/pi/scripts.old. Then cp hestia-touch-openhab/home/pi/scripts /home/pi/scripts.
  7. sudo mv /etc/openhab2 /etc/openhab2.old. Then sudo cp hestia-touch-openhab/etc/openhab2 /etc/openhab2. Finally sudo chown -R openhab:openhab /etc/openhab2.
  8. sudo mv /var/lib/openhab2 /var/lib/openhab2.old. then sudo cp hestia-touch-openhab/var/lib/openhab2 /var/lib/openhab2. Finally sudo chown -R openhab:openhab /var/lib/openhab2.
  9. sudo reboot

I like to log in via ssh right after the LCD goes to the “loading” screen and run tail -f /var/log/openhab2/openhab.log in one terminal and run top in another one. Even better would be to install multitail and htop and run those instead but tail and top are perfectly suitable. Watch for errors and over all load progress in the tail and pay attention to the load average in top. You will see “System is ready to operate, kicking off restored behaviors” when everything is done loading and initializing which should be only about ten minutes now as opposed to the 25-30 minutes.

You can see and modify all the Rules in PaperUI now and you can see them running.

See the PR link above for a brief tour of the Rules and how they interact with one another. I recommend that if you want to customize a Rule that you disable it first (press the alarm clock icon) and then create a new version. That way you are a couple of clicks away from restoring back to the known working Rule if you run out of time or run into trouble.

Each individual Rule is made up of three clauses (as opposed to the two for Rules DSL).

  • When… : the same as the Rule triggers when clause in Rules DSL
  • then…: the same as the Rule body in Rules DSL, where the code goes
  • but only if…: a set of conditions that are checked before allowing the Rule to run, for example, don’t let the HotWater Control Rule to run unless the SystemType == “EU”.

The script code is written in JavaScript but except for a few minor details it will look a whole lot like Rules DSL code.

There are a few convenience functions defined in /etc/openhab2/automation/lib/hestia/utils.js that get imported to some of the scripts that need to do things like logging or accessing createTimer and such.

I have not changed the OneUI at all and have no plans to (I don’t know how it works at this time) so this is still the case, you need to publish to both topics.