Sungrow-SHx-Inverter-Modbus-Home-Assistant icon indicating copy to clipboard operation
Sungrow-SHx-Inverter-Modbus-Home-Assistant copied to clipboard

Meter voltage

Open kalaws opened this issue 1 year ago • 10 comments

Through the Local access function one can see volt and ampere for each phase being reported at the point of the smart meter. Might these values be available in the modbus register? I have a SH10RT myself.

1D55FA4E-A171-4F63-ABA5-7B9EEC0DE8AF_1_105_c

kalaws avatar Oct 17 '23 11:10 kalaws

Was really happy to find some registers here: https://www.photovoltaikforum.com/thread/166134-daten-lesen-vom-sungrow-wechselrichtern-modbus/?postID=3324464#post3324464

... but it does not work as expected :/

image

I don't have much time to debug... Can someone try it and give me a feedback, what the readback values are and additionally what happens, if the grid is off?

I assume that template sensors similar to "Meter active power raw" are needed. But I have no backup stuff here :)

add to the sensors section

      # https://www.photovoltaikforum.com/thread/166134-daten-lesen-vom-sungrow-wechselrichtern-modbus/?postID=3324464#post3324464
     
      # https://www.photovoltaikforum.com/thread/166134-daten-lesen-vom-sungrow-wechselrichtern-modbus/?postID=3324464#post3324464
      - name: Meter voltage phase A
        unique_id: sg_meter_voltage_phase_a
        device_address: !secret sungrow_modbus_slave
        address: 5742 # reg 5741
        input_type: input
        data_type: int16
        precision: 0
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Meter voltage phase B
        unique_id: sg_meter_voltage_phase_b
        device_address: !secret sungrow_modbus_slave
        address: 5743 # reg 5742
        input_type: input
        data_type: int16
        precision: 0
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Meter voltage phase C
        unique_id: sg_meter_voltage_phase_c
        device_address: !secret sungrow_modbus_slave
        address: 5744 # reg 5743
        input_type: input
        data_type: int16
        precision: 0
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Meter current phase A
        unique_id: sg_meter_current_phase_a
        device_address: !secret sungrow_modbus_slave
        address: 5745 # reg 5744
        input_type: input
        data_type: int16
        precision: 0
        unit_of_measurement: A
        device_class: current
        state_class: measurement
        scale: 0.01
        scan_interval: 10

      - name: Meter current phase B
        unique_id: sg_meter_current_phase_b
        device_address: !secret sungrow_modbus_slave
        address: 5746 # reg 5745
        input_type: input
        data_type: int16
        precision: 0
        unit_of_measurement: A
        device_class: current
        state_class: measurement
        scale: 0.01
        scan_interval: 10

      - name: Meter current phase C
        unique_id: sg_meter_current_phase_c
        device_address: !secret sungrow_modbus_slave
        address: 5747 # reg 5746
        input_type: input
        data_type: int16
        precision: 0
        unit_of_measurement: A
        device_class: current
        state_class: measurement
        scale: 0.01
        scan_interval: 10


mkaiser avatar Nov 04 '23 22:11 mkaiser

All I get is "unavailable". But then I'm using WiNet. "Meter phase A active power" etc work however.

kalaws avatar Nov 05 '23 11:11 kalaws

Maybe the newly added registers in documentation depends on a newer firmware from SunGrow?

dylan09 avatar Nov 05 '23 16:11 dylan09

These registers are currently not documented, so it is more guessing :)

However I was able so get some more reasonable data. But they still don't add up very well, because the current values are not signed. So you don't know if "phase x" is importing or exporting power

Importing ~800W image

almost no im/export (battery charging) image

Exporting power (set to forced discharge battery) image

      - name: Meter voltage phase A
        unique_id: sg_meter_voltage_phase_a
        device_address: !secret sungrow_modbus_slave
        address: 5740 # reg 5741
        input_type: input
        data_type: int16
        precision: 1
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Meter voltage phase B
        unique_id: sg_meter_voltage_phase_b
        device_address: !secret sungrow_modbus_slave
        address: 5741 # reg 5742
        input_type: input
        data_type: int16
        precision: 1
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Meter voltage phase C
        unique_id: sg_meter_voltage_phase_c
        device_address: !secret sungrow_modbus_slave
        address: 5742 # reg 5743
        input_type: input
        data_type: int16
        precision: 1
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        scale: 0.1
        scan_interval: 10

      - name: Meter current phase A
        unique_id: sg_meter_current_phase_a
        device_address: !secret sungrow_modbus_slave
        address: 5743 # reg 5744
        input_type: input
        data_type: int16
        precision: 0
        unit_of_measurement: A
        device_class: current
        state_class: measurement
        scale: 0.01
        scan_interval: 10

      - name: Meter current phase B
        unique_id: sg_meter_current_phase_b
        device_address: !secret sungrow_modbus_slave
        address: 5744 # reg 5745
        input_type: input
        data_type: int16
        precision: 0
        unit_of_measurement: A
        device_class: current
        state_class: measurement
        scale: 0.01
        scan_interval: 10

      - name: Meter current phase C
        unique_id: sg_meter_current_phase_c
        device_address: !secret sungrow_modbus_slave
        address: 5745 # reg 5746
        input_type: input
        data_type: int16
        precision: 0
        unit_of_measurement: A
        device_class: current
        state_class: measurement
        scale: 0.01
        scan_interval: 10

mkaiser avatar Nov 06 '23 11:11 mkaiser

hmm just thinking out loud here:

We could take the sign of phase x active power and split up the unsigned phase x current into two template sensors: phase x import current and phase x export current

Any thoughts?

mkaiser avatar Nov 06 '23 14:11 mkaiser

One other thing on the availability of these sensors, I cannot test

if the power from the grid is down, the sensor Meter active power returned 7FFF FFFF, so a template sensor took this into account

        unique_id: sg_meter_active_power
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        availability: >-
          {{ 
          not is_state('sensor.meter_active_power_raw', 'unavailable')
          and states('sensor.meter_active_power_raw')|int != 0x7FFFFFFF
          }}
        state: "{{ states('sensor.meter_active_power_raw') }}"

Can someone test, what happens to the phase x current and voltage values?

mkaiser avatar Nov 06 '23 14:11 mkaiser

Maybe the newly added registers in documentation depends on a newer firmware from SunGrow?

Just updated to the latest firmware. No difference, unfortunately. I find it very, very strange that meter active powerworks over WiNet-S, but not meter current or meter voltage! Such an odd implementation.

kalaws avatar Nov 19 '23 12:11 kalaws

Can someone test, what happens to the phase x current and voltage values?

Maybe I could implement the changes to registers and test what happened in case of grid blackout.

dylan09 avatar Nov 19 '23 13:11 dylan09

I did some tests today. Switched off mains and forced inverter to off-grid mode.

All 6 new sensors showed valid values during my test. So there seems to be no need for template sensors.

dylan09 avatar Nov 22 '23 17:11 dylan09

I did some tests today. Switched off mains and forced inverter to off-grid mode.

All 6 new sensors showed valid values during my test. So there seems to be no need for template sensors.

great, thank your for testing!

so this is my last open concern:

We could take the sign of phase x active power and split up the unsigned phase x current into two template sensors: phase x import current and phase x export current

mkaiser avatar Dec 01 '23 21:12 mkaiser

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 20 '24 00:10 github-actions[bot]