Yeah the MQTT discovery documentation has never been very easy to follow.
The main point regardless of if you set up manual or discovered MQTT sensors.
You need to know the state topic that SBFspot is using when it publishes those 3 inverter messages. The state topic is what you need HA to listen to when new messages arrive.
This is an example of a Manual MQTT sensor (there is no reason you canāt set up a bunch of manual sensors) You just need the state topic to be different for each inverter.
mqtt:
sensor:
- name: "SMA Total Energy"
state_topic: "homeassistant/sbfspot_Inverter_name/sbfspot_Serial_no"
value_template: "{{ value_json.ETotal }}"
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
The discovery messages basically do the same thing except the integration sets up the sensors.
Again the state topic needs to be unique for each inverter though.
When you look in MQTT explorer you need to find these messages and check the state topic.
MQTT: Publishing (homeassistant/sbfspot_{plantname}/sbfspot_{serial}) "PrgVersion": "3.9.7","Plantname": "lausepv","Timestamp": "2023-10-02T18:30:17+0200","SunRise": "2023-10-02T07:31:00+0200","SunSet": "2023-10-02T19:04:00+0200","InvSerial": 2xxxxxxx06,"InvName": "SN: 2xxxxxxx06","InvTime": "2023-10-02T18:30:03+0200","InvStatus": "Ok","InvSwVer": "02.30.06.R","InvClass": "Solar Inverters","InvType": "SB 2000HF-30","InvTemperature": 38.560,"InvGridRelay": "Closed","EToday": 8.776,"ETotal": 26183.294,"GridFreq": 49.970,"PACTot": 36.000,"PAC1": 35.000,"UAC1": 229.950,"IAC1": 0.156,"OperTm": 48065.468,"FeedTm": 44961.858,"PDCTot": 59.000,"UDC1": 239.650,"UDC2": 0.000,"IDC1": 0.246,"IDC2": 0.000,"PDC1": 59.000,"PDC2": 0.000,"BTSignal": 72.941,"InvWakeupTm": "2023-10-02T07:18:48+0200","InvSleepTm": "2023-10-02T18:30:09+0200"
Client null sending CONNECT
Client null received CONNACK (0)
Client null sending PUBLISH (d0, q0, r0, m1, 'homeassistant/sbfspot_lausepv/', ... (763 bytes))
Client null sending DISCONNECT
This manual message would work for the ABOVE sbfspot_2120131006
mqtt:
sensor:
- name: "SMA Total Energy"
state_topic: "homeassistant/sbfspot_lausepv/sbfspot_2120131006"
value_template: "{{ value_json.ETotal }}"
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
MQTT: Publishing (homeassistant/sbfspot_{plantname}/sbfspot_{serial}) "PrgVersion": "3.9.7","Plantname": "lausepv","Timestamp": "2023-10-02T18:30:17+0200","SunRise": "2023-10-02T07:31:00+0200","SunSet": "2023-10-02T19:04:00+0200","InvSerial": 2xxxxxxx48,"InvName": "SN: 2xxxxxxx48","InvTime": "2023-10-02T18:30:00+0200","InvStatus": "Ok","InvSwVer": "02.30.06.R","InvClass": "Solar Inverters","InvType": "SB 2000HF-30","InvTemperature": 38.510,"InvGridRelay": "Closed","EToday": 8.920,"ETotal": 26435.525,"GridFreq": 49.970,"PACTot": 39.000,"PAC1": 39.000,"UAC1": 229.670,"IAC1": 0.175,"OperTm": 48202.534,"FeedTm": 45157.621,"PDCTot": 60.000,"UDC1": 248.830,"UDC2": 0.000,"IDC1": 0.245,"IDC2": 0.000,"PDC1": 60.000,"PDC2": 0.000,"BTSignal": 0.000,"InvWakeupTm": "2023-10-02T07:17:46+0200","InvSleepTm": "2023-10-02T18:30:08+0200"
Client null sending CONNECT
Client null received CONNACK (0)
Client null sending PUBLISH (d0, q0, r0, m1, 'homeassistant/sbfspot_lausepv/sbfspot_2120123548', ... (762 bytes))
Client null sending DISCONNECT
You can do the same for sbfspot_2120123548
MQTT: Publishing (homeassistant/sbfspot_{plantname}/sbfspot_{serial}) "PrgVersion": "3.9.7","Plantname": "lausepv","Timestamp": "2023-10-02T18:30:17+0200","SunRise": "2023-10-02T07:31:00+0200","SunSet": "2023-10-02T19:04:00+0200","InvSerial": 2xxxxxxx66,"InvName": "SN: 2xxxxxxx66","InvTime": "2023-10-02T18:30:03+0200","InvStatus": "Ok","InvSwVer": "02.30.06.R","InvClass": "Solar Inverters","InvType": "SB 2000HF-30","InvTemperature": 39.600,"InvGridRelay": "Closed","EToday": 8.764,"ETotal": 26228.030,"GridFreq": 49.970,"PACTot": 37.000,"PAC1": 38.000,"UAC1": 229.670,"IAC1": 0.162,"OperTm": 48489.156,"FeedTm": 45637.636,"PDCTot": 60.000,"UDC1": 242.630,"UDC2": 0.000,"IDC1": 0.252,"IDC2": 0.000,"PDC1": 60.000,"PDC2": 0.000,"BTSignal": 0.000,"InvWakeupTm": "2023-10-02T07:17:55+0200","InvSleepTm": "2023-10-02T18:30:09+0200"
Client null sending CONNECT
Client null received CONNACK (0)
Client null sending PUBLISH (d0, q0, r0, m1, 'homeassistant/sbfspot_lausepv/sbfspot_2120106466', ... (762 bytes))
Client null sending DISCONNECT
You can do the same for sbfspot_2120106466
Actually now that I look closer at the published messages from SBFspot I donāt think changing the plantname will help. I think once you enable MIS again it would just use the a singular plantname when it publishes the 3 messagesā¦
If you want to do them as discovery type
You need to make a discovery message for each.
examples
These will setup 3 different devices. The Identifier and name are unique for each. I canāt bold them in code blocks, they should be reasonably obvious though. They should have actual data after SBFspot sends out the 3 messages.
sbfspot_2120131006
TOPIC
homeassistant/sensor/sbfspot_lausepv/sbfspot_2120131006ETotal/config
MSG
{"name": "SMA Energy Lifetime", "state_topic": "homeassistant/sbfspot_lausepv/sbfspot_2120131006", "value_template": "{{ value_json.ETotal | float(default) }}", "unique_id": "2120131006_ETotal", "device_class": "energy", "state_class": "total_increasing", "unit_of_measurement": "kWh", "enabled_by_default": "true", "icon": "mdi:solar-power-variant", "device": { "identifiers": ["HAOS-SBFspot-Sensors-06"], "name": "HAOS-SBFspot-06", "model": "SB 5000TL-20", "manufacturer": "SMA", "sw_version": "03.10.37.R" }}
sbfspot_2120123548
TOPIC
homeassistant/sensor/sbfspot_lausepv/sbfspot_2120123548ETotal/config
MSG
{"name": "SMA Energy Lifetime", "state_topic": "homeassistant/sbfspot_lausepv/sbfspot_2120123548", "value_template": "{{ value_json.ETotal | float(default) }}", "unique_id": "2120123548_ETotal", "device_class": "energy", "state_class": "total_increasing", "unit_of_measurement": "kWh", "enabled_by_default": "true", "icon": "mdi:solar-power-variant", "device": { "identifiers": ["HAOS-SBFspot-Sensors-48"], "name": "HAOS-SBFspot-48", "model": "SB 5000TL-20", "manufacturer": "SMA", "sw_version": "03.10.37.R" }}
sbfspot_2120106466
TOPIC
homeassistant/sensor/sbfspot_lausepv/sbfspot_2120106466ETotal/config
MSG
{"name": "SMA Energy Lifetime", "state_topic": "homeassistant/sbfspot_lausepv/sbfspot_2120106466", "value_template": "{{ value_json.ETotal | float(default) }}", "unique_id": "2120106466_ETotal", "device_class": "energy", "state_class": "total_increasing", "unit_of_measurement": "kWh", "enabled_by_default": "true", "icon": "mdi:solar-power-variant", "device": { "identifiers": ["HAOS-SBFspot-Sensors-66"], "name": "HAOS-SBFspot-66", "model": "SB 5000TL-20", "manufacturer": "SMA", "sw_version": "03.10.37.R" }}
When I post those in MQTT explorer I end up with 3 separate devices, and they populate from the SBFspot message you posted at the start when I post those with MQTT explorer.
See how you go with those. Donāt forget to retain the discovery messages