SunGrow Inverters

Is anyone aware of a plugin/intergration for sungrow inverters? I am looking at one of these or the Fronius.

Thanks!

I’ve been using https://github.com/meltaxa/solariot
Took a bit to set up, and still need to work out how to have it auto starting on hassio instead of using the telnet/ssh plugin to get it going. But it does the trick.

Sungrow inverter

I havent been able to get SolarIOT going since the inverter firmware upgrade - I should try again

I decided to go with; https://www.home-assistant.io/integrations/fronius/ in the end

Yea should have gone for a fronius as well

1 Like

There seems to be an increasing demand for Sungrow integration as it’s also one of the last major brands to be supported, especially now that SolarIOT etc has broken the encryption. Is someone perhaps able to make a HAC integration perhaps? The new Energy integration in HA would be fantastic to get working!

I wasn’t able to make fronius work with SunGrow, the Device I have is: SG6K-D.
Is there any tutorial or can anyone share an example of the config they have?

Thanks!

That’s not compatible. I think the OT went for a different inverter manufacturer, not a different integration for Sungrow inverters.

I’ve manged to get meltaxa/solariot working and can publish the data to MQTT or influxdb. Anyone successful in getting the data into the native Energy section of Home Assistant? If so, can you share how?

Thanks!

I’m using this which is based on SolarIoT (needs HA Supervised + MQTT) - creates sensors automatically that directly plug in to the energy dashboard

2 Likes

What I ended up doing is buying the Emporia Vue (I wanted this for a while), for energy monitoring on all my home circuits. Works like a charm and took a couple of minutes only to install, setup and see it in action.

This is awesome. I have been searching for a way to get info out of my Sungrow inverter (SG8K-D) and this looks to be working. Sorry if this is a newbie question, but how do I see the info that the ModbusTCP2MQTT extracts. I can see it getting info from the inverter in the log, but how do I add that to a dashboard??

hi,

I am new to Home Assistant and created my .yaml Modbus integration for my Sungrow SGH10.RT. Most of the stuff works now, after I asked the support to send me a modbus register map (which they really did after 3 days yeah).
In the datasheet there are some differences between sungrow models. But most of the registers are the same, so it should also work with SG* models

btw. I don’t know yet, where I should paste code like this in this forum. This is why I hijack this thread, as it was the only thread the search function returned searching for “sungrow”

So here is my current code. Feel free to ask / criticize :slight_smile:

