Migration from OpenHAB to HA

Do you mean to use MQTT as a bridge between the 2 platforms during migration? So basically I should first migrate the integration to IoTs to HA while keeping the OH rules (OH receives data from HA instead), right?

Sounds right, but to be more epxlicit…

  • openHAB has a MQTT broker
  • Add HASS, add the MQTT add-on, connect HASS to the openHAB broker
  • Get MQTT devices working in both openHAB and HASS (e.g. Tasmota, Arduino, etc).
  • Port over automations openHAB → HASS
  • For non-MQTT devices like Z-Wave, migrate to HASS, but where openHAB still has functionality, use HASS to trigger an automation on <thing> and publish <thing> into MQTT for openHAB to use
  • Switch from a openHAB broker to a HASS broker
  • Turn off openHAB (if needed)

I’d like to learn more about automation possibilities in HA. I have read the documentation but seems I can only do IFTTT styled simple automation.

We could be here a while! :slight_smile: :mage:

For me, openHAB tended to encourage blocks of code with complex logic and local variables. HASS is more event driven, more asynchronous, so complex logic is broken down with templates, helper functions, and background processing maintaining shared state. Does the difference between Java and JavaScript make any sense?

e.g. One automation is an alarm clock:

  • ON/ OFF is controlled by a input_boolean.alarm_clock (like a GUI switch with a global state variable)
  • The date is converted to a form for TTS once using a trigger (docs) ; (code and good thead)
  • The automation is fired from a time pattern, and uses the other states.

delays

delay:
  hours: 0
  minutes: 0
  seconds: 40
  milliseconds: 0

loops

repeat:
  count: 2
  sequence: []

or use a template as a counter, do while?

Try the automations GUI - the examples were 10S hacks via edit in YAML.

query historical data

Not something I typically do, but there are template functions to perform calculations which can get complex with layers of IF THEN ELSE (random recent example).

I’ve seen stuff from Bayesian sensors to filters creating derived sensors from “dirty” primary data.

Try searching the forum as there’s a lot in here (two random examples using a template and SQL):


What other options do I have if I want to get the full power?

Look in HACS (a community add-ons store) for the sharper and more dangerous tools! These range from Spook (useful general toolbox hobby project from a core developer), to unmaintained code that might explode, but does something very clever.

Then use HASS as an API via MQTT, REST, webhooks, SSH, etc.

I probably should call out the “20 things” thread as it is quite good:

If this helps, :heart: this post!