lbussy / brew-bubbles

It beats watching the grass grow!
https://www.brewbubbles.com
Other
18 stars 5 forks source link

Add HAST Support through MQTT #50

Open lbussy opened 1 year ago

lbussy commented 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}}
lbussy commented 1 year ago

This is going to have to wait till after I port to the ESP32 (#51).