modbus:
  - name: SungrowSH10      adapt this!
    type: tcp
    host: 192.168.178.20   adapt this!  
    port: 502              adapt this!
    # retry_on_empty : true
    # retries: 10
    # close_comm_on_error: true
    #delay: 5
    #timeout: 5
    sensors:
      - name: Daily PV generation & battery discharge
        slave: 100          adapt this and following slave addresses!
        address: 5002
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 10

      - name: Total PV generation & battery discharge
        slave: 100
        address: 5003
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        unit_of_measurement: kWh
        precision: 1
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 10

      - name: Inverter temperature
        slave: 100
        address: 5007
        input_type: input
        count: 1
        data_type: int16
        precision: 1
        unit_of_measurement: °C
        device_class: Temperature
        scale: 0.1
        scan_interval: 10

      - name: MPPT1 voltage
        slave: 100
        address: 5010
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: V
        device_class: Voltage
        scale: 0.1
        scan_interval: 10

      - name: MPPT1 current
        slave: 100
        address: 5011
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 2
        unit_of_measurement: A
        device_class: Current
        scale: 0.1
        scan_interval: 10

      - name: MPPT2 voltage
        slave: 100
        address: 5012
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: V
        device_class: Voltage
        scale: 0.1
        scan_interval: 10

      - name: MPPT2 current
        slave: 100
        address: 5013
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 2
        unit_of_measurement: A
        device_class: Current
        scale: 0.1
        scan_interval: 10

      - name: Total DC power
        slave: 100
        address: 5016
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Reactive power
        slave: 100
        address: 5032
        input_type: input
        count: 2
        data_type: int32
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Power factor
        slave: 100
        address: 5034
        input_type: input
        count: 1
        data_type: int16
        swap: word
        precision: 3
        unit_of_measurement: "%"
        device_class: power_factor
        state_class: measurement
        scale: 0.001
        scan_interval: 10

      - name: System state
        slave: 100
        address: 12999
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        scale: 1
        scan_interval: 10

      - name: Running state
        slave: 100
        address: 13000
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        scale: 1
        scan_interval: 10

      - name: Daily PV generation
        slave: 100
        address: 13001
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Total PV generation
        slave: 100
        address: 13002
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 10

      - name: Daily exported energy from PV
        slave: 100
        address: 13004
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Total exported energy from PV
        slave: 100
        address: 13005
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 10

      - name: Load power
        slave: 100
        address: 13007
        input_type: input
        count: 2
        data_type: int32
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Export power
        slave: 100
        address: 13009
        input_type: input
        count: 2
        data_type: int32
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Daily battery charge from PV
        slave: 100
        address: 13011
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Total battery charge from PV
        slave: 100
        address: 13012
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 10

      - name: Daily direct energy consumption
        slave: 100
        address: 13016
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Total direct energy consumption
        slave: 100
        address: 13017
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 10

      - name: Battery voltage
        slave: 100
        address: 13019
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 0
        unit_of_measurement: V
        device_class: Voltage
        scale: 0.1
        scan_interval: 10

      - name: Battery current
        slave: 100
        address: 13020
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: A
        device_class: Current
        scale: 0.1
        scan_interval: 10

      - name: Battery power
        slave: 100
        address: 13021
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Battery level
        slave: 100
        address: 13022
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: "%"
        device_class: battery
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Battery state of health
        slave: 100
        address: 13023
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: "%"
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Battery temperature
        slave: 100
        address: 13024
        input_type: input
        count: 1
        data_type: int16
        precision: 1
        unit_of_measurement: °C
        device_class: Temperature
        scale: 0.1
        scan_interval: 10

      - name: Daily battery discharge
        slave: 100
        address: 13025
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Total battery discharge
        slave: 100
        address: 13026
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 10

      - name: Grid state
        slave: 100
        address: 13029
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        scale: 0.1
        scan_interval: 10

      - name: Total active power
        slave: 100
        address: 13033
        input_type: input
        count: 2
        data_type: int32
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Daily imported energy
        slave: 100
        address: 13035
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Total imported energy
        slave: 100
        address: 13036
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 10

      - name: Daily battery charge
        slave: 100
        address: 13039
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Total battery charge
        slave: 100
        address: 13040
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 10

      - name: Daily exported energy
        slave: 100
        address: 13044
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Total exported energy
        slave: 100
        address: 13045
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 10

      - name: Charge discharge power
        slave: 100
        address: 13051
        input_type: input
        count: 1
        data_type: int16
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Battery current
        slave: 100
        address: 13108
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        unit_of_measurement: A
        device_class: Current
        precision: 0
        scale: 1
        scan_interval: 10

      - name: Battery voltage
        slave: 100
        address: 13109
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        unit_of_measurement: V
        device_class: Voltage
        precision: 0
        scale: 1
        scan_interval: 10

binary_sensor:
  - platform: template
    sensors:
      battery_charging:
        friendly_name: "Battery charging"
        value_template: "{{ states('sensor.running_state')|int|bitwise_and(1) > 0 }}"
      battery_discharging:
        friendly_name: "Battery discharging"
        value_template: "{{ states('sensor.running_state')|int|bitwise_and(2) > 0 }}"
      exporting_power:
        friendly_name: "Exporting power"
        value_template: "{{ states('sensor.running_state')|int|bitwise_and(4) > 0 }}"
      importing_power:
        friendly_name: "Importing power"
        value_template: "{{ states('sensor.running_state')|int|bitwise_and(5) > 0 }}"

minor fixes… Should I open a new thread for this? (When yes: in the “3rd Party integration” section?)

