#MQTT sensor values "unknown"

1 messages · Page 1 of 1 (latest)

quartz otter
#

Hi all,
I'm using https://github.com/habuild/hassio-addons/tree/main/haos-sbfspot to retrieve data from my solar inverter. Connection and data transfer from the inverte to the addon works now.
Theaddon then attempts to send a mqtt message, which should update the "sensors" of an MQTT device that the addon generates (https://github.com/habuild/hassio-addons/tree/main/haos-sbfspot#mqtt).
I installed and configured the Mosquitto broker, set a user and password for the addon, and the addon sucessfully generated a device and sensors.
Every 5 minutes, I can see something like this in the addon logs

MQTT: Publishing (homeassistant/sbfspot_{plantname}/sbfspot_{serial}),"PrgVersion": "3.9.12","Plantname": "MySunny","Timestamp": "2025-09-28T13:50:02+0200",[a bunch of values],"InvSleepTm": "2025-09-28T13:52:47+0200"
Client null sending CONNECT
Client null received CONNACK (0)
Client null sending PUBLISH (d0, q0, r0, m1, 'homeassistant/sbfspot_MySunny/sbfspot_2130066335', ... (773 bytes))
Client null sending DISCONNECT

which to my mind, means that the addon is at least attempting to send off the mqtt message.

However, all my sensors receive an initial value "unknown" and don't get updated.

I'm sure the problem is me having gotten some essential part of the MQTT setup wrong.

Any guidance on how to debug and investigate would be much apprechiate.

Thanks all 🙂

GitHub

Home Assistant addon using SBFspot Bluetooth SMA inverters - habuild/hassio-addons

modest sleet
#

Does the addon ask for information about the MQTT server or is it doing that auto thing some addon's do?
It is possible you need to restart HA to see everything, couldn't hurt.

quartz otter
#

Just this:
MQTT_User: solar
MQTT_Pass: [the one is set up]
MQTT_Topic: homeassistant/sbfspot_{plantname}/sbfspot_{serial}
MQTT_Data: >-
PrgVersion,Plantname,Timestamp,SunRise,SunSet,InvSerial,InvName,InvTime,InvStatus,InvSwVer,InvClass,InvType,InvTemperature,InvGridRelay,EToday,ETotal,GridFreq,PACTot,PAC1,UAC1,IAC1,OperTm,FeedTm,PDCTot,UDC1,UDC2,IDC1,IDC2,PDC1,PDC2,BTSignal,InvWakeupTm,InvSleepTm
MQTT_Port: "1883" (that matches the config in Mosquitto)

According to the docs it can do all these:
MQTT publish binary path.
/usr/bin/mosquitto_pub is correct. Leave blank it will default!

MQTT Host
core-mosquitto is default for HA. MQTT host IP or Hostname.

MQTT Port
1883
1883 is default. Can be Blank.

MQTT User !secret mqtt_user is default!
solar

MQTT username.
Defaults to !secret mqtt_user if blank! Required for Sensor setup.

MQTT Pass !secret mqtt_pass is default!
•••••

MQTT password.
Defaults to !secret mqtt_pass if blank! Required for Sensor setup.

MQTT Topic Leave as default for sensors!
homeassistant/sbfspot_{plantname}/sbfspot_{serial}
homeassistant/sbfspot_{plantname}/sbfspot_{serial} is default. {plantname} and {serial} are captured variables.

MQTT json globbing style
'"{key}": {value}' is default. Leave blank for default!

MQTT json separator
comma is default.

MQTT_PublisherArgs - - Option removed to allow Sensor set up. Add MQTT_User and MQTT_Pass to respective options.

Tried a restart, no change.

quartz otter
#

Do I need to set up the topic in mqtt somewhere, or is that the device and it's sensors?

modest sleet
#

You would have to look at what the addon wants.

quartz otter
#

I figured it out:
By default, the state data went to homeassistant/sbfspot_{plantname}/sbfspot_{serial}.
But the discovery configs SBFspot generated were pointing to .../sbfspot_ (without serial).
That mismatch meant HA subscribed to the wrong topic.
I change the option to .../sbfspot_ (without serial) and now the sensors get updated.