Difference between various ways to add-ons/integrations

Hey folks, I’m fairly new to HASS but have been diving head-first since I finally got it loaded on my rPi a few weeks ago. I’d like to get my power readings into HASS but there is no existing integration for it. So I started to look into how one goes about creating an integration. I’m super confused when it comes to the various ways to add custom integrations/addons. Can someone help me understand the difference between the following:

  • add-on - how is this different than an integration?
  • integration - how is this different than an add on?
  • official add-on - how does one get something added to that?
  • add-on repository
  • add-on registry - ???
  • Home Assistant Community Add-ons - a default “community” add on repo?
  • HACS integrations - how does one get something added to that?
  • HACS custom repositories - how does one create on?

I’ll take a stab at answering the above; please correct me as appropriate:

As far as I can tell an add-on is essentially a container that runs on your HASS instance. It exposes integrations which in turn can expose services, devices, and entities. The official add-ons are maintained by the Home Assistant team in an add-on repository here: https://github.com/home-assistant/addons. If you want to create your own add-ons you have to create your own add-on repository and you can use the official one as a reference. There’s documentation here: https://developers.home-assistant.io/docs/add-ons/publishing. The add-on registry might be a Docker thing? Not sure. Home Assistant Community Add-ons is simply a add-on repository located at https://github.com/hassio-addons/repository. It looks like you can’t add new add-ons to that repo anymore. It is enabled by default by HASS. HACS is the Home Assistant Community Store. It can be found here: https://hacs.xyz/. It installs itself somehow as an add on. I’m not sure why it doesn’t use the add-on repo model for installation but /shrug. Once installed HACS provides a bunch of custom integrations and UI elements you can use. You can add custom repositories to HACS. It’s documented here: https://hacs.xyz/docs/faq/custom_repositories. It’s not clear me why you would go this route over a non-HACS add-on repository.

Ultimately, I’m trying to answer: I have a NodeJS-based library for accessing power consumption via my power company’s API. What’s the best way for me to integrate that library with HASS while also making it re-usable for others?

1 Like

There’s a glossary.

TL/DR:

  • Add-on: Other software that runs in a special Docker container - they don’t expose integrations
  • Integration: How HA talks to/does things

Nope. It’s not an add-on, it’s a downloader for custom components (and Lovelace cards).

Because it’s not for add-ons.

  1. Re-write it as a Python library, create a custom component
  2. Publish an add-on that acts as a bridge between HA and the API, using an existing standard integration in HA (such as MQTT)

Thanks for the response. That glossary is very helpful!

I guess I still don’t understand:

Add-ons and HACS has nothing to do with each other, they are completely different.

How are they completely different? Add-ons? | HACS doesn’t really dive into too much detail.

  1. Re-write it as a Python library, create a custom component
  2. Publish an add-on that acts as a bridge between HA and the API, using an existing standard integration in HA (such as MQTT)

Are both of these required? Can you create a custom component without creating an add-on? It looks like some basic integrations can be written in the configuration.yaml itself but I don’t see how you integrate a python library with that.

Because HACS is not an “Other software that runs in a special Docker container - they don’t expose integrations”
HACS itself is (quite special) custom component, i.e. just python code, that downloads and install other custom components/integrations, i.e. Python code.
Addons can be programmed in anything, but they typically need an existing or new integration to talk to HA.

No, either. Point is custom components / integration are written in Python and nothing else, so you cannot do with your NodeJS code directly.

1 Like

Integrations are written in python.
Add-ons are written in any language you want.

Deciding between integration or add-on depends on how you intend to expose functionalities.

If you are limited to nodejs, then you only have add-on as option.

Ingress, web server, events, … they are examples of how to expose functionalities with add-on.

Just think of an add-on as any other app. Because that’s all that an add-on is. it’s just an app.

But…

apps can be run using a “containerization” implementation system called Docker. Docker Containers are kind of like VM’s but more limited. Containers contain all of the stuff needed for an app to run independently of the OS but still relying on it to a degree for basic functionality.

Add-ons are just apps that are created in Docker Containers that are specially designed to be implemented and maintained by the HA Supervisor system.

You can turn any Docker Container app into an add-on and any add-on app into a normal Docker Container.

They run completely outside of the HA system but as mentioned they are maintained by the Supervisor. You need an integration for HA to interact with them.

But they don’t even necessarily need to be integrated to HA at all either. They literally are completely stand-alone apps once the HA Supervisor creates them. They can be interacted with thru any other appropriate app as well.

An example of a popular add-on is MQTT. It is used for setting up MQTT communication on your network. HA can use the MQTT app thru the MQTT integration but any other MQTT-based clients can use the MQTT add-on too (Tasmota, ESPHome, Zwavejs2MQTT, Zigbee2MQTT, etc) and completely bypass HA altogether.

HACS on the other hand is just a means to download custom integrations, plugins, appdaemon apps into HA itself and providea a framework for getting notifications that there are updates to those things and a means to download the updates as desired.

I guess you can think of HACS being very similar to the Supervisor in this role but HACS handles integrations, etc and the Supervisor handles add-ons

The irony is that HACS itself is a custom integration that needs to be manually installed in HA before it can be used to automatically download and maintain other custom integrations.

Once the custom integration is downloaded to HA via HACS it will then be able to be used as a regular integration inside HA itself.

As mentioned above, integrations are how HA interacts with things outside of itself. Including add-ons.

Yes. By definition if you create a “component” (which they aren’t called that anymore - they are now called “integrations” instead) it is NOT an add-on because they are a completely different thing.

integrations - inside HA

add-ons - outside HA

I’ve never seen that.

you only ever configure the integration in yaml.

the integration itself is written in python just like the rest of HA.

I hope I haven’t confused things any more…

5 Likes