Before you create an issue, make sure to update to the current version of modbus_sungrow.yaml
Describe the bug:
There is an issue with the battery current sensor.
I think this is a signed integer, with one decimal point precision.
When the battery is discharging current is positive.
When the battery is charging the current should be negative.
What does happen is that the current is instead equal to battery_current - 6553.5
This only occurs on some hybrid sensors. SH6.0RS, SH10.0RS
I think this is because instead of having a signed 16 bit integer, they are using an unsigned 16 bit integer and are just using integer wraparound to transmit this information.
Given that no inverter will ever take a load of 3000 amps, I think you could correct for this without affecting other inverters with something like this. I cant work out how to apply it directly to the modbus sensor, or if it can only be done via a template.
In any case, it's working for me now!
- name: Battery Current Signed # on SHxx.0RS inverters Sungrow uses an unsigned 16-bit integer to represent current, negative current wraps around below zero
unit_of_measurement: "A"
device_class: current
unique_id: sensor.battery_current_signed
state_class: measurement
availability: "{{states('sensor.battery_current')|is_number }}"
state: >-
{% set positive = states('sensor.battery_current') | float %}
{% set negative = states('sensor.battery_current') | float - 6553.5 %}
{% if positive > 3000 %}
{{ negative }}
{% else %}
{{ positive }}
{% endif %}
Your Sungrow inverter:
Model: [SH6.0RS]
The inverter is connected via (mark one)
[] LAN (internal port)
[x] WiNet-S (LAN)
[] WiNet-S (WLAN)
Are you using a Modbus Proxy (mark one)
[] yes
[x] no
[] I don't know what that is
Home Assistant version:
Version: [e.g. 2024.5.5]
modbus_sungrow.yaml:
Version/ time stamp : [2024-04-05] (see header of the file)
[x] I ensured to use the most recent version
Inverter Firmware Status:
[x] I made sure that the newest firmware is installed via the installers account
To Reproduce
Steps to reproduce the behavior:
look at sensor.battery_current
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
SH6.0RS
SH10.0RS:
Additional context
Add any other context about the problem here.
Before you create an issue, make sure to update to the current version of modbus_sungrow.yaml
Describe the bug:
There is an issue with the battery current sensor. I think this is a signed integer, with one decimal point precision.
When the battery is discharging current is positive. When the battery is charging the current should be negative. What does happen is that the current is instead equal to
battery_current - 6553.5
This only occurs on some hybrid sensors. SH6.0RS, SH10.0RS
I think this is because instead of having a signed 16 bit integer, they are using an unsigned 16 bit integer and are just using integer wraparound to transmit this information.
Given that no inverter will ever take a load of 3000 amps, I think you could correct for this without affecting other inverters with something like this. I cant work out how to apply it directly to the modbus sensor, or if it can only be done via a template. In any case, it's working for me now!
Your Sungrow inverter:
Home Assistant version:
modbus_sungrow.yaml:
Inverter Firmware Status:
To Reproduce Steps to reproduce the behavior: look at sensor.battery_current
Expected behavior A clear and concise description of what you expected to happen.
Screenshots SH6.0RS SH10.0RS:
Additional context Add any other context about the problem here.