Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meter voltage #185

Open
kalaws opened this issue Oct 17, 2023 · 10 comments
Open

Meter voltage #185

kalaws opened this issue Oct 17, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@kalaws
Copy link

kalaws commented Oct 17, 2023

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

@mkaiser mkaiser added the enhancement New feature or request label Oct 23, 2023
@mkaiser
Copy link
Owner

mkaiser commented Nov 4, 2023

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


@kalaws
Copy link
Author

kalaws commented Nov 5, 2023

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

@dylan09
Copy link
Contributor

dylan09 commented Nov 5, 2023

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

@mkaiser
Copy link
Owner

mkaiser commented Nov 6, 2023

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
Copy link
Owner

mkaiser commented Nov 6, 2023

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
Copy link
Owner

mkaiser commented Nov 6, 2023

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?

@kalaws
Copy link
Author

kalaws commented Nov 19, 2023

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.

@dylan09
Copy link
Contributor

dylan09 commented Nov 19, 2023

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
Copy link
Contributor

dylan09 commented Nov 22, 2023

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.

@mkaiser
Copy link
Owner

mkaiser commented Dec 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants