SBFspot Bluetooth homeassistant addon

Hi tropfen,

seems I have the exact same problem as you had, but I do not understand your solution: “the last options (MQTT Topic Leave …)”

Could you explain to me in more detail how you fixed it?

thanks!

Hi @odelay

What is the problem you are having?

The automatic sensors discovery requires a specific MQTT topic. Trophen didn’t have this topic set.
Capture

Their message about leave was a cut off message from the above picture

The problem I have is that all sensors stays unknow. No real error in the logs, but still investigated what I might have configured wrong…

thanks.

Hello odelay,

i had to look into my notes. It was like HasQT is saying - i didn`t have set the correct topic.

Frank

The last version of the addon is rock stable here and works well. Thanks for your efforts!
Only problem is that the data on the energy dashboard become corrupt - usually too high - on those days when I restart HA. I tried to do it after sunset, but it did not help. Do you any have any recommendation as workaround?

@heraldry

Hmm can’t say I have noticed this occurring from normal use.
I can usually manage to get double entries and massive outputs when I run my test server and put them both to the same sensor.

This can be edited out via Developer tools > statistics.

It shouldn’t be occurring from normal use.
Check you don’t have duplicate sensors or similar.
You may have an old stuck retained message in your MQTT server.

You can filter this sort of behaviour… although that would require making a New fake sensor I think.
It shouldn’t really be necessary.
There should be some posts about filtering solar in the forums. I think Tom(the mod) had a thread on it.

Hi Again HasQT

after successfully build the spfspot on HA and a esp32 … I’m now trying to run sbfspot on a raspbery pi 2.
(not really the right topic but i tought having all in one could be a good idea)

I used this install command line :
curl -s https://raw.githubusercontent.com/sbfspot/sbfspot-config/master/sbfspot-config | sudo bash

BT works from start for my 2 inverters.
Tables seems to be created automaticly.
lebeck@SMApi:/mnt/usb/smadata $ sqlite3 SBFspot.db
SQLite version 3.34.1 2021-01-20 14:10:07
Enter “.help” for usage hints.
sqlite> .tables
Config MonthData vwBatteryData vwMonthData
Consumption SpotData vwConsumption vwPvoData
DayData SpotDataX vwDayData vwSpotData
EventData vwAvgConsumption vwEventData
Inverters vwAvgSpotData vwInverters

MQTT works when i type the following commands and listen to the topic on HA.
./SBFspot -v5 -mqtt

But then nothing …

  • nohting is added to HA MQTT
  • I dont see sbfspot running frequently on my pi
  • i don’t see dayly log files in my log folder.

Any idea what I could be missing ?

(my pi provides a correct date and time… and I’ve left default config interval…)

@lebeck

Sounds like it’s working.

You will be better off asking over on the official Sbfspot github.

I haven’t ran the install script for many years and never on a pi2(I’ve never owned a pi2)

It looks like you just need to set up some crontabs for when you want SBFspot to run… I’m not sure if the installation script is supposed to set that up.

You would also need to figure out the MQTT topics. If you match the topics to this addon, the mqtt sensors should still work in theory…

I 've discussed on Sbfspot github and progressed but still not fully working

MQTT_Topic=homeassistant/sbfspot_Incourt/sbfspot_{InvSerial}

And when I listen to all topic by using # in HA
it doesn’t update /sbfspot_{InvSerial}
(I have 2 inverters … )

solved… InvSerial is a information value that is not replaced in topic… while serial is (case sensitive)

And no autodiscovery seem to work …
Any idea ?
Still this one to solve…

Two parts are required on the device side:

  • The configuration topic which contains the necessary device type and unique identifier,
  • and the remaining device configuration without the device type.

Don’t really get what’s to update in Sbfspot

what’s the type of MQTT integrations for inverters data ?
where to set those 2 parts there are talking about ?

This might help abit.

So it sounds like SBFspot it is working.

SBFspot doesn’t setup MQTT beyond publishing.

MQTT in homeassistant requires either manually set up of mqtt sensors in your HA config. There are some examples of this on my github in the images folder.

OR

MQTT discovery messages in you MQTT broker that homeassistant can interpret and create MQTT sensors from.

This addon sets up the discovery messages which are similar to the messages in the link at the start of this message. You may be able to mess around with the options/mqtt topic to make the addon post the discovery messages to your broker with the correct inverter serial. You could then stop/uninstall the addon.

You can also just manually publish the discovery messages to your broker. They need to be retained messages. Like they are in the discussion page link. You will need to set the serial numbers in your discovery messages to match the serial numbers your inverters are publishing to your MQTT broker. You would do that from MQTT Explorer or similar app.

Thank you for supporting SBFspot through Home Assistant, this is great.

I got stuck with a multi inverter setup using bluetooth. Good news: setting up the net ID on my inverters and connecting via bluetooth is not a problem.
In Home Assistant I use the standard MQTT broker and the MultiINV-SBFspot add-on (only). Standard setup routine works (adding and creating sensors for one inverter after the other without MIS_Enabled, then setting to no sensor creation and switching MIS_Enabled to 1).
The MultiNV-SBFspot protocol states that for all three inverters values are being published.

Now the problem: The (one and only) MQTT device HAOS-SBFspot only receives the values of one inverter (serial) following its MQTT info. The sensors also only exist once (which might be correct, I don’t know) and show the values of only one of the inverters.

I guess the HA sensor setup is not correct. Should they exists once per inverter? Or shall they sum-up the values of all three? But then: why are the messages of two of them not even received? Please give a hint what I can do to process the values of all three inverters or of my plant as a total. I could not Google anything similar to my issue…

@rlause

This link leads to some multi inverter configuration. I don’t own multiple inverters so it’s very difficult for me to sort out.

My tips:

  1. Just use the HAOS-Sbfspot version (not Multi, it hasn’t been updated for a while, nor will it be)
  2. Setup the sensors for each inverter serial number with MIS off. Using the sensor creation option of the add-on. Then move to NO sensor option and enable MIS. Sounds like you done this.
  3. Setup the multiple pvoutput SIDs using comma separated entries if you are using pvoutput.
  4. At this point I believe you would pvoutput upload and 3 inverter mqtt sensors.

With MIS enabled I believe you should receive 3 independent info for the inverters like Sven posted in that link. Which should update your discovered MQTT sensors as 3 separate inverters.

Unfortunately I stay with one MQTT device and one set of sensors for only the first inverter I create sensors for.

What I did:

I purged all three bluetooth inverters, then uninstalled MultiINV-SBFspot.

I then installed the latest HAOS-SBFspot addon. I created the sensors for all bluetooth inverters one after the other with restarts of the addon. After that I switched MIS on.

Same behaviour as mentioned before: All three inverters are being read and data of all three is being published by the addon via MQTT. This is what its log says.

However, as there is only one set of sensors, I can only access the data of the first created inverter in Home Assistant (MQTT).

Is there a way to create the missing sensors manually? (Would I need additional MQTT devices therefor?) What would I have to do?

Can you post the log, on that MIS thread is probably neater.

So the addon is posting 3 separate mqtt messages, one for each inverter serial. I think that’s what you are saying. That sounds correct.

Are you getting 3 separate sensors created in the MQTT integration? This is the MQTT page under settings > devices & services > MQTT.
It sounds like you are creating the sensors with the addon, but they are not showing up in the integration page. This may be related to the MQTT changes in a HA release a few months ago, possibly.

You can make your own discovery messages manually. Just copy one of the addon made messages, edit the the serial to match and post it with MQTT Explorer.

Here is what the addon logs when publishing the inverters’ data:

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/sbfspot_2120131006', ... (763 bytes))
Client null sending DISCONNECT
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
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

Only one MQTT device was created for topic homeassistant/sbfspot_lausepv/sbfspot_2xxxxxxx06, although I processed the creation three times for the different bluetooth addresses/inverters/serial numbers. The creation process signaled an ok in the logs for each call and I waited several minutes each time until the logging “became quiet”.

Is the discovery message I shall process manually with MQTT like the following?

{
  "InvSerial": 2xxxxxxx06,
  "InvName": "SN: 2xxxxxxx06",
  "InvClass": "Solar Inverters",
  "InvType": "SB 2000HF-30",
  "InvSwVer": "02.30.06.R"
}

No, this is the data sent by the Addon to make the discovery messages.

You need something like the below to make a discovery sensor for Energy Total
You would need to do all the sensors you want individually. They correspond to the MQTT sensor items in the addon options. They need to be retained to be permanent.

Example

TOPIC
homeassistant/sensor/sbfspot_lausepv/sbfspot_2xxxxxxx48ETotal/config

MSG (there are two spots for serial here)
{"name": "SMA Energy Lifetime", "state_topic": "homeassistant/sbfspot_lausepv/sbfspot_2xxxxxxx48", "value_template": "{{ value_json.ETotal | float(default) }}", "unique_id": "2xxxxxxx48_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"], "name": "HAOS-SBFspot", "model": "SB 5000TL-20", "manufacturer": "SMA", "sw_version": "03.10.37.R" }}

Any error messages for discovery creation will show up in the Home assistant core logs, not the addon logs. Settings > System > Logs > Home Assistant core

edit:
Ok I did have a play around with the discovery messages. Part of the problem is the resent change HA made to discovery. They changed the scheme a bit. So Instead of getting multiple devices, You will be getting numbered entries. eg. sensorBob, sensorBob-1, sensorBob-2. This may be causing a problem. Not something I can really test.

If you append this between inverter setups they will show up as separate devices. You will need to do that manually for each discovery message. I would suggest making the messages in notepad or similar.

"device": { "identifiers": ["HAOS-SBFspot-Sensors"]

eg.

"device": { "identifiers": ["HAOS-SBFspot-Sensors-1"]

"device": { "identifiers": ["HAOS-SBFspot-Sensors-2"]

That doesn’t really explain why the sensors have been showing up unknown though in my mind. They should still be working even though it is listing under a single device.

edit2:
I played around with the MQTT messages a bit more.
When you setup the sensors with the Addon. If you change the plantname slightly when doing a second or third inverter with unique serial, you should have discovered 3 separate devices as expected. So you shouldn’t need to manually create the sensors as such. just tweak the plantname, when setting up the individual sensor creations.

Encouraged by your suggestions I tried a bit myself.

Firstly, in Create mode the MQTT topic does not regard the configuration setting MQTT Topic. There seems to be a hardcoded advance with homeassistant/sbfspot_{plantname}/sbfspot_. As regardless how I change the setting MQTT Topic, the MQTT Explorer addon always shows a topic computed via this hardcoded template.

So I manipulated the plantname for the Create step in a way that I wrote the serial literals in the Plantname configuration setting like pv2xxxxxxx48. I stopped immediately after the MQTT messages had been sent, altered the plantname (with the serial) and bluetooth address and repeated these steps. In MQTT Explorer the result looks quite nice:

core-mosquitto.local.hass.io
  homeassistant
    sensor
      sbfspot_pv2xxxxxxx48 (33 topics, 33 messages)
      sbfspot_pv2xxxxxxx66 (33 topics, 33 messages)
      sbfspot_pv2xxxxxxx06 (33 topics, 33 messages)

I then switched MIS_Enabled from 0 to 1 and mode to No sensor creation. The plantname was reduced to pv and the MQTT topic was set to homeassistant/sbfspot_{plantname}{serial}/sbfspot_. After a restart it looks again nice in MQTT Explorer:

core-mosquitto.local.hass.io
  homeassistant
    sbfspot_pv2xxxxxxx06
      sbfspot_ = {...}
    sbfspot_pv2xxxxxxx48
      sbfspot_ = {...}
    sbfspot_pv2xxxxxxx66
      sbfspot_ = {...}

Note that the path was reduced so that sensor is missing now. This should be correct. From the MQTT perspective I would guess I tweaked it the right way.

Unfortunately, there still exists only one MQTT device in Home Assistant named HAOS-SBFspot with one set of sensors.

  • The MQTT Info shows that the MQTT discovery data is from the first creation step, as the serial number of the plantname shows this. Example of one topic: homeassistant/sensor/sbfspot_pv2xxxxxxx48/sbfspot_InvTemperature/config
  • The MQTT Info also shows the subscribed topics and the received messages. They all come from only one serial number (which is good in some way). Example of one subscribed topic: homeassistant/sbfspot_pv2xxxxxxx48/sbfspot_
  • The Home Assistant sensors show correct data concerning this one inverter.
  • The Home Assistant sensors are not named following the MQTT concept, they read sensor.haos_sbfspot_sma_inverter_running_temp for example - without any plantname or inverter serial number.

Thus I must assume that the Home Assistant sensor creation is done using the config name of the MQTT message like SMA Inverter Running Temp. All letters are converted to lowercase and spaces are converted to underscores, that’s it. No serial number or plantname, of course.

But how comes that the sensor name is always prefixed by haos_sbfspot_? Why is the path of the MQTT topic not considered? Is this the result of the device section of the MQTT message where the "device":"name" always says: "HAOS-SBFspot"?

At the moment I feel I’m stuck here… I guess the device section of the MQTT messages has to consider the serial number of the inverter (and the plantname). If this is the case we would need to fix the code(?).

Edit:
Considering to change the (sensor) name or the device name in the MQTT messages is dangerous for backward compatibility. A possible approach could be to change these items (or at least one of them) only depending on the MIS flag, as I guess multiple inverters could never be processed correctly until now.

You still need a unique name(id actually) for the sensors. Which is part of the reason the mqtt topic is hard coded. You can use your own topic but discovery doesn’t like it. MQTT Discovery has very specific requirements.

sbfspot_Invpv2xxxxxx48Temperature
sbfspot_Inv{serial}Temperature

so eg

sbfspot_Invpv2xxxxxx06Temperature

You basically need to make a unique config message for each inverter and each sensor.

homeassistant/sensor/sbfspot_((lausepv+unique for device))/sbfspot_((2xxxxxxx48Unique for sensor))ETotal/config

Try manually posting somethig like this to your broker and see how HA reacts.

MSG1
homeassistant/sensor/sbfspot_lausepvplant1/sbfspot_2xxxxxxx66ETotal/config

TOPIC1
{"name": "SMA Energy Lifetime", "state_topic": "homeassistant/sbfspot_lausepvplant1/sbfspot_2xxxxxxx66", "value_template": "{{ value_json.ETotal | float(default) }}", "unique_id": "2xxxxxxx66_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"], "name": "HAOS-SBFspot", "model": "SB 5000TL-20", "manufacturer": "SMA", "sw_version": "03.10.37.R" }}

MSG2
homeassistant/sensor/sbfspot_lausepvplant22/sbfspot_2xxxxxxx48ETotal/config

TOPIC2
{"name": "SMA Energy Lifetime", "state_topic": "homeassistant/sbfspot_lausepvplant2/sbfspot_2xxxxxxx48", "value_template": "{{ value_json.ETotal | float(default) }}", "unique_id": "2xxxxxxx48_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"], "name": "HAOS-SBFspot", "model": "SB 5000TL-20", "manufacturer": "SMA", "sw_version": "03.10.37.R" }}
MSG3
homeassistant/sensor/sbfspot_lausepvplant3/sbfspot_2xxxxxxx06ETotal/config

TOPIC3
{"name": "SMA Energy Lifetime", "state_topic": "homeassistant/sbfspot_lausepvplant3/sbfspot_2xxxxxxx06", "value_template": "{{ value_json.ETotal | float(default) }}", "unique_id": "2xxxxxxx06_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"], "name": "HAOS-SBFspot", "model": "SB 5000TL-20", "manufacturer": "SMA", "sw_version": "03.10.37.R" }}

You still need to be able to hit a separate State topic for each Inverter

"state_topic": "homeassistant/sbfspot_lausepvplant2/sbfspot_2xxxxxxx48"

You need a standard (not discovery) message for each invterter to test also

msg1 ETOTAL 2843 Inverter 06
{"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: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": 2843,"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"}

msg2 ETOTAL 26435 inverter 48 
{"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,"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"}

msg3 ETOTAL 10 inverter 66
{"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: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": 10,"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"}

Hmm this didn’t work without adjusting
“identifiers”: [“HAOS-SBFspot-Sensors”]

Perhaps gives some insight as to why I can’t really test without having 3 inverters myself.

I haven’t tried anything new yet, but read the MQTT documentation you pointed me to.

My Home Assistant is up-to-date, no updates available:

Home Assistant 2023.9.3
Supervisor 2023.09.2
Operating System 10.5
Frontend 20230911.0 - latest

The MQTT object generation does not follow the documentation. Look at the MQTT topic, e. g. homeassistant/sensor/sbfspot_pv2120123548/sbfspot_InvTemperature.

Following the documentation I would get an entity ID for the sensor like ...sbfspot_InvTemperature or ...sbfspot_InvTemperature_2.

In fact the entity ID I got is haos_sbfspot_sma_inverter_running_temp. This was derived from the config message’s content (fields name and device:name), I assume. So my conclusion is: As the messages’ content for name and device stay the same for each inverter (and each different sensor), there is no way new entities get generated for a second (third, …) inverter (or plant resp.).

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