Open lbussy opened 1 year ago
Shared by mper on HBT:
There is a feature in Home Assistant called MQTT discovery. If you put a standard message on the broker then HA will automatically create a sensor for that. This is an example of what I use to create a beer sensor with some value and attributes: homeassistant/sensor/${mdns}_beer${tap}/config: {\"name\":\"${mdns}_beer${tap}\",\"state_topic\":\"homeassistant/sensor/","${mdns}_beer${tap}/state\",\"json_attributes_topic\":\"homeassistant/","sensor/${mdns}_beer${tap}/","attr\",\"unique_id\":\"${mdns}_beer${tap}\"} homeassistant/sensor/${mdns}_beer${tap}/state: ${beer-name} homeassistant/sensor/${mdns}_beer${tap}/attr: {\"abv\":${beer-abv},\"abv\":${beer-abv},\"ibu\":${beer-ibu},\"ebc\":"${beer-ebc}}
There is a feature in Home Assistant called MQTT discovery. If you put a standard message on the broker then HA will automatically create a sensor for that.
This is an example of what I use to create a beer sensor with some value and attributes:
homeassistant/sensor/${mdns}_beer${tap}/config: {\"name\":\"${mdns}_beer${tap}\",\"state_topic\":\"homeassistant/sensor/","${mdns}_beer${tap}/state\",\"json_attributes_topic\":\"homeassistant/","sensor/${mdns}_beer${tap}/","attr\",\"unique_id\":\"${mdns}_beer${tap}\"} homeassistant/sensor/${mdns}_beer${tap}/state: ${beer-name} homeassistant/sensor/${mdns}_beer${tap}/attr: {\"abv\":${beer-abv},\"abv\":${beer-abv},\"ibu\":${beer-ibu},\"ebc\":"${beer-ebc}}
This is going to have to wait till after I port to the ESP32 (#51).
Shared by mper on HBT: