SBFspot Bluetooth homeassistant addon

Thank you for your comprehensive reply!

I think it only supports those with a web ui: SMA Solar - Home Assistant rather than the direct ‘speedwire’ ethernet connection

Thanks for this suggestion, I will do this

Edit, I did it:

alias: Refresh sensors if Home Assistant restarts after dark
description: ""
trigger:
  - platform: homeassistant
    event: start
condition:
  - condition: sun
    before: sunrise
    after: sunset
action:
  - delay:
      hours: 0
      minutes: 2
      seconds: 0
      milliseconds: 0
  - service: hassio.addon_restart
    data:
      addon: a51a23d8_haos-sbfspot # I guess this string may be different for each user
mode: single

1 Like

Hi,

I did a test runa few weeks/months ago. It did work fine without any issues.
Since then I removed the addon from HA. I think back them HAOS was on version 9.XX (not sure which one)
Today, after getting a proper Bluetooth USB I have installed the addon again. Configured it and I get the below error in the logs:

Fri May  5 11:15:00 2023: INFO: Starting...
sunrise: 06:52
sunset : 17:33
Connecting to xx:xx:xx:xx:xx (1/10)
Initialising...
SUSyID: 125 - SessionID: 857033118
SMA netID=02
Serial Nr: XXXXX  (XXXXXX)
BT Signal=69.0%
Fri May  5 11:15:02 2023: CRITICAL: Logon failed. Check 'USER' Password
Fri May  5 11:15:02 2023: INFO: Done.

xxx above are my edits.

I know the password is correct as I copy from the secrets files and paste it into Sunny Explorer and I can login with the User account.

HAOS is at version 10.0 - maybe this has something to do with the error.
User password is 8 characters (alphanumeric + numbers)

Will appreciate some help with this so I can get it working.

Edit: forgot to say that HA server was rebooted after adding all the details in the secrets.yaml file

Hi @MnM,

With HAOS 9.5 and HA2023.2.0 and the wrong password I get.
The results with HAOS 10.1 and HA 2023.5.1 are the same.

Fri May  5 14:41:11 2023: CRITICAL: Logon failed. Check 'USER' Password
Fri May  5 14:41:11 2023: INFO: Done.

This corrects itself when the correct password is Saved in the config options.

Check that you don’t have a typo in secrets either in the key SBFpassword or the actual password.
Try manually typing the correct password into the addon options and Saving the change, to eliminate an error in the secrets file.

The correct entry into the options when using secrets is

!secret SBFpassword

Perhaps you don’t have the Quote marks " " in your secret file

SBFpassword: "Y0urP4ss"

There hasn’t been any changes otherwise that I am aware of that would be creating password issues.

Thanks for getting back to me so quick.
I have the secret done correctly (I actually have all the secrets in the config done :slight_smile: ). Cut and past form the config page:

!secret SBFpassword

Cut and paste from the secrets.yaml file:

SBFpassword: "XXXXXXXX"

I am pretty sure there is no typo in the password in the secrets.yaml file because I copy the password from there, I startup Sunny Explorer and then I paste the password (using User as the username). It logs in right away.

I also run PVbeanCounter on a Windows box - I pasted the same password in that app and it connects without any issues.

Also to further eliminate hardware issues I use the exact same Bluetooth cable between the windows box and HA box.

My HA is 2023.5.0 - maybe that is causing issues?

Have you tried typing the password directly into the addon options to skip using secrets as a test?

I doubt there are any changes between 2023.2.0 and 2023.5.0 that would create a password issue, which is then corrected in and 2023.5.1.

The only other thig that comes to mind, might be the Host BT address. It has been a while since I played around with that.

Will try the password now.

I will also double check both MAC addresses to be sure they are 100% corrent.
I have logged in the docker and looked at the conf file - it had the correct password in there.

Typing in the password manually had the same error.

Double checked the MAC addresses for BT adaptor and inverter - both were correct. I had lower case letters in the MAC addresses. Changed them to upper case and rebooted HA. Still get the error.

I see this in the console on HA:

I have no idea what else I could try (already tried removing the addon, reboot and and add again).

Can I make a manual connection for the docker’s cli so I can pass on the username and password manually?
I am thinking to try the admin login and password and see if it can login.

You can manually update the conf file if you want, nano should be available for editing. The addon only creates the conf files, it’s just sbfspot doing the rest.

Perhaps try 0000.

I got an update. Kind of crazy but yeah it is working now.

Lots of troubleshooting, double/triple checking everything, going back to SMA Explorer 1.2.7.0 from 2012 (so I can put back the user’s password to 0000 as with the latest software you cannot do that anymore because of the password complexity requirements they have built in the lates versions of SMA Explorer).

Anyway after about 2-3 hours of full-on testing, changing settings, etc etc eventually I downloaded the SBFspot - Windows version. I did an SBFspot.exe - scan in CMD to check (again) the Bluetooth MAC address of my inverter and to my surprise it came back with 2 MAC addresses!

It turns out that when I did my original scan it actually picked up my neighbor’s Bluetooth MAC address! (we both installed the same invertor with almost an identical configuration a few weeks apart in 2010).
Once I identified my Bluetooth MAC address (had to find my contracts from 2010 to double check my invertor’s serial number) everything started working as it should :slight_smile:
So SMA Explorer in Windows was always connecting to my invertor while HomeAssistant was always connecting to my neighbor’s. Since I changed my password and my neighbor had the default password I was getting the password error.

@HasQT - thanks and sorry for wasting your time yesterday :slight_smile:

1 Like

OK so I am back with Part2 - mqtt

Having issues with mqtt - I have other mqtt devices all working fine with core-mosquitto

For this integration I switched on the Create option for for sensors. The mqtt username and password is in the secrets file.
It starts and creates the sensors but they are all empty.

Sometimes after I restart the SBFspot I this error in the logs:

Error: Both topic and message must be supplied.

Sometimes I get this other error:

sh: HxoCzfjh4T7d: not found

No idea why sometimes it shows one error and other times the other error.
Rest of the log file is similar for both errors:

Reading events: 2023-May-01
Error: Both topic and message must be supplied.
mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit.
mosquitto_pub version 2.0.14 running on libmosquitto 2.0.14.
Usage: mosquitto_pub {[-h host] [--unix path] [-p port] [-u username] [-P password] -t topic | -L URL}
                     {-f file | -l | -n | -m message}
                     [-c] [-k keepalive] [-q qos] [-r] [--repeat N] [--repeat-delay time] [-x session-expiry]
                     [-A bind_address] [--nodelay] [-S]
                     [-i id] [-I id_prefix]
                     [-d] [--quiet]
                     [-M max_inflight]
                     [-u username [-P password]]
                     [--will-topic [--will-payload payload] [--will-qos qos] [--will-retain]]
                     [{--cafile file | --capath dir} [--cert file] [--key file]
                       [--ciphers ciphers] [--insecure]
                       [--tls-alpn protocol]
                       [--tls-engine engine] [--keyform keyform] [--tls-engine-kpass-sha1]]
                       [--tls-use-os-certs]
                     [--psk hex-key --psk-identity identity [--ciphers ciphers]]
                     [--proxy socks-url]
                     [--property command identifier value]
                     [-D command identifier value]
       mosquitto_pub --help
 -A : bind the outgoing socket to this host/ip address. Use to control which interface
      the client communicates over.
 -d : enable debug messages.
 -c : disable clean session/enable persistent client mode
      When this argument is used, the broker will be instructed not to clean existing sessions
      for the same client id when the client connects, and sessions will never expire when the
      client disconnects. MQTT v5 clients can change their session expiry interval with the -x
      argument.
 -D : Define MQTT v5 properties. See the documentation for more details.
 -f : send the contents of a file as the message.
 -h : mqtt host to connect to. Defaults to localhost.
 -i : id to use for this client. Defaults to mosquitto_pub_ appended with the process id.
 -I : define the client id as id_prefix appended with the process id. Useful for when the
      broker is using the clientid_prefixes option.
 -k : keep alive in seconds for this client. Defaults to 60.
 -L : specify user, password, hostname, port and topic as a URL in the form:
      mqtt(s)://[username[:password]@]host[:port]/topic
 -l : read messages from stdin, sending a separate message for each line.
 -m : message payload to send.
 -M : the maximum inflight messages for QoS 1/2..
 -n : send a null (zero length) message.
 -p : network port to connect to. Defaults to 1883 for plain MQTT and 8883 for MQTT over TLS.
 -P : provide a password
 -q : quality of service level to use for all messages. Defaults to 0.
 -r : message should be retained.
 -s : read message from stdin, sending the entire input as a message.
 -S : use SRV lookups to determine which host to connect to.
 -t : mqtt topic to publish to.
 -u : provide a username
 -V : specify the version of the MQTT protocol to use when connecting.
      Can be mqttv5, mqttv311 or mqttv31. Defaults to mqttv311.
 -x : Set the session-expiry-interval property on the CONNECT packet. Applies to MQTT v5
      clients only. Set to 0-4294967294 to specify the session will expire in that many
      seconds after the client disconnects, or use -1, 4294967295, or ∞ for a session
      that does not expire. Defaults to -1 if -c is also given, or 0 if -c not given.
 --help : display this message.
 --nodelay : disable Nagle's algorithm, to reduce socket sending latency at the possible
             expense of more packets being sent.
 --quiet : don't print error messages.
 --repeat : if publish mode is -f, -m, or -s, then repeat the publish N times.
 --repeat-delay : if using --repeat, wait time seconds between publishes. Defaults to 0.
 --unix : connect to a broker through a unix domain socket instead of a TCP socket,
          e.g. /tmp/mosquitto.sock
 --will-payload : payload for the client Will, which is sent by the broker in case of
                  unexpected disconnection. If not given and will-topic is set, a zero
                  length message will be sent.
 --will-qos : QoS level for the client Will.
 --will-retain : if given, make the client Will retained.
 --will-topic : the topic on which to publish the client Will.
 --cafile : path to a file containing trusted CA certificates to enable encrypted
            communication.
 --capath : path to a directory containing trusted CA certificates to enable encrypted
            communication.
 --cert : client certificate for authentication, if required by server.
 --key : client private key for authentication, if required by server.
 --keyform : keyfile type, can be either "pem" or "engine".
 --ciphers : openssl compatible list of TLS ciphers to support.
 --tls-version : TLS protocol version, can be one of tlsv1.3 tlsv1.2 or tlsv1.1.
                 Defaults to tlsv1.2 if available.
 --insecure : do not check that the server certificate hostname matches the remote
              hostname. Using this option means that you cannot be sure that the
              remote host is the server you wish to connect to and so is insecure.
              Do not use this option in a production environment.
 --tls-engine : If set, enables the use of a TLS engine device.
 --tls-engine-kpass-sha1 : SHA1 of the key password to be used with the selected SSL engine.
 --tls-use-os-certs : Load and trust OS provided CA certificates.
 --psk : pre-shared-key in hexadecimal (no leading 0x) to enable TLS-PSK mode.
 --psk-identity : client identity string for TLS-PSK mode.
 --proxy : SOCKS5 proxy URL of the form:
           socks5h://[username[:password]@]hostname[:port]
           Only "none" and "username" authentication is supported.
See https://mosquitto.org/ for more information.
Sat May  6 17:37:26 2023: INFO: Done.

Running core-mosquitto 6.2.1
Its logs show:

