erikkastelec / hass-WEM-Portal

Custom component for retrieving sensor information from Weishaupt WEM Portal
MIT License
44 stars 9 forks source link

Improvement idea regarding availability #47

Closed dm82m closed 1 year ago

dm82m commented 1 year ago

hey guys,

I am working with mode: both and observing the issue that sometimes the availability of wemportal.com breaks. If this is the case the value of the sensors provided by wemportal.com switches to unavailable and is not reconnecting - even if wemportal will be back online. The only way getting new data is restarting my Home Assistant instance.

Could there be any "observation" be implemented in the component itself that will reconnect in these cases?

Or is someone having any alternative in mind? Like creating an automation that observers the status of the sensor and restarts the component in case the sensor is unavailable?

Best, Dirk

erikkastelec commented 1 year ago

The component stays unavailable only if the wemportal is down when Home Assistant is starting. I think that Home Assistant retries to setup component if exception is raised during setup, but exceptions are currently only logged and not passed back from the wemportalapi part of the integration. Solving this would probable fix this issue.

If this does not work, I will implement config flow, which makes it possible to reload the integration from UI. This would also make finding available entities easier, as we discussed in #28

erikkastelec commented 1 year ago

I implemented config flow (Ability to add integration inside Home Assistant GUI) and improved handling of timeouts/failed requests. Retries are implemented natively and should handle this problem. Component can also be manually reloaded inside Home Assistant integrations if all else fails.

If anyone is interested in testing:

erikkastelec commented 1 year ago

Closing as this is fixed in the latest version.