sfstar / hass-victron

Integration for Home Assistant to fetch data from the victron gx device via modbusTCP
Apache License 2.0
182 stars 28 forks source link

Victron integration stops updating values #113

Open iJAY86 opened 1 year ago

iJAY86 commented 1 year ago

After updating my the victron integration, I noticed it stops updating/giving current values after a while and only starts giving the current values after reloading the integration.

shaman171 commented 1 year ago

I have exactly same behaviour. Latest update 0.1.3 Home Assistant 2023.8.4 Supervisor 2023.08.1 Operating System 10.5 Frontend 20230802.1 - latest

No changes in meantime on the Victron settings or equipment.

askpatrickw commented 1 year ago

@shaman171 and @iJAY86, are you seeing errors like this?

image

If so, for which devices? My Battery and my Multiplus-ii seem fine, but my Lynx Smart BMS has these errors.

shaman171 commented 1 year ago

No I do not see any of such errors in HA. There are just no longer updated data and it stop on some "random" last value which was readed from Victron. Then HA simply "think" that thi value is right and it get no longer any more value and show this one. Once you let this Victron add-on start again it again get values for like 5-10 minut and then get dead again.

iJAY86 commented 1 year ago

@shaman171 and @iJAY86, are you seeing errors like this?

image

If so, for which devices? My Battery and my Multiplus-ii seem fine, but my Lynx Smart BMS has these errors.

No errors

askpatrickw commented 1 year ago

I wonder if we're all seeing this issue: #83

trooster commented 1 year ago

Same issue here.., data no longer updating. And I also had the solar data entities removed, similar to what 'askpatrickw' is experiencing.

Update: I have downgraded to version 0.1.2 and rescanned the devices from the integration, and so far, everything seems stable again.

JBecker32 commented 1 year ago

Same issue here. Updating runs ok for some hours and then stops. Is not starting again without resetting HomeAssistant manually.

Update: downgrade to 0.1.2 solves it completely. Working since then (3 days)

jwiesel commented 1 year ago

Same issue here. The integration worked nicely on version 0.12. Since I upgraded a few days ago to 0.13 it hangs after a short while messing up my PV-based EV-charging.

Home Assistant version: 2023.8.3

Log entries (both occured at the time the integration stopped updating data):

Warning:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht (Error caused by a custom integration)

Logger: custom_components.victron.coordinator Source: custom_components/victron/coordinator.py:76 Integration: victron (documentation, issues) First occurred: 26. August 2023 um 18:34:29 (1 occurrences) Last logged: 26. August 2023 um 18:34:29

no valid data returned for entities of slave: 20 (if the device continues to no longer update) check if the device was physically removed. Before opening an issue please force a rescan to attempt to resolve this issue

Error:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht (Error caused by a custom integration)

Logger: custom_components.victron.coordinator Source: helpers/update_coordinator.py:229 Integration: victron (documentation, issues) First occurred: 26. August 2023 um 18:34:29 (1 occurrences) Last logged: 26. August 2023 um 18:34:29

Error fetching victron data: Fetching registers failed

jwiesel commented 1 year ago

Not sure, if it is related. The latest Home Assistant bugfix mentions something about Modbus Slave issues: https://www.home-assistant.io/blog/2023/08/02/release-20238/#release-202384---august-24 https://github.com/home-assistant/core/pull/98644. I'll upgrade to 2023.8.4 and monitor, if that helps.

trentjw commented 1 year ago

same problem quits updating until I do a reload of the integration then it works for about a day

trooster commented 1 year ago

The only change from version 0.1.2 to 0.1.3 was an update to the PyModbus library from version 3.1.1 to 3.4.1. https://github.com/sfstar/hass-victron/commit/36727e8764538f77263d3e0d6fa1b9d46cfaaf80

Version 3.5.0 of the PyModbus library is already released, and it looks like it has several fixes with the word "retry" in the name. https://pymodbus.readthedocs.io/en/stable/changelog.html

trentjw commented 1 year ago

The only change from version 0.1.2 to 0.1.3 was an update to the PyModbus library from version 3.1.1 to 3.4.1. 36727e8

Version 3.5.0 of the PyModbus library is already released, and it looks like it has several fixes with the word "retry" in the name. https://pymodbus.readthedocs.io/en/stable/changelog.html

okay still have the issue of the integration freezing and not responding so not sure what you are getting at?

trooster commented 1 year ago

@trentjw What I am getting at is that you either need to dowgrade to version 0.1.2 or wait until the author releases a new version which contains the 3.5.0 library of PyModbus which hopefully fixes the issue we are having.

jwiesel commented 1 year ago

Not sure, if it is related. The latest Home Assistant bugfix mentions something about Modbus Slave issues: https://www.home-assistant.io/blog/2023/08/02/release-20238/#release-202384---august-24 home-assistant/core#98644. I'll upgrade to 2023.8.4 and monitor, if that helps.

Installing Homeassistant 2023.8.4 unfortunately did not improve the situation. The Victron integration still hangs after some time

Klumpen58 commented 1 year ago

I have the exact same problem since the upgrade. 😟

MattBN001 commented 1 year ago

Me too…

trentjw commented 1 year ago

reverting back to version 1.2 as suggested is a fix for now until it is broken later I went back to it and it reporting as it should

https://github.com/sfstar/hass-victron/tree/v0.1.2

mploetner commented 1 year ago

Same problem even with the latest update 0.1.5

Stops updating data for all entities after short time

pos-ei-don commented 1 year ago

I see this after a short network disconnect. The plugin does not restart after the network Returns.

I have a unreliable connection over LTE, so I see this Situation almost daily.

Klumpen58 commented 1 year ago

I have core update 2023.9.1. and Victron 0.1.5.. - both the current status as of yesterday. And since then I haven't noticed any more interruptions.

mploetner commented 1 year ago

@pos-ei-don could be the reason. I will check this. Was never a problem for months until around JULY

shaman171 commented 1 year ago

I can confirm also for me after update of HA and victron to latest versions it works already since yesterday without troubles. Thank you for fix! 👍

mploetner commented 1 year ago

Ok Internet connection was stable but updating stopped for all entities about 8h ago. Any other ideas to solve it?

pos-ei-don commented 1 year ago

Just to be clear: I spoke from small interruptions, nothing you can find with a ping per second.

mploetner commented 1 year ago

Ok that could be a reason. I also use LTE connection.

I update my VenusOS device hoping this will solve the problem but no luck. It works for some hours and then stops updating.

sfstar commented 5 months ago

Since this issue was reported there have been several improvements made regarding connection stability and recovery. Are the issues you are experiencing still regularly occurring or can the issue be closed as resolved?

mploetner commented 5 months ago

It happens occasionally every few weeks. Reloading the integration solves the problem.

naofireblade commented 5 months ago

I found a solution for my update problem. I use the external control ess mode and set the acpowersetpoint every 10 seconds (that works fine). In order to update the sensor values im home assistant, the configured update interval for the plugin must be < 10 seconds (e.g. 9 seconds).

Reason and possible bug in the plugin: Whenever i set acpowersetpoint the plugin prints [custom_components.victron.coordinator] Manually updated victron data in the debug log but does not update the sensor values in home assistant. Now after configuring the update interval for 9 seconds, i also see custom_components.victron.coordinator] Fetching victron data and [custom_components.victron.coordinator] Finished fetching victron data in 0.463 seconds (success: True)in the logs.

So maybe the plugin skips updates if a command is send in a faster interval than the configured update interval.

sfstar commented 4 months ago

Sorry was on holiday the last couple of weeks and noticed remotely once that the integration indeed stops updating values. So this issue needs further investigation.