mkaiser / Sungrow-SHx-Inverter-Modbus-Home-Assistant

Sungrow SH Integration for Home Assistant for SH3K6, SH4K6, SH5K-20, SH5K-V13, SH3K6-30, SH4K6-30, SH5K-30, SH3.RS, SH3.6RS, SH4.0RS, SH5.0RS, SH6.0RS, SH5.0RT, SH6.0RT, SH8.0RT, SH10RT, SH5.0RT-20, SH6.0RT-20, SH8.0RT-20, SH10RT-20, SH5.0RT-V112, SH6.0RT-V112, SH8.0RT-V112, SH10RT-V112, SH5.0RT-V122, SH6.0RT-V122, SH8.0RT-V122, SH10RT-V122, SH4.6R
304 stars 79 forks source link

Battery Capacity is "0.00kWh" #236

Open mathiasolofsson87 opened 5 months ago

mathiasolofsson87 commented 5 months ago

Before you create an issue, make sure to update to the current version of modbus_sungrow.yaml

Describe the bug:

Value for battery capacity is not existing in HA(battery_capacity).

Screenshot 2024-01-16 at 14 33 19

In my Sungrow Plant Configuration on the iSolarapp the battery capacity is shown as 9.6kWh.

I have a SH6.0RT-V112 inverter with a 9.6kWh sungrow battery.

Your Sungrow inverter:

Home Assistant version:

modbus_sungrow.yaml:

Inverter Firmware Status:

liquidblack commented 5 months ago

Almost identical for me with a SH10RT v112. Fully patched. What is the register that the capacity is read from?

liquidblack commented 5 months ago

Reference to https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/issues/184#issuecomment-1807053291 I found and tested that the capacity can be found in input register 13038 - the following works after a restart of home assistant

        - name: Battery capacity
        unique_id: sg_battery_capacity
        slave: !secret sungrow_modbus_slave
        address: 13038 
        input_type: input 
        data_type: uint16
        unit_of_measurement: kWh
        device_class: energy
        scale: 0.1
        scan_interval: 10

I've never made a PR before but would love to contribute if possible :)

mathiasolofsson commented 5 months ago

Unfortunately 13038 was not the adress for my battery_capacity on my inverter.

Also my battery_capacity info in the modbus_sungrow.yaml has input_type: "holding", not "input"

mastameista commented 5 months ago

@mathiasolofsson, @liquidblack you can set the capacity in iSolarCloud. There are two settings and under plant configuration is not enough. you have to set it in advanced settings too. For this you nid an installer account on your plant. HowTo: https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/issues/88#issuecomment-1646586986

btota commented 5 months ago

@liquidblack works perfect with SH10RT-V11.2, thx! @ll with setting up on ISC, I had an issue, which had an impact on my max_charge/discharge_power, I wasn´t able to charge/discharge more than 5 kW from battery. So I had to reset back to NULL on ISC. Also the work of @alex&@alan https://github.com/AlexanderLanin/homeassistant-sungrow showed me that capacity is working with HA. @mkaiser @liquidblack PR would be great!

liquidblack commented 5 months ago

@mathiasolofsson, @liquidblack you can set the capacity in iSolarCloud. There are two settings and under plant configuration is not enough. you have to set it in advanced settings too. For this you nid an installer account on your plant. HowTo: #88 (comment)

Thanks @mathiasolofsson - it was a bit of dance to get the account set up - for anyone else reading this I needed to added a separate account, create the account, remove the share, re-add the share and then it showed up. I'll do some testing to see if the information shows up on the battery.

My open question then becomes - which value should be used if the system "knows" that it's a 9.6kWh battery but I have to set it in another place (to whatever I like) - shouldn't the inbuilt value be the one that's used?

mastameista commented 3 months ago

@liquidblack, sry don't know. The deteced value is under "plant configuration" which might not be available over modbus? or do you own a SH10RT-V112 and get this value by reading input register 13038?

gsteger81 commented 2 weeks ago

Hello,

I had the same issue, Battery capacity showed 0 in Dashboard. Setting the right Value in iSolarcloud with installer account like @mastameista suggested worked.

@mathiasolofsson, @liquidblack you can set the capacity in iSolarCloud. There are two settings and under plant configuration is not enough. you have to set it in advanced settings too. For this you nid an installer account on your plant. HowTo: #88 (comment)