SBFspot Bluetooth homeassistant addon

Hello, sorry that I’m only getting in touch now, here’s a screenshot of the sensors that I get without changing anything.

Looks good. Is that with {serial} or your adjusted serial?

I meant a screenshot of the options page. I was curious how it showed up in your system (which is presumably in german? not english) Perhaps I can translate some of the English into German or something.

Hello, so I use the original have not changed anything.
I did the following. I edited it right away in Yaml, first entered zero everywhere and then entered the data individually because if I hadn’t done it that way, I only got error messages every time and I couldn’t save.



1 Like

Sorry I meant on the Non yaml options.
I was trying to see if the hints and explanations show up.

However I tried adding a de.yaml file with Deutsch translations and it didn’t pick it up, it still showed the English hints when I switched to Deutsch language in HA. So it’s not as easy as I thought.

Google translate does translate the options page if that helps someone in the future.

If you happen across an addon that has translated options post a link and I’ll have a look at how they get it working.

I would have a different approach maybe just using Mqtt just for my own use of the data. I can well imagine that most of those who use it with and for HA only do it for themselves so that they don’t always have to go online via any manufacturer apps, just to check and to have an overview.

Hello, had to find the following problem.
Whenever I have to restart the system after an installation or a change or after an update or if the system runs itself, I have to restart the integration SBFspot so that it runs and displays values ​​again.

Yes it takes a few minutes during the day to send the new data.
At night the communication to the inverter is shut off so it will sit on unknown until the addon is restarted, or when the inverter wakes up in the morning.

You could make an automation to restart the addon following a restart of home assistant.

Unless you know how to write a python script to track the websocket restarts inside the container. I haven’t managed to do that as yet.

I managed to add 1 inverter to pvoutput and back to HA.
it was not clear in the energy dashbord were to add them… it’s in “foreseen production”

as pvoutput donator you can add several inverters and the production can be summed.
You need to look at data aggregation : Data Aggregation — PVOutput documentation
Could be a solution.

But atm for MultiINV-SBFspot i have a message preventing installation :
’ not compatible with pi cpu’ (sorry for my bad translation … i have HA in french ^^)

In the addon store if you click on check for updates you should be able to install now for your pi.
Capture



I put my sensors in

retour à la grille (return to grid)
and/or
production solaire (solar production)

foreseen production (next production?) is that for solar forecast(prévisions solaires?) perhaps?

You can put the MQTT data directly into the energy dashboard or you can use the PVoutput data. That is upto you.
SMA Energy Lifetime is what I usually put in Solar production.

Although with two inverters you would need to make a template sensor to Sum both MQTT sensors from each inverter.

{{ states('sensor.sma_energy_lifetime) + states('sensor.sma_energy_lifetime_2') }}

The data from PVoutput should already be an aggregate of both inverters(I think, was waiting for you to tell me actually).

Regarding the donation aggregation. You would need to be uploading the two inverters separately. SBFspotUpload (its combined in MariaDB) should be already sending them up to PVoutput in aggregate(I think)

This will poll your inverter to update your sensors when homeassistant restarts when it is dark.
This is how I would set up said automation.

First you need to use puttygen to make a public private key
puttygen

the Public key, (which is the blue highlighted bit)
gets pasted into a file called `id_rsa.pub’ or whatever you want to call it.
for this example its ‘id_rsa_ha.pub

The Private key you need to go to ‘Conversions > export OpenSSH Key
That gets pasted into a file called ‘id_rsa_ha

They get put in config/.shh/ note the fullstop .ssh for hidden directory.

You can create known_hosts file at this time too.

ConfigSSH

You need to change the permissions on the id_rsa_ha file via the console (Terminal addons -la)
chmod 600 id_rsa_ha




If you don’t change the permissions you will get an error.
Capture


Once all that is done you can test the command in Terminal and SSH addon( the official one, not the community one).

The command is

ssh [email protected] -o UserKnownHostsFile=/config/.ssh/known_hosts -i /config/.ssh/id_rsa_ha 'docker exec addon_a51a23d8_multiinv-sbfspot /SBFspot -v -finq -mqtt'

You need to change the hostname(haosVM.local) to your hostname(eg. homeassistant.local)
You will also need to change addon_a51a23d8_multiinv-sbfspot to the other addon if that’s the addon you are using. eg. addon_a51a23d8_haos-sbfspot

for example
ssh [email protected] -o UserKnownHostsFile=/config/.ssh/known_hosts -i /config/.ssh/id_rsa_ha 'docker exec addon_a51a23d8_haos-sbfspot /SBFspot -v -finq -mqtt'

don’t forget the quotes wrapping the docker exec part.


Once it works you can make a shell_command in your configuration.yaml

shell_command:
  # poll SBFspot Inverter with -finq
  sbfpot_finq: ssh [email protected] -o UserKnownHostsFile=/config/.ssh/known_hosts -i /config/.ssh/id_rsa_ha 'docker exec addon_a51a23d8_multiinv-sbfspot /SBFspot -v -finq -mqtt'

Then you can make your automation

alias: SBFspot Poll nighttime
description: SBFspot poll inverter on HA restarts outside of daytime hours.
trigger:
  - platform: homeassistant
    event: start
condition:
  - condition: sun
    before: sunrise
    after: sunset
  - condition: state
    entity_id: binary_sensor.multiinv_sbfspot_running   ## Enable in supervisor integration
    state: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 0
action:
  - service: shell_command.sbfpot_finq   ## This was made above
    data: {}
mode: single


The binary sensor comes from Supervisor Integration in Devices and Services
You need to enable the binary sensor
Capture


Hopefully I will figure out websockets one day and make the automation redundant. This Automation is significantly easier to setup than websockets so far however.

I suppose you could also use the shell_command to poll your inverter more often…




Thanks to Mike and if you need further info

for info I’ve also posted the ‘multi inverters’ on SBF spot forum and here’s the reply.
I’ve tryed updating that parameter … but I see no difference.

Set MIS_enabled=1 in SBFspot.cfg

I then installed MultiINV-SBFspot. verry easy. Thx again !
I will following the logs for a few days to check if all numbers match

Beginner question I guess… but where do you see MQTT sensors ?

I don’t think you actually need MIS enabled. You would if you were running SBFspot directly using multiple BT inverters… But it’s two separate addons so shouldn’t be being used…
(I Think) it’s one of those things I can’t test.

Edit: Hmm that’s interesting about the BT network. That seems to imply only one inverter would need to be polled for data from all inverters. You would have to check the numbers to confirm that. Perhaps multiple addons are not needed and just one BT address is required.

MQTT sensors should show up in the MQTT integration in settings > devices and services > MQTT integration.

That’s assuming you have run the create sensors once to create them in the HAOS-Sbfspot or MultiINV-SBFspot addons.

For sure, using Multi and MIS option are two different solution.
I see other people looking for the same answer… I’ll dig a little bit.

Thx for the MQTT explaination… It’s now working.

Still have to do :

{{ states('sensor.sma_energy_lifetime) + states('sensor.sma_energy_lifetime_2') }}

where do I need to add this sensor sum ?

By any chances … are you as good with daikin heat pump or Domintell domotic that you are with SMA inverters ?
:stuck_out_tongue:

1 Like

Hi there, I used the SBFspot BT HA addon for a while with pleasure to get data from my SB2000HF in HA. A month ago I updated my PV-system (from 2011) on my house and reused the SB2000 and old PV panels in a bit more remote location: too far away from my PI4 for a direct BT connection, but within WIFI range. Would it be possible, or better perhaps already experience with the new BT proxy feature in HA (based on ESP32) to bridge this connection gap? I am a user, with very little programming experience… so may need a bit of explanation if this turns out to be a stupid question…

@WI001

Not possible to use proxy as far as I know.
The inverters don’t use Bluetooth low energy (ble).

Ble devices just automatically send out their data, alot like Rf devices. So the proxy just grabs that floating data and passes it on.

The inverters need to be commanded to send data. SBFspot logs into the inverter and commands that the data be sent, every 5 minutes.

What may be possible is to put SBFspot onto a esp32. I think if you look back at the history of SBFspot it was originally based on an arduino project.

It’s not something I have dug into much and outside the scope of this addon though.

Edit:

This seems recent. Not sure if it works or not.

Actually looks like sillyfrogs is more advanced.

@lebeck

You would need to make a template sensor which uses that value_template.

You can also use dev tools > template to check it is providing the correct number.

template:
   - sensor:
        - name: Combined Inverter data  ## You can make up your name of choice
          unique_id: sbfspot_combined_id_128123483  ## this can be any sort of unique value
          device_class: energy
          state_class: total_increasing
          icon: mdi:solar
          state: >
             {{ states('sensor.sma_energy_lifetime) + states('sensor.sma_energy_lifetime_2') }}
     

You probably need to provide a default value also, so that HA knows what to do with unavailable data.

{{ states('sensor.sma_energy_lifetime) | float(none) + states('sensor.sma_energy_lifetime_2') | float(none) }}

You will need to check if that works on

Capture

Indeed, that way not all your inverters need to be in BT range with the connecting host. Each device needs to “see” another device in the same network (= with same netID)

1 Like

Well it seems like it should work out of the box with the addon then.
Might be just a case of not turning on the option correctly.

haos-sbfspot repo issue 42

If I understood… the problem is with sensor creation for multi bluetooth inverter.

Even if not working yet… Huge thx to HasQT sbf01 and Sven for ongoing work and cross comunication
What a great comunity !!

Yeah seems to be.

If you run each inverter through the sensor creation in HAOS-SBFspot. You will get sensors for each inverter. Do this with MIS_enabled: 0

Once the sensors are created enable MIS and set sensors create to No.

It should then pick up sensors from both inverters in MQTT.

PVoutput:
Needs separate accounts (unless you donate, not sure how that works)

So you would put for inverters.

SerialnumINV1:acc1, serialnumINV2:acc2