SMA Solar Integration

Hello JerryCih

In order to integrate devices into the energy area, they require special properties. For example these

    device_class: energy
    state_class: total_increasing  

Here, either the current entities must be assigned this property or the existing values must be assigned to newly created ones that have these properties.

My inverter in > 10 years old (SMA Sunny Boy 2500HF-30). No access via Modbus etc…

Frank

Hello JerryCih,

you say you have access via Modbus to the SMA Home Manager 2.0. How did you achieve this? I don’t even have access to the device via the web.

Frank

I followed chris_ka tutorial and it works (its not modbus)

As for the energy area, I know that they require something but I have no idea how to do that, Im not a coder, Im a follower :slight_smile:
I use the power wheel from HACS to see my power distrubution.

Hi Frank,

The SMA inverter I have is a SUNNY TRIPOWER 4.0 (firmware 3.10.10.R) and I’m running HA version 2021.10.0 on a pi with HA OS but the problem not being able to login using the SMA Solar integration still exists.


The modbus workaround works partially but when i create a sensor integration for the Energy tab the sma_power still is showing negative values:

sensor 3:
  - platform: integration
    source: sensor.sma_power
    method: left
    name: energy_sun
    unit_prefix: k
    round: 2

even with this template:

- name: "sma_power_template"
      unit_of_measurement: "power"
      state: "{% if states('sensor.sma_power') is not none %}
                 {% if states('sensor.sma_power') | int < 0 %}
                    {{ 0 }}
                 {% else %}
                    {{ states('sensor.sma_power') | int }}
                 {% endif %}
               {% else %}
                 {{ 'error' }}
               {% endif %}"
      attributes:         
          last_reset: '1970-01-01T00:00:00+00:00'

image

Hello Ben
Have you tried the group ‘user’?
Frank

funny numbers like yours are usually a result of a wrong way to assign variables. So e.g. integer instead of floating number. But I am not a programmer in HA. I only know this from my programming work in climate research.

No idea if this can be a problem here too.
Frank

Yes, same result :frowning:

The strange thin is that the entity sma_power works fine in another card, just not in the Energy tab

This can be fixed by adding sensors like this:

sensor 3:
  - platform: integration
    source: sensor.sma_power
    method: left
    name: energy_sun
    unit_prefix: k
    round: 2

except for the negative value in my case…

Hello Ben,

One question: you can connect to the inverter via SMA Solar Integration?
If so what entities are visible at Configuration - Entities - Search: SMA Solar? Which values / units are there?

Frank

Hello Frank,

No, tried every option to connect locally but since an update this summer the SMA Solar integration is not working anymore (user, installer, SSL on/off etc, nothing works) so currently only the modbus workaround is an sort of an option for me at this moment. As said with this the sma_power entity works well on a card, but not on the energy screen. I created a sensor interation for sma_power but this one shows negative values

1 Like

Hi all, I noticed my sensor.daily_yield is not the same as the sunny portal shows as the yield of the day. Also, there is an entity “total_yield” and “pv_gen_meter”, that are almost the same and I think are meant as the same numbers. Anyone can tell me more about it?

Did you fix this problem? Stumbling on the same problem in a new environment.

Hi Mathieu,

No, I did not find a solution yet. It should not be that hard to fix this since it worked fine before august this year…

In my case the modbus workaround isn’t even working…

modbus:
  - type: tcp
    name: sma
    host: 192.168.2.28    # use the ip address for your inverter as mentioned in the text
    port: 502                # use the port you saw in sunny explorer
    close_comm_on_error: true
    delay: 5
    timeout: 5
    sensors:
      - name: AccumulatedPower
        unit_of_measurement: W   # see register description in section 5.4.1 of the document
        slave: 2                   # use the UnitID you found in Sunny Explorer
        address: 30233            # use a register from section 5.4.1 of the document
        input_type: input       # all registers starting with 3 need to have the type input
        count: 2   
      - name: TotalEnergy
        unit_of_measurement: Wh
        slave: 2
        address: 30513
        input_type: input
        count: 4  
      - name: PVFeedIn
        unit_of_measurement: W
        slave: 2
        address: 30775
        input_type: input
        count: 2

Schermafbeelding 2021-11-30 om 12.03.10

Hi all, my first post here.

I’ve seen that a lot of you are struggling with SMA integration so I’ll post here how I integrated two different SMA solar plants (one at my place with SMA Data manager, custom BControl EML300LR energy meter, SMA TPL25 and one at fathers place SMA Home Manager 2.0 and two SMA inverters).

Install https://peyanski.com/how-to-install-home-assistant-community-store-hacs/ HACS
Within HACS install GitHub - CJNE/ha-sunspec: Home Assistant customcomponent for SunSpec modbus devices

My place (BControl energy meter + SMA inverter):
For BControl and inverter (please enable modbus on it)
Add both via Sunspec (try slaves 1,2,3,126. For me BCcontrol is 1, and inverter is 126)


You will see sensors working out of the box

Father’s place (SMA Home Manager 2.0, SMA inverters)
(since Home manager does not support modbus, you need to have a special integration for it)
Install and configure MQTT like here htt[REMOVE]ps://learn.adafruit.com/set-up-home-assistant-with-a-raspberry-pi/mqtt-setup
Install ht[REMOVE]tps://github.com/kellerza/hassio-sma-em (here you’ll want to add sensors you need to the plugin configuration like i2,i3,i1 for the amps per phases etc.)

I had to add [REMOVE] to links since, system won’t let me to add this helpful guide, as I’m a new user.
Please let me know if someone tries without success and I can guide you.

1 Like

Data from BControl and SMA inverter

Thanks @davrog10 for sharing this. I finally managed to add my SMA inverter based on your description!!
Energy-screen

Hello

I have made the integration of my SI4.4M with the Sunspec and with sma integration, but I cannot write parameters to choose when to charge / discharge the battery.
Do you know how it can be done with the Sunspec integration?
So far I have only seen that all the elements are sensors and not writing variables

Thank you

Since December 14, my integration counts the total value as an hourly value at 8:00, on tuesday. Are there other people having this issue? Any pointers how I can fix this?