davesmeghead / visonic

Visonic Custom Component for integration with Home Assistant
Apache License 2.0
92 stars 20 forks source link

reconnect does not work #24

Closed povlhp closed 3 years ago

povlhp commented 3 years ago

Sometimes I lose connection to my PowerMax Pro, and it is lost until restart HA. Tried visonic.alarm_panel_reconnect - But that does not work. Error after about 10 seconds. Looking with wireshark comms seems fine, but status is still dead in HA until restart. So maybe it is running nicely async in the backend disconnected from the frontend ?

The log is here: https://pastebin.com/U4ruYrVu

Since the reconnect goes well, it looks like the whole state of the data being read is not fed into the right place in HA.

I guess the only wait I get to this in client.py: self.createWarningMessage("Failed to connect into Visonic Alarm. Check Settings.") is because this runs null ? self.visonicTask, self.visonicProtocol = visonicApi.create_tcp_visonic_connection(

But that one is simple, and should not fail. It creates a new asyncio.get_event_loop() and does a create_connection on that with some callbacks (the same as before).

The important lines are likely

2020-12-17 21:22:28 DEBUG (MainThread) [pyvisonic] Setting TCP socket Options
2020-12-17 21:22:29 DEBUG (MainThread) [pyvisonic] Waiting for Protocol Handler to Start
2020-12-17 21:22:30 DEBUG (MainThread) [pyvisonic] Waiting for Protocol Handler to Start
2020-12-17 21:22:30 DEBUG (MainThread) [pyvisonic] Waiting for Protocol Handler to Start
2020-12-17 21:22:31 DEBUG (MainThread) [pyvisonic] Waiting for Protocol Handler to Start
2020-12-17 21:22:31 WARNING (MainThread) [custom_components.visonic.client] Failed to connect into Visonic Alarm. Check Settings.
davesmeghead commented 3 years ago

I think we got this resolved so I'm closing the issue. If not then I have just created a new release, including a HACS release. Please update your integration to the latest release and try again. If you get the same problems then upload a full log file.