Migration from OpenHAB to HA

Hi, and welcome to the HASS community,

I parallel ran openHAB and HASS for a year, rewrote automations, then moved over several years ago so know exactly the switch from Java(ish) to YAML. I still kind of miss complex tech posts from rlkoshak on the forums!

Top Tip Parallel-Run openHAB and HASS using one MQTT broker for both platforms. Publish from one to the other where needed.

Since then, HASS has become much easier to configure with many areas auto-configuring (something I first hated in openHAB - now love), or GUI.

  1. HASS does use several YAML ‘text’ files for config, however some elements are in a database. That’s not really an issue as HASS backups are TAR files of the raw config - add .tar to the and and you can extract individual files.
    The database-stored config tends to be stuff that is automated - e.g. discovered, created, so all you’ve done is add a location or name.
    If you really want to run a git blame, there are add-ons to sync backups and config to external media. Personally, I used to SCP automations.yaml & configuration.yaml but stopped once the config was stable.

Top Tip: I remember an openHAB presentation where MQTT auto-discovery was discussed and I was horrified at the potential removal of text file config.
I was VERY wrong!
The difference is:

  • openHAB uses a nest of complex text files to configure MQTT, full of syntax nasties (I used to have nightmares over adding RSSI to all devices :slight_smile: ).
    Device: simple; HA: very hard
  • HASS uses Auto-Discovery or Tasmota Discovery. Configure the DEVICE once with Friendly Name 1 and Device Name, and this IMMEDIATELY creates entities in HASS. More entiries exist than are displayed (e.g. RSSI is there, just not in the GUI, unless you want it)
    Device: harder; HA: automatic

(I’ve written custom devices in Python using HASS Discovery and it works well. I’ve written several posts on here going into the details of Python, Tasmota config, and ESPhome with discovery.)

Top Tip: If you use the Tasmota alternative ESPxx firmware, it moved away from HASS Discovery to Tasmota Discovery . Read up on SetOption19=0.

  1. Yes. There is a Studio Code Server, but I just use Add-Ons for Terminal & SSH and File editor (has basic completion and syntax checking in the browser, terminal copy-paste needs SHIFT pressed).

Top Tip: Use the interactive web-based tools in HASS to learn, prototype and debug. The Developer Tools tab has a lot to explore - just start searching. Template tab can be very useful to add complex extraction into YAML automations.

  1. YAML is typically significantly easier than the various rules engines in openHAB. It is different, more even driven and sometimes needs templating for text transformation. There are ways to write in Pyton, etc, but honestly, YAML works for me.
    One light automation in openHAB was 60 lines long - I achieved the same in 10 lines of YAML due to the event model and flipped logic.

Top Tip: YAML is based on indentation, which can be a PITA to spot errors. Use 4x spaces, expand tabs (yuck!), and if all else fails, copy-pasta the YAML into a web YAML linter to spot where you’ve missed something.

Top Tip: Use the GUI to create an automation FIRST to get the basic logic, then edit it as you need. Let the tool get the syntax right!

  1. Yes - HASS has long-term statistics with functions to extract and graph (like filter functions). ISTR some are add-ons in HACS (a community add-ons store).
    Some folks use a custom database for long-term stats but DON’T - you’ll end up with 4TB of raw rows that will eventually prevent you from updating (e.g. a good index optimisation that takes DAYS to complete as you’ve too much junk data).
    HASS summarises into 60minute (ISTR) after 10 days which is fine for me.
    You can get to the database to edit/ extract/ query if needed, the DB code keeps getting optimised (good extra indicies!), and the graphing is also regularly improving.

Top Tip: If you really want your old stats code to keep going, use MQTT and a trigger to publish values from HASS into MQTT / custom shell code.
There is also a RESTful API.

  1. HASS >> openHAB in reliability. I use a Yellow, which is basically a RPi4 with a SSD, but some use a SFF Intel box. The key difference is to understand HASS is the application, but HAOS includes the OS and update tooling. HAOS is very easy to admin, but is welded shut (unless to turn on dev mode). so some folk run a VM and manage it themselves.

Top Tip: If you want 100% availability, buy a pre-production test platform. A second RPi4 is cheap and gives you somewhere to test and experiment. It is also a cold spare…

  1. HASS has the same options as anything else - roll-you-own network, VPN, TailScale, SD-WAN, reverse-proxy, etc. Personally, I pay NabuCasa to fund development and make the remote access very easy. Push notifications to phone apps work as long as you have a network (email or other app connectors also work).

I often pepper my posts with links to docs, but basically, read the HASS user docs, then read the HASS developer docs, then search the forum.

Oh, and subscribe to the monthly HASS release party videos - an hour of time that basically has the developers explaining WHY change was made. Very useful.

If you’re doing complex stuff, keeping an eye on the dev blog can also be useful for detailed change notifications.

And yes, ask me!

If this helps, :heart: this post!

1 Like