[SOLVED] MQTT Auto Discovery using the Homie convention fails

  • Platform information:
    • OS: Ubuntu 18.04
    • mosquitto
    • openHAB: 2.5.0-SNAPSHOT Build #1597
    • MQTT Binding: 2.5.0.SNAPSHOT

Hello there!

I have made a script for my Fronius Photovoltaic Inverter to publish MQTT data using the Homie convention. This is the output from mosquitto_sub -v -h localhost -t 'homie/#'

homie/inverter-123456/$state init
homie/inverter-123456/$homie 3.0.1
homie/inverter-123456/$name Symo 15.0-3-M (1)
homie/inverter-123456/$nodes power,energy,status
homie/inverter-123456/$implementation python
homie/inverter-123456/$state ready
homie/inverter-123456/power/$name Power Flow
homie/inverter-123456/power/$type Current power flow data
homie/inverter-123456/power/$properties pv,grid,load,rel-selfconsumption
homie/inverter-123456/energy/$name Energy
homie/inverter-123456/energy/$type Summarized energy data
homie/inverter-123456/energy/$properties day,year,total
homie/inverter-123456/status/$name Status
homie/inverter-123456/status/$type Current status
homie/inverter-123456/status/$properties exporting-energy
homie/inverter-123456/power/pv/$name Solar energy production
homie/inverter-123456/power/pv/$unit W
homie/inverter-123456/power/pv/$datatype integer
homie/inverter-123456/power/grid/$name Power from grid
homie/inverter-123456/power/grid/$unit W
homie/inverter-123456/power/grid/$datatype integer
homie/inverter-123456/power/load/$name Power consumption
homie/inverter-123456/power/load/$unit W
homie/inverter-123456/power/load/$datatype integer
homie/inverter-123456/power/rel-selfconsumption/$name Relative self consumption
homie/inverter-123456/power/rel-selfconsumption/$unit %
homie/inverter-123456/power/rel-selfconsumption/$datatype integer
homie/inverter-123456/energy/day/$name Energy production this day
homie/inverter-123456/energy/day/$unit kWh
homie/inverter-123456/energy/day/$datatype float
homie/inverter-123456/energy/year/$name Energy production this year
homie/inverter-123456/energy/year/$unit kWh
homie/inverter-123456/energy/year/$datatype integer
homie/inverter-123456/energy/total/$name Energy production ever since
homie/inverter-123456/energy/total/$unit kWh
homie/inverter-123456/energy/total/$datatype integer
homie/inverter-123456/status/exporting-energy/$name Exporting energy to grid logical value
homie/inverter-123456/status/exporting-energy/$datatype boolean
homie/inverter-123456/power/pv 12281
homie/inverter-123456/power/grid -11971
homie/inverter-123456/power/load -309
homie/inverter-123456/power/rel-selfconsumption 3
homie/inverter-123456/energy/day 49.1
homie/inverter-123456/energy/year 3484
homie/inverter-123456/energy/total 3484
homie/inverter-123456/status/exporting-energy true
homie/inverter-123456/$state sleeping

By taking the time to implement it using the Homie convention I expected to be able to do MQTT Thing Auto Discovery but nothing shows up.

I have sucessfully using the Online verificator for Homie 3+, well, I must actually move the order a little bit, but it seems to be valid Homie 3.0.

Auto Discovery should work, -right? Can anyone tell me what’s wrong? Thanks in advance for your kind help.

EDIT: Maybe I have to add the thing manually and then the channels will be auto discovered?

When doing that I’ll need to add a Homie device ID. The help text says Homie Device ID. This is part of the MQTT topic, e.g. "homie/deviceid/$homie" Which is wrong. It actually expects just the device id, e.g. inverter-123456. I did that and the channels are now detected.

The question remains though if the thing shouldn’t be autodiscovered…

I waited some time and I also restarted openHAB. The item was then auto discovered. I can’t tell why it wasn’t detected in the first place.