2023-05-06 17:36:51: New connection from 172.30.32.1:60162 on port 1883.
2023-05-06 17:36:51: New client connected from 172.30.32.1:60162 as auto-6C70EFBE-D19C-79A7-5903-6EFEC0496E53 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:51: Client auto-6C70EFBE-D19C-79A7-5903-6EFEC0496E53 disconnected.
2023-05-06 17:36:51: New connection from 172.30.32.1:60172 on port 1883.
2023-05-06 17:36:51: New client connected from 172.30.32.1:60172 as auto-64724A0A-F06D-4E16-0638-E6BB4669C05D (p2, c1, k60, u'mqtt').
2023-05-06 17:36:51: Client auto-64724A0A-F06D-4E16-0638-E6BB4669C05D disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60178 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60178 as auto-19CE1051-148E-2593-6F5F-CBCB8F8DF3C3 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-19CE1051-148E-2593-6F5F-CBCB8F8DF3C3 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60192 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60192 as auto-4C5B9571-9926-AB57-7B40-75245C045489 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-4C5B9571-9926-AB57-7B40-75245C045489 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60196 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60196 as auto-83D9DE93-7A3C-1466-8757-1A470B671B64 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-83D9DE93-7A3C-1466-8757-1A470B671B64 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60206 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60206 as auto-E5536DAD-9BD0-5F17-EE65-ADFDB298E7CC (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-E5536DAD-9BD0-5F17-EE65-ADFDB298E7CC disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60222 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60222 as auto-E6E49E3C-A8E7-CB1A-D069-2C33AE990CAE (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-E6E49E3C-A8E7-CB1A-D069-2C33AE990CAE disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60232 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60232 as auto-07033EEA-5A32-6A83-2CB7-77D33B2A0734 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-07033EEA-5A32-6A83-2CB7-77D33B2A0734 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60240 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60240 as auto-034FB473-505F-336D-9AD7-37D3F17D87A9 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-034FB473-505F-336D-9AD7-37D3F17D87A9 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60244 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60244 as auto-239FA189-540A-1C45-C0B2-848F5B773DB4 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-239FA189-540A-1C45-C0B2-848F5B773DB4 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60250 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60250 as auto-24B5ACDC-837D-23DA-8318-E6B80C9D41D1 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-24B5ACDC-837D-23DA-8318-E6B80C9D41D1 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60266 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60266 as auto-D0319DA8-5134-F992-1617-A0AF761AB1F3 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-D0319DA8-5134-F992-1617-A0AF761AB1F3 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60282 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60282 as auto-86163684-1D40-04EA-6C8C-15082A594A08 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-86163684-1D40-04EA-6C8C-15082A594A08 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60296 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60296 as auto-4FD0B4D3-1E57-45AD-E9B4-4808B3724537 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-4FD0B4D3-1E57-45AD-E9B4-4808B3724537 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60306 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60306 as auto-17038259-8FFE-1A01-C7CD-106F47E02679 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-17038259-8FFE-1A01-C7CD-106F47E02679 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60318 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60318 as auto-6B9DF4BA-1BFC-233E-19F1-7AE0769B9814 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-6B9DF4BA-1BFC-233E-19F1-7AE0769B9814 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60334 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60334 as auto-F28C24E3-8247-6520-B979-B0467C45757D (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-F28C24E3-8247-6520-B979-B0467C45757D disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60336 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60336 as auto-83004B37-A2A9-A8AE-DD1B-620F1FF23C1E (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-83004B37-A2A9-A8AE-DD1B-620F1FF23C1E disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60342 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60342 as auto-F9526406-D96F-A6A1-F3D2-0BED33F8960B (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-F9526406-D96F-A6A1-F3D2-0BED33F8960B disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60348 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60348 as auto-EDAE9560-0F45-C49A-6A83-E2C14B5C914F (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-EDAE9560-0F45-C49A-6A83-E2C14B5C914F disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60364 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60364 as auto-9E3D4E56-C330-14D5-88AC-8001C94B6569 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-9E3D4E56-C330-14D5-88AC-8001C94B6569 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60374 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60374 as auto-320BCAA6-E8B1-EF04-E77D-578E7E6A3A59 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-320BCAA6-E8B1-EF04-E77D-578E7E6A3A59 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60384 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60384 as auto-A1CD7A25-D31D-4377-1346-CAA7A327D488 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-A1CD7A25-D31D-4377-1346-CAA7A327D488 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60388 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60388 as auto-3E8F2957-D0AB-C1C9-A11B-AFD94225108D (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-3E8F2957-D0AB-C1C9-A11B-AFD94225108D disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60396 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60396 as auto-8100837A-7626-E688-A0A5-2D23F3D071F1 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-8100837A-7626-E688-A0A5-2D23F3D071F1 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60404 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60404 as auto-E75D40C8-2F03-99E1-D252-ED2FE23E19D5 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-E75D40C8-2F03-99E1-D252-ED2FE23E19D5 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60416 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60416 as auto-8C713526-F13C-7BB6-5CE1-A99E49ECFB46 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-8C713526-F13C-7BB6-5CE1-A99E49ECFB46 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60432 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60432 as auto-2DA6D77F-4130-A543-BA92-24A10FB578F6 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-2DA6D77F-4130-A543-BA92-24A10FB578F6 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60448 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60448 as auto-D4A30F52-048D-C0AC-9F80-E66A50236516 (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-D4A30F52-048D-C0AC-9F80-E66A50236516 disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60458 on port 1883.
2023-05-06 17:36:52: New client connected from 172.30.32.1:60458 as auto-9411B98E-AA4D-480C-FF55-F08AA211715D (p2, c1, k60, u'mqtt').
2023-05-06 17:36:52: Client auto-9411B98E-AA4D-480C-FF55-F08AA211715D disconnected.
2023-05-06 17:36:52: New connection from 172.30.32.1:60472 on port 1883.

MQTT Explorer shows (under homeassistant>>sensor)

There is no other entry in MQTT Explorer for sbfspot in any of the other sections.

Removed the HAOS-SBFspot:

Reboot and added it back = same error.

Restart core-mosquitto doesnt fix anything.

Running out of ideas to try.

Hi @MnM,

I think the problem you’re having is your topic is incorrect in the options.

To use the mqtt auto sensors requires a very specific topic setup, so that auto discovery works.

If you look under the mqtt haos-sbfspot sensors in devices in HA, and click on the mqtt info. It will list the topics that are expected.

You are getting messages from haos-sbfspot in mqtt Explorer correctly by the looks of it. However it is under the topic sbfspot_home.
The topic needs to be

homeassistant/sensor/sbfspot_your_plantname/sbfspot_your_serial_number_*sensor_item

Double check your settings and reset them if required. The default topic should be the correct one.

Edit… You can use whatever topics you want… But not with auto discovery sensors, only for manual sensor setups

Hi,

The topic is the default topic, never made any changes to it:

Do I need to make any changes (like enter the plant name and/or the serial number manually as opposed to the variables)?
After a reboot of the HA server I cant see anything related to SBFspot in MQTT Explorer. All entries are gone.

Edit: Actually the entries in MQTT Explorer came back a few minutes after the reboot.
The values are still empty

core-mosquitto - is in red. It is just the color used or a warning?

Red core-mosquitto is just the color used, not a warning.

You shouldn’t need to change that topic. It should pick up the plantname from options and the serial number from the inverter to fill in those variables.

There is always a slight delay at the start switching from unknown to values, as it only changes when it polls the inverter. That only occurs about 1 min after the addon starts and every 5 mins during daylight hours.

/sbfspot_Home/sbfspot_2010293282InvName

It looks like from your other image Home is your plantname.
If isn’t picking up the serial number, try a purge of the sensors and recreate them. It may have missed the serial number the first time you tried it.

OK - thank you.
Will try that tomorrow during the day - already 9:50PM over here.

I have tried it. The result is exactly the same. Here is what I did.

  1. Under configuration I have selected Purge for the sensors
  2. Restarted the HAOS-SBFspot add on
  3. Waited like 10m but no sensors were deleted

  1. Browsed to Settings >> Integrations >> core-mosquitto >> HAOS-SBFspot entity
  2. Deleted the entity manually - this removed all from HA and MQTT Explorer would not see the sensors anymore
  3. Went back to HAOS-SBFspot add on
  4. Selected Create in the config and restart
  5. Entity and sensors were created back - again with no values assigned to the entity and unknown values for the sensors
  6. I could see the sensors in MQTT Explorer - 1 topic and 1 message and they dont increase (unless I restart HAOS-SBFspot add on - for every restart 1 more message is added to the total)

So I ssh-ed into HA and watch the log via docker logs command. This is the relevant part:

Current Inverter Time: 2023-05-07T11:57:49+0800
Inverter Wake-Up Time: 2023-05-07T06:52:53+0800
Inverter Sleep Time  : 2023-05-07T11:57:54+0800
MQTT: Publishing (homeassistant/sbfspot_{plantname}/sbfspot_{serial}) "PrgVersion": "3.9.7","Plantname": "Home","Timestamp": "2023-05-07T12:09:45+0800","SunRise": "2023-05-07T06:54:00+0800","SunSet": "2023-05-07T17:32:00+0800","InvSerial": 2100346950,"InvName": "SN: 2100346950","InvTime": "2023-05-07T11:57:49+0800","InvStatus": "Ok","InvSwVer": "03.01.05.R","InvClass": "Solar Inverters","InvType": "SB 5000TL-20","InvTemperature": 52.140,"InvGridRelay": "Closed","EToday": 3.263,"ETotal": 105956.729,"GridFreq": 49.970,"PACTot": 727.000,"PAC1": 727.000,"UAC1": 244.340,"IAC1": 2.977,"OperTm": 54740.833,"FeedTm": 53799.104,"PDCTot": 714.000,"UDC1": 213.660,"UDC2": 275.160,"IDC1": 2.082,"IDC2": 0.983,"PDC1": 444.000,"PDC2": 270.000,"BTSignal": 76.078,"InvWakeupTm": "2023-05-07T06:52:53+0800","InvSleepTm": "2023-05-07T11:57:54+0800"
sh: HxoCzfjh4T7d: not found
MQTT: Failed te execute '/usr/bin/mosquitto_pub' mosquitto client installed?
Error 32512 while publishing to MQTT Broker
Reading events: 2023-May-01
Error: Both topic and message must be supplied.
mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit.
mosquitto_pub version 2.0.14 running on libmosquitto 2.0.14.
Usage: mosquitto_pub {[-h host] [--unix path] [-p port] [-u username] [-P password] -t topic | -L URL}

Trying to run mosquitto_pub from within the docker itself gets this error:

bash-5.1# cd /usr/bin
bash-5.1# ./mosquitto_pub
Error: Both topic and message must be supplied.
mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit.
mosquitto_pub version 2.0.14 running on libmosquitto 2.0.14.

my core-mosquitto is v 6.2.1 . What version are you running?

bash-5.1# cd /usr/bin
bash-5.1# ./mosquitto_pub
Error: Both topic and message must be supplied.
mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit.
mosquitto_pub version 2.0.14 running on libmosquitto 2.0.14.

The above is a normal error message when you try to publish without an extended command

This should publish from within the docker container if you put your username and password for mqtt in the appropriate spots. You shouldn’t need to change directories (/usr/bin/sbfspot has direct access to mosquitto_pub)

mosquitto_pub -h core-mosquitto -u YourUser -P YourPass -t homeassistant/sensor/sbfspot_test -m test -d
sh: HxoCzfjh4T7d: not found

I have no idea where this is coming from or what it refers to.

Error 32512 while publishing to MQTT Broker

This sounds like a command not found error when I goggle it. Which I guess makes sense if the mqtt message isn’t being created.

This sounds like it may be occurring because it can’t find your serial number. So everything after that part of the mqtt variable message it disappearing.

/usr/bin/mosquitto_pub -h "$MQTT_Host" -u "$MQTT_User" -P "$MQTT_Pass" -t homeassistant/sensor/sbfspot_"$PLANTNAME"/sbfspot_"$InvSerial""$value"

So it’s cutting off after the topic and skipping the message and creating the error.

That image you posted should show your serial number under the (using existing device info) also.

In the docker logs you posted there is a serial number. is it the correct one? eg. not your neighbor’s…

There is a file you can try deleting if it exists in the docker.

/data/device  

you can nano into it or just rm it and recreate the sensors. That file should get created when you create the sensors. 

I can’t replicate your error when I tried however…

Ok its night again…Ill try suggestions tomorrow.

Looking at the serial number issue -sbfspot_{serial} - I had a look through the values returned when the Bluetooth connection is made. There is no value that is = serial at all. I see the following values being returned by the invertor:

Serial Nr: 7D30C046 (2100346950)
Device Name: SN: 2100346950
SUSyID: 78 - SN: 2100346950

and yes the 21000xxxx is the correct serial number of the invertor. 100% sure about this. Wondering if the values returned (spaces, SN:, Serial Nr. etc) can cause the issue?

I must say when I did my test run a few weeks/months ago I was only paying attention to PVOutput so not sure is mqtt ever worked. PVOutput works fine by the way.

Should I enter the serial number manually in the mqtt topic configuration page? Will this break the creation of automatic sensors?

Also checked /data/device and there is nothing in there

Yeah a blank serial will cause issues. It will create a space in the mqtt topic and or message. Which will break the command as it will end prematurely at the space.

You can try just entering the serial in the mqtt topic in options.

homeassistant/sbfspot_{plantname}/sbfspot_2100346950

That should work… I think.
Still be worth finding out why it’s not picking up that serial number.