ha-mqtt-discovery
A library that provides tools to simplify MQTT discovery implementation for Home Assistant to your device.
Generate MQTT entities in Home Assistant
- Create
devices/ha/DEVICENAME/discovery.yaml
- Optional add additional discovery items schema to
devices/ha/DEVICENAME/schemalist.yaml
- Add device and sourcfolder to
config.py
- Run
python3 app.py
#!/usr/bin/python3
# -*- coding":" utf-8 -*-
from lib import logger
from conf import *
from lib.ha_discoveryitems import *
log = logger.Log(__name__, LOG_LEVEL)
if __name__ == "__main__":
"""simple testcase to create and publish ha mqtt discovery items"""
for device in DEVICES:
print(device["device"])
hadis = haDiscoveryItems(devicename=device["device"], folder=device["source"])
n = hadis.publish()
log.info("HA Discovery {} Items: {}".format(device["device"], n))
Info
https://github.com/plapointe6/HAMqttDevice
https://github.com/shaonianzhentan/node-red-contrib-ha-mqtt
https://flows.nodered.org/node/node-red-contrib-ha-mqtt
https://webworxshop.com/home-assistant-mqtt-discovery-sensors-in-node-red/
https://roelofjanelsinga.com/articles/mqtt-discovery-with-an-arduino/