MODBUS data from SMA Inverter

Hello there,

I have a Sunny Tripower 20000 and Iam not able to get continuously data from it.

I use SunSpec, I activated Modbus via the SunnyExplorer. If i reload SunSpec during daylight I get the data from current production. After sunset the sensors shut off (?) and I just get “This entity is no longer being provided by the sunspec integration. If the entity is no longer in use, delete it in settings.”
The next morning I does not start again and Iam stuck with no data.

Does anyone has the Tripower 20k and is able to get their data?

Hi Stephan,
is my understanding correct that you managed to integrate a Sunny Webbox in home assistant. I have also a Webbox can you support me for integration?

best regards
Chris

Hi Lugia,
Would you mind posting your configurations for the Tripower 25000TL inverter please? I have spent over 6 days trying everything possible and can’t get these working in HA. I have 5 to connect with and can confirm Modbus connection with the same computer running HA, but not through HA itself.
Many thanks.

Hi Braxx,
lI have the exact same installation. Do you have found a solution.
Regards,
Krobbe

Try the EMHASS project:
https://community.home-assistant.io/t/emhass-an-energy-management-for-home-assistant/338126

But I think you’ll have to figure out yourself how to control the battery (maybe ask SMA).

@krobbe

Here you go. This goes into a modbus.yaml or with prefix “modbus:” into the configuration.yaml

- name: "sma"
  type: tcp
  host: 192.168.x.x # ip address of sma inverter
  port: 502
  sensors:
    - name: "SMA Energy Total"
      slave: 3
      data_type: uint64
      address: 30513
      scan_interval: 10
      unit_of_measurement: "Wh"
      state_class: 'total'
      device_class: 'energy'
    - name: "SMA Energy Today"
      slave: 3
      data_type: uint64
      address: 30517
      scan_interval: 10
      unit_of_measurement: "Wh"
    - name: "SMA Current Power"
      slave: 3
      data_type: int32
      address: 30775
      scan_interval: 10
      unit_of_measurement: "W"
    - name: "SMA Internal Temperature"
      slave: 3
      data_type: int32
      scale: 0.1
      address: 30953
      scan_interval: 10
      unit_of_measurement: "°C"
    - name: "SMA Status Code"
      slave: 3
      data_type: uint32
      address: 30201
      scan_interval: 10

Thanks to this thread I managed to get lots of data from my Sunny tripower inverter.
There’s only one thing that doesn’t work and that’s the A Current phase L1, L2 and L3.
I use address 30797, 30799 and 30801 for this, but the data remains zero.

This is my piece of code from conf yaml:

      - name: "SMA Fasestroom L1"
        unique_id: "fa400021008"
        state_class: "measurement"
        device_class: "current"
        unit_of_measurement: "A"
        slave: 3
        address: 30797
        data_type: "int32"
        scale: 0.001
        precision: 2
        min_value: 0
      - name: "SMA Fasestroom L2"
        unique_id: "fa400021009"
        state_class: "measurement"
        device_class: "current"
        unit_of_measurement: "A"
        slave: 3
        address: 30799
        data_type: "int32"
        scale: 0.001
        precision: 2
        min_value: 0
      - name: "SMA Fasestroom L3"
        unique_id: "fa400021010"
        state_class: "measurement"
        device_class: "current"
        unit_of_measurement: "A"
        slave: 3
        address: 30801
        data_type: "int32"
        scale: 0.001
        precision: 2
        min_value: 0

Hi, I’m looking to download data from my 2011 SMA Sunny Boy 4000TL, in particular the daily generation total. Is that what you are collecting with your ‘SMA Energy Total’ and ‘SMA Energy Today’ Wh sensors?

address 30517 (data_type uint64) is total daily yield in Wh,
address 30513 (also uint64) is total yield in Wh of the SMA from the initial start.

1 Like

Thank you. I have a 485 Data Module and a Waveshare RS485 to Ethernet converter on their way. The installation instructions for the module make it look fairly simple (hopefully).

@Crash123Crash123 I also have a 3600, I added your config, checked modbus was all ok in the SunnyBoy app but HA just chucks out loads in the error log

