mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-14 21:06:28 +00:00
Add-ons services API (#411)
* Add-ons services API
* Update hassio_addon_communication.md
* Update hassio_addon_communication.md
* ✏️ Tweaks
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
12d1e2646d
commit
32280a2422
@ -40,7 +40,27 @@ Add-ons can call some API commands without needing to set `hassio_api: true`:
|
|||||||
|
|
||||||
***Note:*** For Home Assistant API access requirements, see above.
|
***Note:*** For Home Assistant API access requirements, see above.
|
||||||
|
|
||||||
|
## Services API
|
||||||
|
|
||||||
|
We have an internal services API to make services public to other add-ons without the user need to add additional configuration. An add-on can get the full configuration for a service to use and to connect to. The add-on need to mark the usage of a service over his [configuration](hassio_addon_config.md) in order to be able to access a service. All supported services, including its available options, are documented in the [API documentation][supervisor-services-api].
|
||||||
|
|
||||||
|
Supported services are:
|
||||||
|
|
||||||
|
- mqtt
|
||||||
|
- mysql
|
||||||
|
|
||||||
|
You can use Bashio to get this information for your add-on init as: `bashio::services <service> <query>`
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
MQTT_HOST=$(bashio::services mqtt "host")
|
||||||
|
MQTT_USER=$(bashio::services mqtt "username")
|
||||||
|
MQTT_PASSWORD=$(bashio::services mqtt "password")
|
||||||
|
```
|
||||||
|
|
||||||
[core-api]: https://www.home-assistant.io/developers/rest_api/
|
[core-api]: https://www.home-assistant.io/developers/rest_api/
|
||||||
[core-websocket]: https://www.home-assistant.io/developers/websocket_api/
|
[core-websocket]: https://www.home-assistant.io/developers/websocket_api/
|
||||||
[supervisor-api]: https://github.com/home-assistant/supervisor/blob/master/API.md
|
[supervisor-api]: https://github.com/home-assistant/supervisor/blob/master/API.md
|
||||||
[supervisor-addon-api]: https://github.com/home-assistant/supervisor/blob/dev/API.md#restful-for-api-addons
|
[supervisor-addon-api]: https://github.com/home-assistant/supervisor/blob/dev/API.md#restful-for-api-addons
|
||||||
|
[supervisor-services-api]:https://github.com/home-assistant/supervisor/blob/dev/API.md#services-1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user