SBFspot Bluetooth homeassistant addon

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

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.

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.


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



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