modbus:
  - name: SungrowSH10
    type: tcp
    host: 192.168.178.20
    port: 502
    # retry_on_empty : true
    # retries: 10
    # close_comm_on_error: true
    #delay: 5
    #timeout: 5
    sensors:
      - name: Daily PV generation & battery discharge
        slave: 100
        address: 5002
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 600

      - name: Total PV generation & battery discharge
        slave: 100
        address: 5003
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        unit_of_measurement: kWh
        precision: 1
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 600

      - name: Inverter temperature
        slave: 100
        address: 5007
        input_type: input
        count: 1
        data_type: int16
        precision: 1
        unit_of_measurement: °C
        device_class: Temperature
        scale: 0.1
        scan_interval: 10

      - name: MPPT1 voltage
        slave: 100
        address: 5010
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: V
        device_class: Voltage
        scale: 0.1
        scan_interval: 10

      - name: MPPT1 current
        slave: 100
        address: 5011
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 2
        unit_of_measurement: A
        device_class: Current
        scale: 0.1
        scan_interval: 10

      - name: MPPT2 voltage
        slave: 100
        address: 5012
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: V
        device_class: Voltage
        scale: 0.1
        scan_interval: 10

      - name: MPPT2 current
        slave: 100
        address: 5013
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 2
        unit_of_measurement: A
        device_class: Current
        scale: 0.1
        scan_interval: 10

      - name: Total DC power
        slave: 100
        address: 5016
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Reactive power
        slave: 100
        address: 5032
        input_type: input
        count: 2
        data_type: int32
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Power factor
        slave: 100
        address: 5034
        input_type: input
        count: 1
        data_type: int16
        swap: word
        precision: 3
        unit_of_measurement: "%"
        device_class: power_factor
        state_class: measurement
        scale: 0.001
        scan_interval: 10

      - name: System state
        slave: 100
        address: 12999
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 0
        scale: 1
        scan_interval: 10

      - name: Running state
        slave: 100
        address: 13000
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 0
        scale: 1
        scan_interval: 10

      - name: Daily PV generation
        slave: 100
        address: 13001
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 600

      - name: Total PV generation
        slave: 100
        address: 13002
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 600

      - name: Daily exported energy from PV
        slave: 100
        address: 13004
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 600

      - name: Total exported energy from PV
        slave: 100
        address: 13005
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 600

      - name: Load power
        slave: 100
        address: 13007
        input_type: input
        count: 2
        data_type: int32
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Export power
        slave: 100
        address: 13009
        input_type: input
        count: 2
        data_type: int32
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Daily battery charge from PV
        slave: 100
        address: 13011
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 600

      - name: Total battery charge from PV
        slave: 100
        address: 13012
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 600

      - name: Daily direct energy consumption
        slave: 100
        address: 13016
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 600

      - name: Total direct energy consumption
        slave: 100
        address: 13017
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 600

      - name: Battery voltage
        slave: 100
        address: 13019
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 0
        unit_of_measurement: V
        device_class: Voltage
        scale: 0.1
        scan_interval: 10

      - name: Battery current
        slave: 100
        address: 13020
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: A
        device_class: Current
        scale: 0.1
        scan_interval: 10

      - name: Battery power
        slave: 100
        address: 13021
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Battery level
        slave: 100
        address: 13022
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: "%"
        device_class: battery
        state_class: measurement
        scale: 0.1
        scan_interval: 60

      - name: Battery state of health
        slave: 100
        address: 13023
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 0
        unit_of_measurement: "%"
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Battery temperature
        slave: 100
        address: 13024
        input_type: input
        count: 1
        data_type: int16
        precision: 1
        unit_of_measurement: °C
        device_class: Temperature
        scale: 0.1
        scan_interval: 60

      - name: Daily battery discharge
        slave: 100
        address: 13025
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 600

      - name: Total battery discharge
        slave: 100
        address: 13026
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 10

      - name: Grid state
        slave: 100
        address: 13029
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 0
        scale: 0.1
        scan_interval: 10

      - name: Total active power
        slave: 100
        address: 13033
        input_type: input
        count: 2
        data_type: int32
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Daily imported energy
        slave: 100
        address: 13035
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 600

      - name: Total imported energy
        slave: 100
        address: 13036
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 600

      - name: Daily battery charge
        slave: 100
        address: 13039
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 600

      - name: Total battery charge
        slave: 100
        address: 13040
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 600

      - name: Daily exported energy
        slave: 100
        address: 13044
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: measurement
        scale: 0.1
        scan_interval: 600

      - name: Total exported energy
        slave: 100
        address: 13045
        input_type: input
        count: 2
        data_type: uint32
        swap: word
        precision: 1
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        scale: 0.1
        scan_interval: 600

      - name: Charge discharge power
        slave: 100
        address: 13051
        input_type: input
        count: 1
        data_type: int16
        swap: word
        precision: 0
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        scale: 1
        scan_interval: 10

      - name: Battery current
        slave: 100
        address: 13108
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        unit_of_measurement: A
        device_class: Current
        precision: 0
        scale: 1
        scan_interval: 10

      - name: Battery voltage
        slave: 100
        address: 13109
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        unit_of_measurement: V
        device_class: Voltage
        precision: 0
        scale: 1
        scan_interval: 10

        ##defect
      - name: Battery cycle count
        slave: 100
        address: 13110
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        precision: 0
        scale: 1
        scan_interval: 600

      ##defect
      - name: Battery max cell voltage
        slave: 100
        address: 13112
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        unit_of_measurement: V
        device_class: Voltage
        precision: 0
        scale: 1
        scan_interval: 10

      ##defect
      - name: Battery min cell voltage
        slave: 100
        address: 13113
        input_type: input
        count: 1
        data_type: uint16
        swap: word
        unit_of_measurement: V
        device_class: Voltage
        precision: 0
        scale: 1
        scan_interval: 10

binary_sensor:
  - platform: template
    sensors:
      pv_generating:
        friendly_name: "PV generating"
        value_template: "{{ states('sensor.running_state')|int|bitwise_and(0x1) > 0 }}"
      battery_charging:
        friendly_name: "Battery charging"
        value_template: "{{ states('sensor.running_state')|int|bitwise_and(0x2) > 0 }}"
      battery_discharging:
        friendly_name: "Battery discharging"
        value_template: "{{ states('sensor.running_state')|int|bitwise_and(0x4) > 0 }}"
      exporting_power:
        friendly_name: "Exporting power"
        value_template: "{{ states('sensor.running_state')|int|bitwise_and(0x10) > 0 }}"
      importing_power:
        friendly_name: "Importing power"
        value_template: "{{ states('sensor.running_state')|int|bitwise_and(0x20) > 0 }}"

1 Like

Sorry mate, could you explain a but more? I was going to set up a separate Hassio to install GitHub - TenySmart/ModbusTCP2MQTT: Sungrow & SMA Solar Inverter addon for Home Assistant using mobusTCP on (as I have mine running on normal docker) but it seems you actually have got this working directly? I’ve got a SG5K with a V31 WiFi comm device.

Hi all,

Have have put together a solution for Sungrow Hybrid Inverters at the moment refer to the link below to see if your inverter is supported.

Those that are after the modbus register addresses (official) have uploaded the pdf for String & Hybrid inverters to the python module site which has been developed as part of this solution (SungrowInverter · PyPI).

You will be able to see what String Inverters can be supported once I’ve completed development, at that site. Let me know if this interests you, otherwise i wont bother as I don’t require it.

Please be aware if you use this at present there is a possibility sensor names will be changed, I’ll try limit that as much as possible though.

Let me know how you go. if you are unsure of installing custom integrations in into ~/config/custom_components then this solution may not be for you. I’ll see how time goes for a proper Hass.io solution as thats what i use these days as well, need to teach myself how that works though.

Cheers
Mark

2 Likes

Sounds good. When I move into my new house (7/12) I’ll have a go and update you :slight_smile:

I just created a github repro with my current work and started a new thread:

Then I saw mvandersteen 's work, which looks way better and probably makes my stuff more or less superseeded. :wink:

I hope to find some time the next days to check your custom component with my SH10.RT and look for something I can contribute.

~Martin

This looks great, @mvandersteen, thanks for your work. I have installed the component, but have an SG5K-D inverter (no battery) and it doesn’t sound like you’ve added support for this yet. I haven’t done much work on modbus etc in the past, but if there’s code you’d like me to test for this model, let me know.

@simon4 i’ll make the change to suite SGxx inverter soon seeing as there is a need.

@mkai I’ll check your solution as well there maybe something I’ve missed, I have noticed that all those inverters you have mentioned do support the same set of registers, some inverters (like mine SH5K) just don’t record anything to all of them, also I got a lot of fixing up to do yet. Any help or advise will be taken :slight_smile: