I just received my gateway yesterday, and configured it to send sensor data to my local HA MQTT broker. There’s another thread here about using the pyscript add-on to process the events and feed them back into MQTT to take advantage of HA auto-discovery.
Question: since the gateway already has the code to send MQTT messages with the encoded data, would it be a reasonable approach to just add a configuration button for “Homeassistant (Auto-Discovery)” under the MQTT section in the web UI on the gateway, then use this flag to set the topic and message format, e.g.:
homeassistant/sensor/f33c5fc10393/humidity/config {"stat_t":"homeassistant/sensor/f33c5fc10393/humidity/state",
"json_attr_t":"homeassistant/sensor/f33c5fc10393/humidity/attributes",
"name":"Living Room Humidity","unit_of_meas":"%","dev_cla":"humidity",
"uniq_id":"ruuvitag_f33c5fc10393_humidity","device":{"ids":"ruuvitag-f33c5fc10393",
"mf":"Ruuvi Innovations Ltd","mdl":"RuuviTag","name":"Living Room"}}
homeassistant/sensor/f33c5fc10393/humidity/state 40
homeassistant/sensor/f33c5fc10393/humidity/attributes
{"RuuviTag":"f33c5fc10393","Measure":"Humidity","Unit":"%"}