Hi!
I am trying a bit to get MQTT Discovery working, I downloaded a python script (GitHub - greenMikeEU/SmartMeterEVNKaifaMA309: Dieses Projekt ermöglicht es den Smartmeter der EVN (Netz Niederösterreich) über die Kundenschnittstelle auszulesen.) that reads parameters from my smartmeter and publishes them to mosquitto.
I wanted to adapt the script to support discovery, I currently publish following discovery message to homeassistant/device/smartmeter/config
{
"dev": {
"ids": "smartmeter",
"name": "Smartmeter",
"mf": "Shenzhen Kaifa Technology",
"mdl": "Kaifa MA309M H4LAT1",
"sw": "1.0",
"sn": "",
"hw": ""
},
"o": {
"name": "Smartmeter",
"sw": "1.0",
"url": "https://github.com/greenMikeEU/SmartMeterEVNKaifaMA309"
},
"cmps": {
"smartmeterTotalEnergyExport": {
"p": "sensor",
"device_class": "measurement",
"unit_of_measurement": "Wh",
"value_template": "{{ value }}",
"unique_id": "TotalEnergyExport",
"state_topic": "homeassistant/sensor/smartmeter/TotalEnergyExport"
},
"smartmeterTotalEnergyImport": {
"p": "sensor",
"device_class": "measurement",
"unit_of_measurement": "Wh",
"value_template": "{{ value }}",
"unique_id": "TotalEnergyImport",
"state_topic": "homeassistant/sensor/smartmeter/TotalEnergyImport"
}
},
"qos": 0
}
In MQTT Explorer it currently looks like this:
I am trying to have the smartmeter as 1 device with multiple components (currently 2, TotalEnergyExport and TotalEnergyImport for testing, but there are more values i would like to get).
Can someone point me in the right direction or does have an example?
I find the documentation at MQTT - Home Assistant a bit confusing, I am not sure what i need to structure differently.
Thanks in advance
Cheers,
zuwizara