# Import entities from Home Assistant

**URL:** <https://community.openhab.org/t/import-entities-from-home-assistant/136953>\
**Category:** 3rd Party\
**Created:** [June 28, 2022, 9:26am UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953 "2022-06-28T09:26:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabio\_Pergola](https://community.openhab.org/user_avatar/community.openhab.org/fabio_pergola/32/77867_2.png) [@Fabio\_Pergola](https://community.openhab.org/u/Fabio_Pergola)\
**Post date:** [June 28, 2022, 9:26am UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/1 "2022-06-28T09:26:28Z")

</div>

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 🙂

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

---

<div class="post-metadata">

**Author:** ![Pedro\_Liberal](https://community.openhab.org/user_avatar/community.openhab.org/pedro_liberal/32/113638_2.png) [@Pedro\_Liberal](https://community.openhab.org/u/Pedro_Liberal)\
**Post date:** [June 28, 2022, 10:53am UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/2 "2022-06-28T10:53:13Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Matze0211](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/c0e974/32.png) [@Matze0211](https://community.openhab.org/u/Matze0211)\
**Post date:** [June 28, 2022, 12:22pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/3 "2022-06-28T12:22:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mherwege](https://community.openhab.org/user_avatar/community.openhab.org/mherwege/32/19924_2.png) [@Mherwege](https://community.openhab.org/u/Mherwege)\
**Post date:** [June 28, 2022, 12:41pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/4 "2022-06-28T12:41:43Z")

</div>

You can use the MQTT binding for this. Have a look here: [Integration OH3 and HomeAssistant via MQTT binding](https://community.openhab.org/t/integration-oh3-and-homeassistant-via-mqtt-binding/131358)

---

<div class="post-metadata">

**Author:** ![Fabio\_Pergola](https://community.openhab.org/user_avatar/community.openhab.org/fabio_pergola/32/77867_2.png) [@Fabio\_Pergola](https://community.openhab.org/u/Fabio_Pergola)\
**Post date:** [June 28, 2022, 1:58pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/5 "2022-06-28T13:58:21Z")

</div>

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

> **[MQTT DiscoveryStream integration](https://community.home-assistant.io/t/mqtt-discoverystream-integration/347945)**
>
> This is an “extension” (and compatible replacement) of the builtin mqtt\_statestream integration. Besides the functionalities of the here-above, it also allows to publish and handles an MQTT “disvovery” setup. This is specifically useful in...

---

<div class="post-metadata">

**Author:** ![rpwong](https://community.openhab.org/user_avatar/community.openhab.org/rpwong/32/36036_2.png) [@rpwong](https://community.openhab.org/u/rpwong)\
**Post date:** [June 28, 2022, 6:44pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/6 "2022-06-28T18:44:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Fabio\_Pergola](https://community.openhab.org/user_avatar/community.openhab.org/fabio_pergola/32/77867_2.png) [@Fabio\_Pergola](https://community.openhab.org/u/Fabio_Pergola)\
**Post date:** [June 29, 2022, 4:56am UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/7 "2022-06-29T04:56:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fabio\_Pergola](https://community.openhab.org/user_avatar/community.openhab.org/fabio_pergola/32/77867_2.png) [@Fabio\_Pergola](https://community.openhab.org/u/Fabio_Pergola)\
**Post date:** [June 29, 2022, 3:47pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/8 "2022-06-29T15:47:00Z")

</div>

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 🙂

I found this one :

> **[Home Assistant MQTT Components - Bindings](https://www.openhab.org/addons/bindings/mqtt.homeassistant/)**
>
> NOTE: This binding is provided by the MQTT binding, and therefore no explicit installation is necessary beyond installing the MQTT binding.

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

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [June 29, 2022, 4:08pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/9 "2022-06-29T16:08:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Fabio\_Pergola](https://community.openhab.org/user_avatar/community.openhab.org/fabio_pergola/32/77867_2.png) [@Fabio\_Pergola](https://community.openhab.org/u/Fabio_Pergola)\
**Post date:** [June 29, 2022, 4:42pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/10 "2022-06-29T16:42:10Z")

</div>

Hi, thnx

well i was setting up this component:

> **[GitHub - koying/mqtt\_discoverystream\_ha: Extension of HA mqtt\_statestream integration with...](https://github.com/koying/mqtt_discoverystream_ha)**
>
> Extension of HA mqtt\_statestream integration with discovery config publishing

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 ?

[https://github.com/openhab/openhab-addons/blob/main/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/generic/internal/MqttBindingConstants.java#L30](https://github.com/openhab/openhab-addons/blob/main/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/generic/internal/MqttBindingConstants.java#L30)

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [June 29, 2022, 4:53pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/11 "2022-06-29T16:53:09Z")

</div>

> [@Fabio\_Pergola](#):
>
> Is it possible to change that binding, so we can make the basetopic an option to configure?

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](https://community.openhab.org/t/how-to-file-an-issue/68464).

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.

> [@Fabio\_Pergola](#):
>
> 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 ?

You’ll need to set up a dev environment (see [Build System | openHAB](https://www.openhab.org/docs/developer/buildsystem.html)). Once built you can put the add-on’s jar file into the addons folder for OH (location depends on how OH is installed).

---

<div class="post-metadata">

**Author:** ![Fabio\_Pergola](https://community.openhab.org/user_avatar/community.openhab.org/fabio_pergola/32/77867_2.png) [@Fabio\_Pergola](https://community.openhab.org/u/Fabio_Pergola)\
**Post date:** [June 29, 2022, 5:16pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/12 "2022-06-29T17:16:05Z")

</div>

> [@rlkoshak](#):
>
> It sounds like you only have a few relatively simple devices.

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 ?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [June 29, 2022, 6:12pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/13 "2022-06-29T18:12:46Z")

</div>

> [@Fabio\_Pergola](#):
>
> 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 …

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.

> [@Fabio\_Pergola](#):
>
> 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 ?

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

---

<div class="post-metadata">

**Author:** ![Fabio\_Pergola](https://community.openhab.org/user_avatar/community.openhab.org/fabio_pergola/32/77867_2.png) [@Fabio\_Pergola](https://community.openhab.org/u/Fabio_Pergola)\
**Post date:** [June 29, 2022, 6:38pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/14 "2022-06-29T18:38:17Z")

</div>

Ok, thx for info, appreciated!

---

<div class="post-metadata">

**Author:** ![Fabio\_Pergola](https://community.openhab.org/user_avatar/community.openhab.org/fabio_pergola/32/77867_2.png) [@Fabio\_Pergola](https://community.openhab.org/u/Fabio_Pergola)\
**Post date:** [June 30, 2022, 9:06am UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/15 "2022-06-30T09:06:20Z")

</div>

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

> **[Synology DiskStation](https://www.openhab.org/docs/installation/synology.html)**
>
> a vendor and technology agnostic open source automation software for your home

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

> **[Releases · openhab/openhab-syno-spk](https://github.com/openhab/openhab-syno-spk/releases)**
>
> openHAB Synology SPK Install Package. Contribute to openhab/openhab-syno-spk development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Fabio\_Pergola](https://community.openhab.org/user_avatar/community.openhab.org/fabio_pergola/32/77867_2.png) [@Fabio\_Pergola](https://community.openhab.org/u/Fabio_Pergola)\
**Post date:** [June 30, 2022, 7:10pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/16 "2022-06-30T19:10:31Z")

</div>

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

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/9/8/9817a980991634e30da72ccbad329c8ac98ec85c.png)

> **[Home Assistant MQTT Components - Bindings](https://www.openhab.org/addons/bindings/mqtt.homeassistant/)**
>
> NOTE: This binding is provided by the MQTT binding, and therefore no explicit installation is necessary beyond installing the MQTT binding.

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [June 30, 2022, 7:17pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/17 "2022-06-30T19:17:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Fabio\_Pergola](https://community.openhab.org/user_avatar/community.openhab.org/fabio_pergola/32/77867_2.png) [@Fabio\_Pergola](https://community.openhab.org/u/Fabio_Pergola)\
**Post date:** [June 30, 2022, 7:21pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/18 "2022-06-30T19:21:26Z")

</div>

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

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

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/4/c/4c6e515b38f6a357be233cf4eee082a008115ea2.png)

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [June 30, 2022, 7:23pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/19 "2022-06-30T19:23:35Z")

</div>

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”.

---

<div class="post-metadata">

**Author:** ![Fabio\_Pergola](https://community.openhab.org/user_avatar/community.openhab.org/fabio_pergola/32/77867_2.png) [@Fabio\_Pergola](https://community.openhab.org/u/Fabio_Pergola)\
**Post date:** [June 30, 2022, 7:30pm UTC](https://community.openhab.org/t/import-entities-from-home-assistant/136953/20 "2022-06-30T19:30:34Z")

</div>

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

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/4/a/4add4e2a08bfbf730ce58503f4044e810d81c86f.png)

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/5/f/5fb1be1cfe5fca3cdf23ee211c3b837546199780.png)

[Next page](https://community.openhab.org/t/import-entities-from-home-assistant/136953.md?page=2)
