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
342 stars 92 forks source link

SH10RT with 14.2KWh Pylontech #235

Closed mega-hz closed 8 months ago

mega-hz commented 8 months ago

Hello,

my PV works good wit SH10RT/Pylontec HA(newest) and your Modbus Integration.

I installed another PV System at Neighbore, also same Inverter/Battery and also a PI with HA(newest) and your Integration. First it was running well for a few months, now there is a change from TDSL to Starlink and there is a additionel Fritzbox for the home Lan. Only Difference is now: Inverter has 192.168.1.3 PI has 192.168.1.5 and the Pylontec WAS 192.168.1.4, now the Fritzbox made a new IP for the Pylontech, 192.168.1.34 ! I cant change the IP of the Pylontec (or i forgot how to set this up) Do you have an Idea how to setup the IP? In the secrets.yaml is the right ip of the inverter. The inverter doesnt show those binary sensors, Charge/discharge is always 0 The meter_active_power is not available.

The system is working, only homeassistant doesn't get all datas...

Even this is not an issue directly with your integration, could you please help me?

Thanx, Wolfram.

mega-hz commented 8 months ago

I am sorry, i didnt mean the pylontech ip But the modbus-tcp ip of the sungrow...

mega-hz commented 8 months ago

I could solve this now! I just changed the IP in secrets to the new IP Adress and everything is back and works!

I found some not so nice things you should change at next update:

1: Inverter Temp has a strange caracter A close to the degree sign!

  1. Battery Temp has a strange caracter A close to the degree sign!
  2. Max Charge power slider is limited to 5000W, change it to 10000.
  3. Max Discharge power slider is limited to 5000W, change it to 10000.

Thank you, Wolfram.

changed File: `# Home Assistant Sungrow inverter integration

https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant

by Martin Kaiser

last update: 2023-12-31

15.01.2024 mega-hz

#

Note: This YAML file will only work with Home Assistant >= 2023.10

modbus:

'virtual' template sensors for better readability

template:

getting input for Min and Max SoC

input_number: set_sg_min_soc: name: Set min SoC min: 0 max: 50 step: 1

set_sg_max_soc: name: Set max SoC min: 50 max: 100 step: 1

set_sg_reserved_soc_for_backup: name: Set reserved SoC for backup min: 0 max: 100 step: 1

set_sg_forced_charge_discharge_power: name: Set forced charge discharge power in W min: 0 max: 10000 # change this value according to the capability of your battery step: 100

set_sg_battery_max_charge_power: name: Set max battery charge power in W min: 100 max: 10000 # change this value according to the capability of your battery step: 100

set_sg_battery_max_discharge_power: name: Set max battery discharge power in W min: 100 max: 10000 # change this value according to the capability of your battery step: 100

set_sg_battery_charging_start_power: name: Set battery charging start power in W min: 0 max: 1000 step: 10

set_sg_battery_discharging_start_power: name: Set battery discharging start power in W min: 0 max: 1000 step: 10

set_sg_export_power_limit: name: Set export power limit min: 0 max: 10000 # Note: max for SH10.RT. It would be ncie to have this as a global variable /secret step: 100

input_select: set_sg_inverter_run_mode: name: Inverter mode options:

Automations: Write modbus registers on input changes via GUI

note: If you change a value by the sliders, it will take up to 60 seconds until the state variables are updated

Unfortunately, I could not find a way to "force update" modbus registers, yet...

automation:

Usage: Use these scripts to simplify automations

Example (Adjust to your needs with appropriate trigger):

automation:

- alias: Forced Battery Charging Management

description: "Manages forced battery charging during cheapest hours."

trigger:

- platform: state

entity_id:

- binary_sensor.cheapest_hours_for_charging_timer

action:

- choose:

- conditions:

- condition: state

entity_id: binary_sensor.cheapest_hours_for_charging_timer

state: 'on'

sequence:

- service: script.sg_forced_charge_battery_mode

- conditions:

- condition: state

entity_id: binary_sensor.cheapest_hours_for_charging_timer

state: 'off'

sequence:

- service: script.sg_self_consumption_mode

script: sg_set_forced_discharge_battery_mode: sequence: