What's the best way to control Home Assistant devices from OpenHAB

Hi:
I’m adding some devices that are not supported by OH in Home Assistant, however I’d like to keep all automations in OpenHAB for now and hence I need a way in OH to:

  1. Read values from Home Assistant devices
  2. Send command (click button, change light dimmer etc).

I have MQTT broker and almost 0 experience with HA, I’m aware that there are add-on in HA to control OpenHAB devices but not sure anything the other way around.
Any suggestion what’s the most convenient way to support this? Thank you!

If you would tell us, which devices you are talking about, somebody might have an idea how to control it directly in openhab

The easiest is to install MQTT Statestream in Home Assistant. That will send every device/entity status or change to the MQTT Broker under homeassistant/ topic (and you can choose to exclude device/entities you don’t want to send to the broker). Your configuration.yaml could look like the below (without exclude section unless you add it):

mqtt_statestream:
  base_topic: homeassistant
  publish_attributes: true
  publish_timestamps: true
  exclude:
    entities:
      - weather.forecast_home
      - sun.sun

You can then use those topics to update OH. Going the other way (OH to HA) is pretty simple, but (to my limited knowledge of HA) requires automations to act on topic subscriptions. Here’s an example turning on a fan controlled by HA (command sent by OH):

1 Like

I have researched there are no binding existing. But here you go:

  1. I have a few native HomeKit cheap switches from Amazon, works fine with Homekit but doesn’t have open protocol, so I plan to use HA to bridge the device to HK (pity that OH doesn’t support bidirectional HK integration)
  2. Dreame Vacuum L20 Ultra, works fine in HA but no plan to support in OH.

Thanks looks doable and will give a try :slight_smile:

I just noticed that the actions were blank. I moved the fan to OH Matter and deleted the device in HA, but the automation remained. A better look at the “Then do” section looks like this: