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
325 stars 83 forks source link

Add support to set the min / max SoC #9

Closed mkaiser closed 2 years ago

mkaiser commented 2 years ago

ToDo for me :)

mkaiser commented 2 years ago

will release soon. Here for the impatient...

just copy the content of the file at the end of your modbus_sungrow.yaml

This creates two new input sliders.

open issue: After writing a new min / max value, the current min / max SoC values are only updated in the next modbus update cycle (aka scan interval), which is currently set to 60seconds

*edit: deleted attachment, see below...

lindehoff commented 2 years ago

Hi, Shouldn't the holding register address for max Soc be 13058 and 13059 for min Soc? 13057 seams to be Battery capacity.

mkaiser commented 2 years ago

that a very nice modbus "feature". I am not sure if it is the home assistant modbus integration or the modbus spec.

Every Register in Sungrows specification needs to be decremented by one.

This is the same for the iobroker plugin

lindehoff commented 2 years ago

Ok, nice "feature" I did not know that 🙇

lindehoff commented 2 years ago

We could also add sensors for these, like so


      - name: Battery Min. SOC
        slave: !secret sungrow_modbus_slave
        address: 13058
        input_type: holding
        count: 1
        scan_interval: 600
        data_type: uint16
        swap: word
        precision: 0
        unit_of_measurement: "%"
        state_class: measurement
        scale: 0.1

      - name: Battery Max. SOC
        slave: !secret sungrow_modbus_slave
        address: 13057
        input_type: holding
        count: 1
        scan_interval: 600
        data_type: uint16
        swap: word
        precision: 0
        unit_of_measurement: "%"
        state_class: measurement
        scale: 0.1

right?

mkaiser commented 2 years ago

oh, I kind of already have this lines in my version, but left it out copying to the file above.... I hope I did not cause you much debugging

attached is my current state, which includes the holding registers you meantioned. I will work on your other requests for setting the EMS. If that worls I will do a proper commit with all modifications merged

modbus_sungrow.yaml.txt

lindehoff commented 2 years ago

Great, thanks a lot. 👍

mkaiser commented 2 years ago

committed here: https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/tree/testing

will push in to main branch, if someone can confirm it to be working.

Please leave feedback in this issue: https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/issues/11