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

Some Entities are not available #249

Open kaschie2 opened 5 months ago

kaschie2 commented 5 months ago

Describe the bug:

Some Entities are not available

A clear and concise description of what the bug is.

Protokolldetails: (Error 1 from 5 with the same context)

TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ ( states('sensor.battery_capacity') | float states('sensor.battery_level_nominal') | float / 100 )| round(1) }}' but no default was specified') while processing template 'Template<template=({{ ( states('sensor.battery_capacity') | float states('sensor.battery_level_nominal') | float / 100 )| round(1) }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.battery_charge_nominal' Your Sungrow inverter:

Model: [SH-6.RT v112]

The inverter is connected via (mark one)

[x] LAN (internal port) [] 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: Core 2024.1.6 Supervisor 2023.12.1 Operating System 11.4 Frontend 20240104.0 modbus_sungrow.yaml:

Version/ time stamp : [e.g. 2023-12-31] [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:

Screenshots If applicable, add screenshots to help explain your problem. image

image image

What can i do to solve the Problem? Whitout "Load Power" ist is not useable for me.

I hope you have Ideas to help me.

Ciao Tilo

mkaiser commented 4 months ago

I guess the battery capacity is not set (yet).

It should be set by the installer via isolarcloud or by the App using the "local access". It is hidden somewhere in the menues...

After setting the capacity, it should work :)

kaschie2 commented 4 months ago

In Isolarcloud the Battery ist visible and Capacity configured.

mkaiser commented 4 months ago

Please paste following lines in "Developer tools" --> "TEMPLATE" and tell me the result:

{{ states('sensor.battery_capacity')}}
{{ states('sensor.battery_level_nominal')}}

{{ states('sensor.total_pv_generation')}}
{{ states('sensor.total_exported_energy')}}
{{ states('sensor.total_imported_energy')}}
{{ states('sensor.total_battery_charge')}}
{{ states('sensor.total_battery_discharge')}}
{{ states('sensor.total_consumed_energy')}}

{{ states('sensor.running_state')}}
{{ states('sensor.total_pv_generation')}}

{{ states('sensor.load_power')}}

It should be something like this: image

kaschie2 commented 4 months ago

grafik

mkaiser commented 4 months ago

hmm honestly no clue at the moment ...

What happens if you comment out the modbus registers in the yaml file which are mentioned in your log file?

5008 (Inverter temperature) and 5634 ( BMS max. charging current )

kaschie2 commented 4 months ago

Now the errors are not in Protocol but new Errors like Image 1 and Warnings like Image 2.

image 3 show one of the comment sensor.

grafik

grafik

grafik

mkaiser commented 4 months ago

hmm I guess there is something wrong with the communication pyModbus <> Inverter in general.

These occurred to me, when I used multiple software connecting to the inverter at the same time (and connection request got mixed up).

Is the HA instance at the moment the only software connecting to the inverter, or do you have something like EVCC running in parallel?

kaschie2 commented 4 months ago

Now i configured modbus Proxy and use this, but the same problem without the Problem that EVCC stoped Charging. This is now cleared with the Modbus Proxy.

but the Sungrow Problem is not solved :(

smartmatic commented 3 months ago

hmm I guess there is something wrong with the communication pyModbus <> Inverter in general.

These occurred to me, when I used multiple software connecting to the inverter at the same time (and connection request got mixed up).

Is the HA instance at the moment the only software connecting to the inverter, or do you have something like EVCC running in parallel?

I am running two HA instances Test and Prod. Is it a problem for Modbus / Sungrow Inverter to to request data from two different instances?

Louisbertelsmann commented 3 months ago

it is a problem, yes. For a scenario like that you might want to setup a modbus-proxy.