Import entities from Home Assistant

Hi, i use Home Assistant, but i also want to use OpenHab, i have some old android indoor tablets, that run Android 5 and openhab works in it , HA doesnt :slight_smile:

Is there an easy way to control entities from openhab to HA? Or maybe some import?
I’m new to openhab…

Or can i do it with curl commands? so that i use the API from HA itself?

thnx in advance

What, you mean integrating home assistant plugins into openHAB??
That would be a pretty cool concept, to have a sort of compatibility layer… wonder if it’s even feasible…

You could use existing OH rest API to control OH from HA or use OH HTTP binding to control HA, if HA is providing API for it.
However I have not seen this working, it’s just an idea.

Downside is definitively, that you manually need to maintain your smart home entities in both systems, therefore I would not use it to have everything available in both systems, but only where is a real need.

You can use the MQTT binding for this. Have a look here: Integration OH3 and HomeAssistant via MQTT binding

thnx , i also found this, the mqtt s the way to go
i could use indeed http binding and send rest command, but thats a lof ot programming again in openhab

Are you planning to duplicate your HA system in openHAB, or only make a few devices available to it? And what kinds of devices are they?

MQTT is definitely the way to go for things that must be primarily controlled by HA, but in other cases you may just be able to have them available in both.

No, it’s only for light/switch/cover domain, to turn stuff on/off from my indoor tablets (intercom)
I’m not interested to see sensors and stuff like that

In HA my lights are all TCP based lights, with canbus for states, I created my own addon for that… Not wanna duplicate it, it was quite difficult… So indeed mqtt is the way to go… That custom component looks interesting, it should setup a discovery too

Guys, all my entities in HA are converted to mqtt entities , I can now see states and can send payload for on/off…

Time to install openhab now :slight_smile:

I found this one :

But seems the basetopic is hardcoded? Can I change that in that binding? Seems it needs to be “homeassistant” ?

It’s hard coded because that’s what the Home Assistant MQT standard dictates it must be. If you use some other topic it won’t be that standard any longer. Both the Home Assistant and Homie MQTT topic topology standards have fixed root topics so clients know where to look for discovery.

I suspect you’d have to modify the binding code and rebuild to modify that to use some other topic.

Hi, thnx

well i was setting up this component:

it converts all my entities in HA into mqtt entities… so they can beu used on other systems like openhab for instance … so that step is done
but if i setup the “homeassisant” basetopic in that component,with discovery turned on the broker, it generates constanty duplicates in a loop… so i need to define another basetopic where the new mqtt enties are stored that will be synced to openhab

Is it possible to change that binding, so we can make the basetopic an option to configure?
Or i need to disable discovery on the broker
Or i need to modify the binding code …
i think its only the line below, right? i am new to openhab, need to install it also , but if i fork that binding, how can i make a new jar file of it and use it as a custom ?

Anything’s possible if someone volunteers to do it. You can file an issue but filing an issue is not a guarantee that the code will be modified. See How to file an Issue.

In the mean time, you can forego the automatic discovery and use Generic MQTT Things. It’s more work but you have full control over all aspects of the subscription and publication to the topics. Frankly, that’ll be a lot less work in the long run. It sounds like you only have a few relatively simple devices.

You’ll need to set up a dev environment (see Build System | openHAB). Once built you can put the add-on’s jar file into the addons folder for OH (location depends on how OH is installed).

my HA setup is verry big, lots of lights/scripts/covers sensors/automations … already using it for 8 years…
But the problem is, i have 2 indoor panels, that are being used for my doorbell intercom, they run android 5.0 in background, and can have 2 extra .apk files added, adding HA is usesless, way too slow to load the frontend…
But i installed openhab on it, and activated that demo server, its runs smooth
the idea was to just control lights/switches from those tablets, not the fancy stuff, just some basic entities …

I dont have an openhab environment yet, i like to have disocvery still turned on
Gonna install openhab on my synology… whats not clear to me yet, is how to make a new jar file, with that modified string for the basetopic? how can i do that ?

That’s what I meant by just a few simple devices. You don’t need to mirror everything in HA, just those few things you need to drive the tables.

I provided a link to the development documentation above. Start there.

Ok, thx for info, appreciated!

hmm , wanted to start installing on my synology 6 , following this tut:

it points me to 3.0 spk release here
but where is the spk? its missing there

ok, i did the docker approach instead, i was looking for the mqtt homeassistan binding? but where is it?
its not listed there?

It’s part of the MQTT binding. It’s not a separate binding, all three types of MQTT (Generic, Home Assistant, and Homie) are in the same add-on.

indeed, just figured out :slight_smile:
seems the base is configurable after all? i can type it in…

when i save this one, i still get error tough, any idea?

I’m pretty sure you still need to set up the MQTT Broker Thing to start. Then when that’s done you will select that Thing as the “Bridge”.

hmm, ok, added the broker, i see him online, but still: