SMA Solar Integration

Hello,

based on https://www.home-assistant.io/integrations/sma#sensors if have added my SMA unit (in configuration.yaml).

# lines in configration.yaml
  - platform: sma
    host: SMA unit IP address
    group: user
    password: password
    scan_interval: 120

I get a lot of sensors in the sensor overview. All sensors are either unknown or unavailable.

Are the following SMA units parts of the integration?
Battery Inverter: SUNNY BOY STORAGE 3.7 and SUNNY HOME MANAGER 2.0

What should my configuration look like? Is the entry in the configuration.yaml sufficient?

Thanks in advance
Frank

Hi,

i’m fiddling around with this on my own at the moment. Got an Solar Inverter and a Battery Inverter.
On my solar inverter the sensors are running, but some deliver no data.
I included some sensors via the custom: sensors, you maybe have to read out your special keys and add them manually.

To do so, should be able to login directly to your sunny boy via it’s web interface. Are you able to do this?

1 Like

Hello cpo,

yes i have webaccess to the sunny boy storage. The same is true for the sma energy meter and for the sunnyportal.

I was successful in reading some data from the Energy Meter via https://github.com/kellerza/hassio-sma-em.

I am not successful with https://www.home-assistant.io/integrations/sma/ . It is a German installation not a US.

Integration of PV power, battery level and output power from the battery would be nice.

Frank

To add one information.
My Sunny Boy Inverter is not accessable.
Frank

Hi Frank :slight_smile:
small world, german as well. :slight_smile:

However, i got no values on some sensors of the sma integration (in my case a a Tripower 8.0) as well.
I was sucessful in opening the WebUI of the inverter, go to the “Momentanwerte”-Tab and right click (in my case Firefox) on a value of interest and click “inspect element”.

In the “inspector” window, that opens in the lower part, you should see an corresponding key in a format like “v6100_00464E00”.

Use this key (without the leading v) to create a custom sensor (see sma integration docs).
Should be something like this:

custom:
  current_consumption_own:
    key: '6100_40468F00'
    unit: W
    factor: 1

Restart and give it a try. It worked for me, as some keys are different to the ones used in the library of the sma integration.

Oh, and it seems, that the custom: part only works, if you have at least one regular sensor of the sma integration activated. Even if it’s useless and gives you a warning in the HA logs…

Good morning,

Thank you. Have already tried this.

I can access the SMA Sunny Boy Storage. I have taken the key from the Momentanwerte. The key for Ladezustand Batterie is v6100_0295A00.

  - platform: sma
    host: 192.168.178.60
    ssl: true
    verify_ssl: false
    password: ******
    sensors:
      - current_consumption 
    custom:
       current_batterie:
         key: '6100_00295A00'
         unit: p
         factor: 1

The error log is:

Logger: pysma
Source: /usr/local/lib/python3.8/site-packages/pysma/init.py:296
First occurred: 7:39:47 (109 occurrences)
Last logged: 7:48:54

No values for sensors: current_consumption [6100_00543100]. Response from inverter: {‘6100_00295A00’: {‘7’: [{‘val’: 0}]}}

If i change the sensor current_consumption to grid_power_absorbed no error information can be found in the log-file. But still no values.

Frank

Forgot one more aspect. The unit % is not possible.
Frank

Hmmm… I’m out of ideas here, sorry.

Not all of the keys mapped in the pysma library are giving me a value either. So i assume, they are different from inverter to inverter. I was able to get the values i wanted (except for the damn “whole house consumption” i see in the sunny portal) via the custom: sensors.

You could (and probably aready have) try some more values given by the WebUI as custom: sensors.
The predifined current_consumption sensor in your sunny boy is clearly not the one mapped in the sma integration, but one could ignore the warning (for now)

Nevertheless you should get a value for your current_batterie: as you can see the values in your webUI.

Maybe one of the other users has any thoughts on this.

Hello,
i find the sensor in the entity list:

But in the lovelace i get the following message:
image

Frank

Ok, tried this with my Sunny Island and getting an “unknown” too. :wink:

Edit: Tried the things i suggested here, but even with more sensor-key-tests i always get “unknown” for all of them. The same code (different keys of course) work on my SMA Tripower.

Hello,

I’m also try to connect the Sunny Battery Storage 5.0 without success.Same feedback as you already stated.The requests to the Sunny Tripower will answered positive but with the same warning messages.

Do you tried the mod bus connection?

Do you use the user login or installer?

Sven (Koblenz)

Hello Sven,

I use the user login.

Frank

Hello,
,an inquiry, is anyone able to successfully query any entity from the storage controller (SMA Sunny Boy Storage)? Or is it only possible with the SMA inverters?

Frank

Hello,

I used the modbus and it works now:

configuration.yaml

modbus:

  • type: tcp
    name: SMA-SBS
    host: xxx.xxx.xxx.xxx
    port: 502

sensor.yaml

  • platform: modbus
    scan_interval: 30
    registers:
    • name: hp.BatChrg.CurBatCha
      hub: SMA-SBS
      unit_of_measurement: W
      slave: 3
      register_type: holding
      register: 31393
      scale: 0.001
      precision: 3
      count: 2
      data_type: uint
    • name: hp.BatDsch.CurBatDsch
      hub: SMA-SBS
      unit_of_measurement: W
      slave: 3
      register_type: holding
      register: 31395
      scale: 0.001
      precision: 3
      count: 2
      data_type: uint
    • name: hp.Bat.ChaStt
      hub: SMA-SBS
      unit_of_measurement: “%”
      slave: 3
      register_type: holding
      register: 30845
      scale: 1
      precision: 3
      count: 2
      data_type: uint

Hello Kesselberry,

thanks.

Is there a place where to add the login information?

Frank

Hello,

i am using the follwing entries in configuration.yaml

# modus fĂźr SMA-Storage auslesen
modbus:
    type: tcp
    name: SMA-SBS
    host: 192.168.178.60
    port: 502

sensor:
  # auslesen der SMA-Storage Werte
  - platform: modbus
    scan_interval: 30
    registers:
      - name: hp.BatChrg.CurBatCha
        hub: SMA-SBS
        unit_of_measurement: W
        slave: 3
        register_type: holding
        register: 31393
        scale: 0.001
        precision: 3
        count: 2
        data_type: uint
      - name: hp.BatDsch.CurBatDsch
        hub: SMA-SBS
        unit_of_measurement: W
        slave: 3
        register_type: holding
        register: 31395
        scale: 0.001
        precision: 3
        count: 2
        data_type: uint
      - name: hp.Bat.ChaStt
        hub: SMA-SBS
        unit_of_measurement: “%”
        slave: 3
        register_type: holding
        register: 30845
        scale: 1
        precision: 3
        count: 2
        data_type: uint
  - platform: filter
    name: SMA Grid Power
    entity_id: sensor.sma_grid_power_5s
    filters:
      - filter: time_simple_moving_average
        window_size: 00:01
  - platform: filter
    name: SMA Grid Total
    entity_id: sensor.sma_grid_total_5s
    filters:
      - filter: time_throttle
        window_size: 00:05
  - platform: filter
    name: SMA Grid Voltage
    entity_id: sensor.sma_grid_voltage_5s
    filters:
      - filter: time_simple_moving_average
        window_size: 00:00:30
  - platform: sma
    host: 192.168.178.60
    ssl: true
    verify_ssl: false
    password: !secret sma_storage_passwort
    sensors:
      - grid_power_absorbed
      - grid_power
    custom:
       current_batterie:
         key: "6100_00295A00"
         unit: p
         factor: 1

But still a “unkown” for hp.BatChrg.CurBatCha, hp.BatDsch.CurBatDsch and hp.Bat.ChaStt

the log entry is:

Logger: pymodbus.client.sync
Source: /usr/local/lib/python3.8/site-packages/pymodbus/client/sync.py:214
First occurred: 10:18:48 (364 occurrences)
Last logged: 10:49:18

Connection to (192.168.178.60, 502) failed: [Errno 111] Connection refused

Frank

Hello,

just jused the login for the Sunny Tri Power with the sma integration.
I didn’t used any login for the modbus data out of the Sunny Boy Storage.

If you used the login for the SBS to often the SBS will block you.
=> configure the modbus without login, delete the “old” sma integration login to the SBS, sleep one night, tomorrow morning it will working:-)

Hello,

of course modbus must be activated in the inverter.

Hello,

missed this. But i need the login as installatuer. Correct?

Frank

Hello,

yes, login just as user the modbus can’t be activated.
I got the password from my installer.