nvalid config for 'modbus' at configuration.yaml, line 108: SMA_grid: `count` illegal with `data_type: uint32` 'modbus->0->sensors->6', got {'name': 'SMA_grid', 'slave': 3, 'address': 30217, 'scan_interval': 60, 'count': 2, 'data_type': 'uint32'}
Invalid config for 'modbus' at configuration.yaml, line 114: SMA_Insulation: `count` illegal with `data_type: DataType.INT16` 'modbus->0->sensors->7', got {'name': 'SMA_Insulation', 'slave': 3, 'address': 30225, 'scan_interval': 120, 'count': 2}
Invalid config for 'modbus' at configuration.yaml, line 53: SMA_Power_AC: `count` illegal with `data_type: uint32` 'modbus->0->sensors->0', got {'name': 'SMA_Power_AC', 'state_class': 'measurement', 'unit_of_measurement': 'W', 'slave': 3, 'address': 30775, 'count': 2, 'data_type': 'uint32', 'scan_interval': 10}
Invalid config for 'modbus' at configuration.yaml, line 61: SMA_PV_Daily_Yield: `count` illegal with `data_type: int64` 'modbus->0->sensors->1', got {'name': 'SMA_PV_Daily_Yield', 'unit_of_measurement': 'kWh', 'state_class': 'measurement', 'slave': 3, 'address': 30517, 'scan_interval': 60, 'scale': 0.001, 'precision': 3, 'count': 4, 'data_type': 'int64'}
Invalid config for 'modbus' at configuration.yaml, line 71: SMA_PV_Total_Production: `count` illegal with `data_type: int64` 'modbus->0->sensors->2', got {'name': 'SMA_PV_Total_Production', 'unit_of_measurement': 'MWh', 'state_class': 'measurement', 'slave': 3, 'address': 30513, 'scan_interval': 3600, 'scale': 1e-06, 'precision': 3, 'count': 4, 'data_type': 'int64'}
Invalid config for 'modbus' at configuration.yaml, line 81: SMA_Grid Voltage: `count` illegal with `data_type: int32` 'modbus->0->sensors->3', got {'name': 'SMA_Grid Voltage', 'unit_of_measurement': 'V', 'slave': 3, 'address': 30783, 'scan_interval': 120, 'count': 2, 'scale': 0.01, 'precision': 2, 'data_type': 'int32'}
Invalid config for 'modbus' at configuration.yaml, line 90: SMA_Grid frequency: `count` illegal with `data_type: uint32` 'modbus->0->sensors->4', got {'name': 'SMA_Grid frequency', 'unit_of_measurement': 'Hz', 'slave': 3, 'address': 30803, 'scan_interval': 120, 'count': 2, 'scale': 0.01, 'precision': 2, 'data_type': 'uint32'}
Invalid config for 'modbus' at configuration.yaml, line 99: SMA_temp: `count` illegal with `data_type: int32` 'modbus->0->sensors->5', got {'name': 'SMA_temp', 'unit_of_measurement': '°C', 'slave': 3, 'address': 30953, 'scan_interval': 60, 'count': 2, 'scale': 0.1, 'precision': 1, 'data_type': 'int32


Unfortunately i do not have a SMA anymore.

1 Like

Same here, I think development changed MODBUS, I read something about not accepting a single device in its config. I think they killed it.
No SMA MODBUS guess a new breaking news. I think it wil affect a lot of people with older SMA inverters, for they can not use the webcon module of those inverters.
I hope they roll back the change or come with a solution.

I’m having a SMA 7000-TL, MODBUS is just working fine with 2024.4 core. I still get my present yield and daily total yield. So I don’t think MODBUS is broken.
(for info: I use MODBUS over tcp)

I can not use the integrated MODBUS option, for my older SMA inverter only understands the MODBUS in configuration.yaml, not the integrations option, that never did work.

modbus:
  - name: SMA
    type: tcp
    host: 192.168.0.xxx
    port: 502
    sensors:
      - name: SMA_Power_AC
        unique_id: SMA_Power_AC
        state_class: measurement
        device_class: "power"
        unit_of_measurement: W
        slave: 3
        address: 30775
        #        count: 2
        data_type: uint32
        scan_interval: 10
      - name: SMA_PV_Daily_Yield
        unique_id: SMA_PV_Daily_Yield
        unit_of_measurement: kWh
        state_class: measurement
        device_class: "energy"
        slave: 3
        address: 30517
        scan_interval: 60
        scale: 0.001
        precision: 3
        #        count: 4
        data_type: int64
      - name: SMA_PV_Total_Production
        unique_id: SMA_PV_Total_Production
        unit_of_measurement: MWh
        device_class: "energy"
        state_class: measurement
        slave: 3
        address: 30513
        scan_interval: 3600
        scale: 0.000001
        precision: 3
        #        count: 4
        data_type: int64
      - name: SMA_Grid_Voltage
        unique_id: SMA_Grid_Voltage
        unit_of_measurement: V
        slave: 3
        address: 30783
        scan_interval: 120
        #        count: 2
        scale: 0.01
        precision: 2
        data_type: int32
      - name: SMA_Grid_frequency
        unique_id: SMA_Grid_frequentie
        state_class: "measurement"
        device_class: "frequency"
        unit_of_measurement: Hz
        slave: 3
        address: 30803
        scan_interval: 120
        #        count: 2
        scale: 0.01
        precision: 2
        data_type: uint32
      - name: SMA_temp
        unique_id: SMA_temp
        state_class: "measurement"
        device_class: "temperature"
        unit_of_measurement: °C
        slave: 3
        address: 30953
        scan_interval: 60
        #        count: 2
        scale: 0.1
        precision: 1
        data_type: int32
      - name: SMA_status
        unique_id: SMA_status
        slave: 3
        address: 30201
        scan_interval: 10
        #        count: 2
        data_type: int32
      - name: SMA_grid
        unique_id: SMA_grid
        slave: 3
        address: 30217
        scan_interval: 60
        #        count: 2
        data_type: uint32
      - name: SMA_Power_L1
        unique_id: SMA_Power_L1
        state_class: measurement
        device_class: power
        unit_of_measurement: W
        slave: 3
        address: 30777
        scan_interval: 120
        #        count: 2
        data_type: int32

This is my config in configurations, it worked very well up to core 2024.4.4 What do I need to change to get this running again.

Like you, I’m only using MODBUS in the configuration.yaml, never tried the integration.
This is my Modbus configuration

- name: sma
  type: tcp
  host: 192.168.178.100
  port: 502
  sensors:
    - name: SMA_Power_AC
      unique_id: SMA_Power_AC
      state_class: measurement
      device_class: "power"
      unit_of_measurement: W
      slave: 3
      address: 30775
      data_type: int32
      min_value: 0
    - name: SMA_Power_Day
      unique_id: SMA_Power_Day
      state_class: total
      device_class: "energy"
      unit_of_measurement: Wh
      slave: 3
      address: 30517
      data_type: uint64
      min_value: 0

Only noticable differences I see: datatypes are different, I don’t use scan_interval, default is then every 30 seconds.
Hope this helps.

I tried without the Scan_intervals but it did not fix the issue. I have some uint32 and uint64 too but, changing them did not fix the problem either.
Thank you for answering, I hope there is another way to get this solved?

My only guess is that there is a problem with one of the items and therefore modbus configuration is failing.

I would try with a new configuration, start with one item first and see if that works. Then continue with one item per try, maybe in this way you could find and solve the problem.

I can get modbus over TCP working for a few days to weeks, but then it disappears from HA. It’s still online according to my router, just not getting modbus data.
Restarting things makes no difference.
I can get in fine through Sunny Explorer, and changing the port brings it back again…

- name: "sma"
  type: tcp
  host: 192.168.11.29
  port: 5025
  message_wait_milliseconds: 500
  sensors:
    - name: "SMA Energy Total"
      slave: 3
      data_type: uint64
      address: 30513
      scan_interval: 10
      unit_of_measurement: "Wh"
      state_class: 'total'
      device_class: 'energy'
    - name: "SMA Energy Today"
      slave: 3
      data_type: uint64
      address: 30517
      scan_interval: 10
      unit_of_measurement: "Wh"
    - name: "SMA_Power_AC"
      slave: 3
      data_type: int32
      address: 30775
      scan_interval: 10

Hello,
Are you sure that your port is right?
This is my configuration, and it runs for months now

 - name: 'sma'
   type: tcp
   host: 192.168.1.36      # ip nummer omvormer
   port: 502
   delay: 5
   timeout: 5
   sensors:
    - name: "MB_sma_aanpasbaarvermogen"
      data_type: int32
      device_class: 'power'
      unit_of_measurement: W
      slave: 3
      address: 40915
    - name: "MB_active_power"
      data_type: int32
      device_class: 'power'
      unit_of_measurement: W
      slave: 3
      address: 30231
    - name: "MB_sma_status"
      data_type: int32
      slave: 3
      address: 30201
    - name: "MB_sma_power"
      data_type: int32
      device_class: 'power'
      unit_of_measurement: W
      slave: 3
      address: 30775
      scan_interval: 5