-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Hass.io add-ons <> Home Assistant components #324
Comments
I think we can that solve very simple and high powerful (based on idea of paulus): API for Add-ons / homeassistant config: In example of snips. The add-on (is tagged as application and run after startup of home-assistant) can read the home-assistant configuration for mqtt and connect the snips to this mqtt or setup a own mqtt server. Now it send the own mqtt server config or/and request the snips component setup with next API. API for Add-ons / discovery: In example of mqtt. The add-on (is tagged as system and startup on stage 2 before home-assistant) can push the config they is needed to setup the component on home-assistant. I.e. the core-mqtt add-on will setup a hass user if the user config is enable or if they is open it push the data for connection. API for Home-Assistant hassio component: It can read the wanted setups for add-ons and setup it in home-assistant with the given config. There are other add-ons they use mqtt and they can read the actual given mqtt settings from home-assistant and connect to this server. He don't need know if there is a add-on setup or somethings else. There need also no blocking APIs or any knowlage or other APIs inside home-assistant. |
So it would then look like this: Startup of MQTT add-on (system stage):
This will still work If Home Assistant contains a platform that depends on MQTT because MQTT will check Hass.io during setup of the component. Start of Snips add-on (application stage):
|
We have to take into account, that there are (and will be) multiple add-ons providing the "same" service. E.g. don't lock onto build-in/known add-ons. (Which is cover fairly in the above). Nevertheless, what if 2 active add-ons provide the same services? E.g. 2 MySQL add-ons? |
Correct: Start of Snips add-on (application stage):
@frenck That will be a mission of the add-on. He can provide stuff to home-assistant but he don't need it. I think also the add-on should be expose this handling as a option like |
@pvizeli I agree, I was just exposing/questioning a potential "bad path" in the case where 2 add-ons where conflicting. Adding this to the design in the first place will definitely reduce headaches later on. |
Add-on config
Config APIGET - return the hass config or provided configs from a other add-ons. Discovery send APIPOST -
Discovery read APIGET -
|
Quick question about config format: What do you think of getting configs more aligned? For example using yaml for addon config, and maybe allowing addon config to be part of the /config folder for home assistant (something like !include packages, but !include addons)? |
@ciotlosm please open a new issue for this. For conflicts: if an add-on says which config they might potentially provide, we can do conflict checking and show a picker in the UI.
|
Add-on config
Publish a service inside hass.ioFirst service is mqtt. A add-on can write data into this node and other can read it, some services i.e. mqtt can also set by home-assistant (user). If a add-on write the service, he can also trigger a discovery on home-assistant. Read service settingsGET - return the service setting from this hass.io system. Return value is service specific. Write service settingsPOST - DiscoveryAllow to trigger a discovery inside home-assistant to install and setup a component automatic by add-on. Discovery send APIPOST -
Discovery read APIGET -
|
So now that we're going to get config entries, I think that we should change this slightly. It's no longer going to be based on 'discovery' on the Home Assistant side but instead about config entries. Read more about config entries here (docs are inside the source) |
I think the discovery on hassio is not bounded to discovery on home-assistant. It give only a hint to home-assistant with the configs for setup this component/platform with whatever. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This has been implemented, see MQTT add-on as an example. |
I think that it would be great if we could add awareness to our components that supporting Hass.io add-ons exist and vice versa. Main component when I"m thinking about this is MQTT. It's the backbone of DIY IoT and if we can help make setup easier, we can unlock a lot of potential things.
Use case 1:
Requirements:
core/mosquitto
add-on but insteadmqtt-server
.Problems:
Use case 2:I had this as another use case but I think a better solution would be for the snips add-on to directly communicate with the mosquitto add-on to see if it exists (via the network layer) and make a connection like that.
The text was updated successfully, but these errors were encountered: