Skip to content

Discovery MQTT service registered in HA #7

@mik-laj

Description

@mik-laj

Hello,

It would be great if this extension automatically retrieved the credentials available in HA similarly to the Zigbee2MQTT extension.

This can be done using the Homeassistant Services API: Here are related docs:
https://developers.home-assistant.io/docs/add-ons/communication#services-api

This requires two changes:

  1. We need to define the services field in the config.json file.
    Here is example code from Z2M addon:
    https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/blob/f8e493f2c4610d6f062b6d1082e18f3d53e8d5a6/zigbee2mqtt/config.json#L10-L12
    Here are docs about services property:
    https://developers.home-assistant.io/docs/add-ons/configuration#optional-configuration-options

  2. In entrypoint we need to read the necessary credentials and configure environment variables.
    Here is example code from Z2M addon:
    https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/blob/f8e493f2c4610d6f062b6d1082e18f3d53e8d5a6/common/rootfs/docker-entrypoint.sh#L94-L102

Let me know if you're interested and I'll make a contribution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions