bohdan-s / SunGather

GNU General Public License v3.0
141 stars 57 forks source link

Possibility of support for additional battery devices and their modbus registers? #175

Open paulhomes opened 2 months ago

paulhomes commented 2 months ago

Creating this issue as per suggestion from @bohdan-s in Discord conversation https://discord.com/channels/936031869001158666/1148822763780460564/1225730715090423858 to capture the Home Assistant modbus yaml config fragment I am using to get more information from my SBR battery stacks (including module level data such as per-module min/max cell voltages).

sungrow_modbus_battery_fragment.yaml.txt

I originally found this yaml in the discussion at https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/discussions/133 and made a few tweaks to get it working with my 2 battery stacks.

Does Sungather support getting modbus data from other devices on other slave/device ids? I use Sungather on my SH10RT inverter on slave/device id 1, as well as Home Assistant direct modbus reading device id 1 for the inverter, 200 for the first battery stack and 201 for the second battery stack. I'll keep using direct modbus with HA for now but I imagine other Sungather users with SBR battery stacks might find it useful if their battery device data was also available via Sungather.

I seem to remember I needed to upgrade the battery firmware from SBRBCU-S_22011.01.11 to SBRBCU-S_22011.01.19 before I was able to access the battery modbus registers on device id 200. I also use the dedicated LAN port on my SH10RT for HA modbus reading. I am not sure if the battery registers are available via the WiNet-S dongle.

vetinari commented 1 month ago

I am not sure if the battery registers are available via the WiNet-S dongle.

At least I can read the battery serial and firmware (SBRBCU-S_22011.01.17) and some more values through an SH5.0RT, device id 2 via the dongle...

vetinari commented 1 month ago
battery_temperature => 15.700000 °C
total_battery_discharge => 154.700000 kWh
battery_serial => S230221XXXX
battery_firmware => SBRBCU-S_22011.01.17
battery_voltage => 329.600000 V
battery_current => 0.400000 A
battery_soc => 39.100000 %
total_battery_charge => 227.200000 kWh
battery_soh => 100.000000 %

seems to work, missing values (compared to your HA config) are all 0

kalaws commented 1 month ago

Did you somehow integrate this with Sungather, or by forking? Or using mkaiser's integration in addition?

vetinari commented 1 month ago

@kalaws If you're talking me: I have my own private version in go (a rewrite of sungather).

paulhomes commented 1 month ago

@kalaws In my case, whilst I started with sungather and still have an instance running, these days I mostly use a slightly modified mkaiser HA modbus config primarily for battery charge/discharge control based on wholesale electricity prices. I also look at the individual battery module and stack data because I am troubleshooting reduced capacity due to unbalanced stacks and unbalanced modules within a stack which I am trying to resolve with Sungrow.

paulhomes commented 1 month ago

The battery module level data allows me to see voltage charts in HA like this max one when the stacks get full:

2024-05-19-sungrow-battery-max-voltages-chart

and this min one when the stacks are empty:

2024-05-19-sungrow-battery-min-voltages-chart