Bepacom-Raalte / Bepacom-BACnet-IP-Integration

Bepacom BACnet Integration Repository
Apache License 2.0
12 stars 2 forks source link

Integration & Add-On are not restoring the operational state after a HA restart #20

Closed CV-Private closed 6 months ago

CV-Private commented 6 months ago

I just installed Interface v1.4.0b4. It worked without error, but the presentValue in the entities were not getting updated anymore. I guess the connection to the Integration stopped over the update.

Then I restarted HA. This always triggers the Add-On to re-scan the entire object tree of the GTW-21 and re-subscribe, which takes like 15 min to complete, due to the large number of objects.

From the HA restart onward, the BACnet entities are shown as "not available" in the Dashboard, even after the Add-On completed the device scan.

image

Part of the problem is, that the Add-On does not remember the previously subscribed objects. It just tries to subscribe to all object of the object-types that are enabled in the Configuration. Due to the limitation of the number of CoV objects in the GTW-21 device, the Add-On subscription ends with errors after the first 20 objects, and therefore, the subscriptions needed for the entities are not being restored automatically.

I have to manually delete the automatic subscriptions to free up the subscription-list. Then I have to manually subscribe to the objects that I need for the Integration.

But even that does not make the Integration getting new CoV values from the Add-On. I have to manually reload the Integration to get the CoV values updated in the Dashboard.

Long story short - the Integration & Add-On are not restoring the operational state after a HA restart.

This is quite annoying to the user, because it has to be assumed that HA is being often restarted due to frequent updates. All Integrations should therefore restore the previous, operational state automatically, without the need for any user intervention.

Bepacom-Raalte commented 6 months ago

Could you try v0.1.6b6 for the integration? I added a detection task that checks once every 30 seconds. Checks for both an increase in devices as well as objects. It works for devices, but I can't test for increased object size. My test setup is quite small and supports more efficient reading. I would like to see the logs for the integration if there's errors.

CV-Private commented 6 months ago

I just updated to v0.1.6b6 and it went smoothly. The entities are in operational state after the restart without a need for manual configuration or a manual HA reboot.

Here's the Debug log from the Integration, which I saved before starting the update: home-assistant_bacnet_interface_2024-03-25T11-53-41.847Z.zip

Maybe you could take a look at the error at 2024-03-24 15:38:49.208.

This is the Debug log after the v0.1.6b6 update: home-assistant_bacnet_interface_2024-03-25T12-11-55.681Z.log

Bepacom-Raalte commented 6 months ago

Great, so it seems to work! For the error, I think it's solved by v0.1.6b6 as well. Feel free to close this issue if there are no more problems relating to this.

CV-Private commented 6 months ago

Great, thanks a lot!