SMA Solar or SBFspot + PVoutput

I seem to be halfway between solutions, and was wondering if there was a fix that might help.
The SMA solar integration is lacking bluetooth connectivity, while the SBFspot/PVoutput combo don’t really suit my hardware setup.

Is it possible to add bluetooth connection option to SMA Solar as a feature request?

Is there an easy way to install SBFspot into home assistant on a supervised install?
(I sort of feel like this could be done with a python wrapper and then via installed HACs, although that will take me months to figure out)

So this is how I end up at SMA Solar and wondering how possible it is to add bluetooth support.

[SMA Solar - Home Assistant](https://SMA Solar Integration)

[Installation Linux SQLite · SBFspot/SBFspot Wiki · GitHub](https://SBFspot + PVoutput upload)

As a backstory I use SBFspot on my SMA inverter currently and upload the data to PVoutput. However to do this SBFspot is installed on my desktop PC, which won’t upload if it’s asleep. I also already pull the data into HA via MQTT. The problem is in data consistency if my PC is asleep. I would ultimately like my HA server to access the data directly, which doesn’t currently seem possible short of moving to a docker type install.

Thanks.

I’m running SBFSpot as a docker container on my Intel NUC ( same one that is running Home Assistant ) and it’s in the server rack besides the SMA so it can connect with Bluetooth.

So that could maybe also be an option…

Yeah I saw some people are running it in docker. Its probably easier to spin up a docker install, than it is to learn to convert c++ to python to convert SBFspot. :laughing:

Depends on the demand I guess with all this new Energy excitement.

It would be interesting to see if SBFspot could run on an ESP32 too…

Which inverter are you using?

Mine has both a wired and wireless Ethernet connection that works with the Home Assistant SMA integration.

SMA Sunnyboy 5000. It only has bluetooth installed, the lan addon card is available but its not cheap. It would have about a 10 year payback on the amount of energy any automation would save on.

Assuming the inverter lived another 10 years

Yeah same here… I have the SunnyBoy 4000 without the network card. But the BT connection works fine. Only missing out on the new energy dashboard stuff for now. Until the PVOutput integration has been adjusted for it.

Ha running it on an ESP32 would be a great option too… if it would fit :slight_smile:

The PVOutput code is already merged, not sure in what HA version it will be though : Add statistics support for the PVOutput sensor by zoeisnowooze · Pull Request #54149 · home-assistant/core (github.com)

The PVOutput doesn’t really help me, as the upload I have to it is intermittent, due to the sleep issue with my SBFspot install on my desktop.

I actually just need to turn nakla/SBFspot docker file into a proper dockerfile addon I think.

1 Like

that sort of looks like it could run on an esp32… or atleast arduino, that could be converted to a bluetooth esp32. Although I am not sure if a bluetooth esp32 can be used as bluetooth host. I haven’t dived into that.

1 Like

The nakla image is the one I’m running too…

You do mean you are using the nakla image using a docker build, not a supervisor build correct?

Indeed, manually installed it with Portainer.

1 Like

Dumb question.
Where did you put your SBFspot,cfg and SBFspotUpload.cfg?
how did you change them to uid and gid 5000?

sudo docker run --network host -e "DB_STORAGE=mariadb" -e "ENABLE_SBFSPOT=1" -e "TZ=Europe/Berlin"  -v /path/to/your/config/dir/on/host:/etc/sbfspot -v /path/to/your/data/dir/on/host:/var/sbfspot nakla/sbfspot:latest

The above code is what you are referring to when you say manually?

or just a docker pull in portainer?

These are the portainer settings I have… so no docker cli command

1 Like

Thanks for the screenies. I had been about to write to nakla on your closed issue on github when you replied.

Hi nakla,

I’m an idiot who doesn’t understand paths or UID and GIDS with linux.
I am using Raspbian GNU/Linux 10 (buster) with docker and portainer, and using Home Assistant.
I have gotten SBFspot up and running and working using the SBFspot-config install.

I am trying to use your docker install and keep smashing into this error

/etc/sbfspot/SBFspot.cfg is not readable by user with ID 5000.
Please change file permissions accordingly and restart the container.

I import the image into portainer and start the container with putty cmd

sudo docker run --network host -e "DB_STORAGE=mariadb" -e "ENABLE_SBFSPOT=1" -e "ENABLE_SBFSPOT_UPLOAD=1" 
-v /path/to/your/config/dir/on/host:/etc/sbfspot -v /path/to/your/data/dir/on/host:/var/sbfspot nakla/sbfspot:latest

I have created an sbfspot user and can log in with root access. I have chown the SBFspot.cfg and SBFspotUpload, and some seemingly relevant directories. I just can’t seem to find the correct path.

The SBFspot-config install path installs to

/usr/local/bin/sbfspot.3/

I have tried various locations

/etc/sbfspot/
/etc/sbfspot.3/

Ok forget most of the above, I’m just leaving it to show how much of an idiot I am.

So I am new to docker. So I need to get my head around the user thing. I set up a manual container from your screenshots. I am still getting the same error. I am using putty and WinSCP to move stuff around, on my host e.g. user root or pi@raspberrypi

The container makes a new file system under the {user sbfspot}, which isn’t accessible with WinSCP?
correct I think.

The volume mapping in the container setup, binds {user spfspot directories} to {user pi directories}
so there shouldn’t be any need to create a new user on the pi host? no need to mess with file ownership etc…?? So the blanked name in your screenshots should be pi for me?

/home/pi/sbfspot/config/SBFspot.cfg

the ownership there should be owner: group pi:pi? Is that the correct location or am I totally lost?

the hostname in your screenshots should be raspberrypi for me also? that’s correct I think(although may change if it was HAOS)

I am using MQTT and MariaDB addons from within home assistant for the standard sbfspot-config setup.

Was not sure, but it seems I did indeed add a sbfspot user to the linux system and gave it the 5000 uid and gid.
Placed him in a custom linux group and gave that group full read and write rights to the host mapped SBFSpot folder ( in your case /home/pi/sbfspot ).

1 Like

For other peoples future reference mostly.

for the SBFspot container you need a user with the following setup to contact the files.
You can leave the SBFspot.cfg files as root owner and root group

For connection from Container to Host machine this was my setup using Host-Network connection.

pi@raspberrypi:~ $ id sbfspot
uid=5000(sbfspot) gid=1000(pi) groups=1000(pi),0(root),5000(sbfspot)

Container to Machine

In saying that, I did manage to get the nakla/sbfspot containter to start. It connects to my Inverter, and possibly mariadb, although I think that was one fluke entry. I can’t seem to get it to hit mqtt or PVoutput upload. It doesn’t pop any errors in relation to those. So I probably just messed up a network connection somewhere.

If I use the homeassistant set Bridge connection it won’t load bluetooth, which is expected I believe.

I haven’t figured out container to container yet

Ok ignore the last few posts. They were BusterOS with supervisor docker. Who knew mosquitto_pub was missing… ugh. anyway. Speaking of MQTT, you only need the client version Debian -- Details of package mosquitto-clients in bullseye. Having a broker on your Host and in Homeassistant docker will break things.

You need to know the IP connections for core_mosquitto and core_mariadb. you can find them in Portainer. You also need to set up your database connection and tables and views in Mariadb.

Portainer is pretty neat FYI

These pics are from a bullseyeOS docker supervisor. as in not HAOS. I’m not sure if you can get enough user/group permissions for HAOS.

For Docker Hub nakla/sbfspot you still need the user:group 5000 5000 combo, plus chmod recursively from the install folders.

You also need to use nakla specific cfg files. they are slightly different to the original build. In a kind of hard to spot way.

Running it in portainer is abit fiddly it’s hard to find the logs. you will most likely need to know how to use the logs well. reading the logs in the container itself is a pain
it throws kooky errors in different spots all the time. journalctl and systemd not HA logs…

cant access folder… cant write to folder. cant find mosquitto.
sending mqtt but there is no message anywhere. no PVoutput… not sure how to find the logs for that.

You also need to have your MQTT user name and password in your message setup. there is new ways to do that with bullseye… with encryption etc. or use a cheap user/pass for your MQTT connection.

I love trying to find syntax examples… so MQTT setup is from terminal window

mosquitto_pub -u yourUSER -P pASSW0rd(capital -P) -h ip/hostname -p Port(small p) -t topic/SBFspot/etc/youwant -m message-payload.

In sbfspot

-u you just start user name - P Password -h Hostname etc etc from above

If you can send a msg via terminal window with /usr/local/bin/mosquitto_pub you should be in a good place to setup.

1 Like

https://www.hostm.com/tutorials/mariadb/remote-access

phpmyAdmin web access address

Ugh so easy when you know where to find the remote access address for your database. That is a nice addon too. phpMyAdmin

the docker works now

you need to set privileges too. same addon. and your mariaDB config page.

# MySQL
SQL_Database=SBFspot
SQL_Hostname=http://1(Your link from phpMyAdmin)db=SBFspot
SQL_Port=3306
SQL_Username=sbfspot@localhost
SQL_Password=password

Hello,
the present solution requires a HA installation that is not based on the HA operating system. Therefore, the solution is not a solution for everyone.

An integration of Bluetooth in the SMA solar integration or the SBFspot/PVoutput combo would be very helpful. Both are based on the HA installation with HA operating system. (with me on raspi 4)

I also have a SMA inverter with bluetooth only access.

Frank