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

Scan interval changes on HA 2023.7 #128

Closed ajbatchelor closed 1 year ago

ajbatchelor commented 1 year ago

I updated to 2023.7 and the scan interval on the entities created by this (amazing) integration change from their default to only updating every 20 minutes.

For example in the attached screen, the 'load power' entity has scan interval on 10 seconds set in config.yaml, this has been working as it should. Then when I update to 2023.7 it extends out to only updating every 20 mins.

I rolled back to 2023.6 and everything works again. I can't find anyone else reporting this issue.

Screenshot 2023-07-14 at 9 44 21 pm
mkaiser commented 1 year ago

hi,

this is really strange. I just updated from 23.7.1 to 23.7.2 and do not have these issues.

Is there something in the log?

I briefly scanned the release notes and there no hints of changes regarding modbus.

Maybe ask in the HA developers in their discord for help - these guys are really friendly and helpful, and they know the changes from 23.6 to 23.7 i detail

ajbatchelor commented 1 year ago

Thanks for looking into this @mkaiser. I'll reach out to the HA devs. There was nothing in the logs that I could see.

I tried both 7.1 and 7.2 and on both new versions I was seeing the scan interval increase out to 20 mins. I'll let you know if I find anything out.

mkaiser commented 1 year ago

Lets keep the issue open. Maybe you are not the only one. Can you keep us posted?

ZEi20T commented 1 year ago

This is also happening to me since upgrading to 2023.7 versions image

also, the information in the energy dashboard looks very wrong

image

Louisbertelsmann commented 1 year ago

On what kind of environment are you running Home Assistant? It could be possible that it detects being overloaded and slows down the scan interval. It shouldn't happen, but it could.

ZEi20T commented 1 year ago

Its running on HAOS on core i5 with 16gb RAM. the sensors all appear to update fine in my dashboard. only happened after July updates

ajbatchelor commented 1 year ago

Mines running on a RaspberryPi 4. I've not had a chance to take this up with the HA devs on Discord, but will do so.

mkaiser commented 1 year ago

any news on this?

btw. I am running HA on a RPI4 (4GB), too. Lukily no problems so far

Tsopic commented 1 year ago

This is also happening to me since upgrading to 2023.7 versions image

also, the information in the energy dashboard looks very wrong

image

@ZEi20T

I've seen such Battery level updates since the beginning, it has never been smooth for me

ajbatchelor commented 1 year ago

On what kind of environment are you running Home Assistant? It could be possible that it detects being overloaded and slows down the scan interval. It shouldn't happen, but it could.

ajbatchelor commented 1 year ago

Hi, I spent some hours working on this over the weekend. I think that you might be right with your guess that it detects being overloaded and slows down the scan, I can see some of the data being returned and some timing out. I tried slowing the scan rate but this did not solve the issue.

I wanted to see if I could solve the issue myself before seeking help. I'm at the limit of my trouble shooting skills so will seek advice on Discord.

mkaiser commented 1 year ago

hmm okay, lets get a bit more structured here...

Problems started with the release of 2023.7. 2023.6 and previous versions worked fine.

ajbatchelor and ZEi20T reported these issues.

ajbatchelor's config: RaspberryPi 4 ZEI20T's config: HAOS on core i5 with 16gb RAM.

I am using HAOS on RPI4 with a modbus proxy and have no issues.

Are you using a modbus proxy? (I recommend https://github.com/Akulatraxas/ha-modbusproxy/ )

mkaiser commented 1 year ago

.... does it work again, if you just include <10 sensors? e.g. load power and mppt stuff ?

ajbatchelor commented 1 year ago

Hi @mkaiser, I've loaded up the modbusproxy, the language in the README confuses me a little. In the docs it says to add the IP of the modbus server (which I'm assuming is the IP of my HA), then in the application it refers to the IP of the upstream host, which I am assuming is my solar inverter. Either way I can't see anything connecting in the log. Are you able to shed any light on this for me?

I'll try reducing the sensors to <10 this weekend and see if that works.

Screenshot 2023-08-10 at 9 41 00 pm

mkaiser commented 1 year ago

image

my config. So add the IP of the Sungrow Inverter as "Upstreamhost"

mkaiser commented 1 year ago

in secrets.yaml use the ip address "0" to connect with modbusprox local to HA

sungrow_modbus_host_ip: 0

ajbatchelor commented 1 year ago

Hey @mkaiser, I think that I have got this working again. I used your instructions for modbus proxy, upgraded to HA2023.8 and then removed quite a few of the sensors that I was not referencing. It all seems to be working fine now and polling regularly.

Thank you very much for you help!

ajbatchelor commented 1 year ago

Thanks @mkaiser, closing this one out. One less thing on your list :)

mkaiser commented 1 year ago

One last thing I like to know: could it be caused by the bloated up amount of sensors or was the culprit most likely the general connection, which was fixed b the proxy?