MODBUS data from SMA Inverter

I’m using a template:

template:
  - sensor:
      - name: "pv_leistung_template"
        unit_of_measurement: "W"
        state: "{% if states('sensor.PV_Leistung') is not none %}
          {% if states('sensor.PV_Leistung') | int < 0 %}
          {{ 0 }}
          {% else %}
          {{ states('sensor.PV_Leistung') | int }}
          {% endif %}
          {% else %}
          {{ 'error' }}
          {% endif %}"

Thank you for your prompt reply.


Now it worked for me too.

1 Like

Hello, do you have more sensors in stock?
Do you have L1 and L2 too

I’m only using these values from the SMA inverter:

template:
  - sensor:
      - name: "pv_status_template"
        state: "{% if is_state('sensor.PV_Status', '35') %} Fault
          {% elif is_state('sensor.PV_Status', '303') %} Off
          {% elif is_state('sensor.PV_Status', '455') %} Warning
          {% elif is_state('sensor.PV_Status', '307') %} OK
          {% else %} Unknown Code
          {% endif %}"
      - name: "pv_leistung_template"
        unit_of_measurement: "W"
        state: "{% if states('sensor.PV_Leistung') is not none %}
          {% if states('sensor.PV_Leistung') | int < 0 %}
          {{ 0 }}
          {% else %}
          {{ states('sensor.PV_Leistung') | int }}
          {% endif %}
          {% else %}
          {{ 'error' }}
          {% endif %}"
      - name: "pv_temperatur_template"
        unit_of_measurement: "°C"
        state: "{% if states('sensor.pv_temperatur') is not none %}
          {% if states('sensor.pv_temperatur') | int < 0 %}
          {{ 0 }}
          {% else %}
          {{ states('sensor.pv_temperatur') | int }}
          {% endif %}
          {% endif %}"
      - name: "pv_spannung_template"
        unit_of_measurement: "V"
        state: "{% if states('sensor.pv_spannung') is not none %}
          {% if states('sensor.pv_spannung') | float(default=0) < 0 %}
          {{ 0 }}
          {% else %}
          {{ states('sensor.pv_spannung') | float(default=0) }}
          {% endif %}
          {% endif %}"
      - name: "pv_frequenz_template"
        unit_of_measurement: "Hz"
        state: "{% if states('sensor.pv_frequenz') is not none %}
          {% if states('sensor.pv_frequenz') | float(default=0) < 0 %}
          {{ 0 }}
          {% else %}
          {{ states('sensor.pv_frequenz') | float(default=0) }}
          {% endif %}
          {% endif %}"

I once contacted SMA to get exact data, because not all inverters use the same addresses.
If I follow this here you can only see how difficult the topic is.
Have you already watched the video on youtube on this subject (SMA inverter via Modbus in ioBroker) is quite helpful.

I haven’t watched the video yet.

Hi, the templates don’t match what you posted in August '21.
Did you change your configuration?

To avoid the strange values, I fetch the values via Modbus and then I’ll transform them with a Template:

Modbus:

modbus:
  - type: tcp
    host: 192.168.2.155 # SMA TriPower
    port: 502
    name: "sma"
    close_comm_on_error: true
    delay: 5
    timeout: 5
    sensors:
      - name: PV_Status
        data_type: int32
        unit_of_measurement: "status"
        slave: 3
        address: 30201
        count: 2
      - name: PV_Gesamtertrag
        unit_of_measurement: "kWh"
        slave: 3
        address: 30531
        input_type: input
        count: 2
      - name: PV_Leistung
        unit_of_measurement: "W"
        slave: 3
        address: 30775
        input_type: input
        count: 2
      - name: PV_Tagesertrag
        unit_of_measurement: "Wh"
        slave: 3
        address: 30517
        count: 4
        data_type: int
      - name: Netzverbrauch
        slave: 3
        address: 30865
        unit_of_measurement: "W"
        count: 2
        data_type: uint
      - name: PV_Temperatur
        data_type: int32
        device_class: "temperature"
        unit_of_measurement: "°C"
        slave: 3
        address: 30953
        count: 2
        scale: 0.1
      - name: PV_Spannung
        data_type: int32
        device_class: "voltage"
        unit_of_measurement: "V"
        slave: 3
        address: 30783
        count: 2
        scale: 0.01
        precision: 2
      - name: PV_Frequenz
        data_type: int32
        unit_of_measurement: "Hz"
        slave: 3
        address: 30803
        count: 2
        scale: 0.01
        precision: 2

Template:
see above

The address 30953 does not exist with me. I got in touch with sma to get the exact data about my inverter.
As I said, not everything is the same.In the event that you need more information about your inverter, just let us know.


ah, I have a SMA Sunny Tripower 10.0

If you give me the exact name I can send you the document. See list

I also have the sunny home manager with me, where I can access the values ​​that I do not receive from the inverter.

The exact name is STP10.0-3AV-40

It’s not on the list I have. What does the 3AV-40 mean?

That should fit.
Is only the first page.
If you need everything you have to let us know.
The best would be by mail because there are 8 pages.

1 Like

Thank you! Will check that.

Hey guys, sorry about my bad english, but I had it translated with deepl :slight_smile:

I have a little problem. I would like to display the register 30871. But only wild numbers come out. Either numbers up to 4 billion or numbers up to -4 billion. I have changed the counter from 2 to 4, or data_type to ipnut_type / uint / int / int32 / input, all without success. What am I doing wrong?

modbus: 
  - type: tcp
    host: 192.168.178.38 # SMA TriPower
    port: 502
    name: TCP_Wechselrichter
    close_comm_on_error: true
    delay: 5
    timeout: 5
    sensors:
      - name: PV_Gesamtertrag
        unit_of_measurement: kWh
        slave: 3
        address: 30531 #U32
        data_type: int32
        count: 2
      - name: PV_Leistung
        unit_of_measurement: W
        slave: 3
        device_class: 'power'
        address: 30775 #S32
        data_type: int32
        count: 2
      - name: PV_Tagesertrag
        unit_of_measurement: Wh
        slave: 3
        address: 30517 #U64
        count: 4
        data_type: int64
      - name: Netzverbrauch
        slave: 3
        address: 30865 #S32
        unit_of_measurement: W
        count: 2
        data_type: int32
      - name: Netzeinspeisung
        slave: 3
        address: 30867 #S32
        unit_of_measurement: W
        count: 2
        data_type: int32
      - name: Eigenverbrauch
        unit_of_measurement: W
        slave: 3
        address: 30871 #U32
        data_type: uint
        count: 2

I have this problem with many registers. Among others with 30577 or 30579. I am desperate. But the other registers are in there and work well with templates.

viele zahlen

Can you help me ?

Sunny Tripower 5.0
Firmware-Version: 3.10.19.R

Greetings maddin

Hi Dominic.
Have you figured out how to get the values in the list in the solar production part of the energy panel.
I also have an STP 10000TL-20 but in Sweden. And I get good values from modbus when the sun is shining.
Hasse

Hello, everything is described above how it has to be done, see the post from January 5th.
You have to use the template sensors that you have to insert beforehand, then some of the values ​​will work correctly. Sollten ihre sensoren anders heißen brauchen sie nur bei Template die Namen zu ändern.

Hello, I have a table that I had SMA send me and according to it the 30579 and 30871 are not supported by your inverter.
It would make sense to contact SMA first before you despair. Perhaps you know the exact designation of your inverter if the Sunny Portal says something like STP 5000TL 20.