DavidMStraub / homeassistant-homeconnect

Custom component for Home Assistant to connect appliances supporting the Home Connect standard
MIT License
117 stars 29 forks source link

Integration stops working after some time #47

Closed lancer73 closed 4 years ago

lancer73 commented 4 years ago

I only have a Home Connected hob in the house. I monitor the hob status with this integration and connect some actions to it (e.g. turn on lights above the hob when it is turned on).

This works perfectly after a (re)start of the Home Assistant server. Only after a few hours the Hob state is not updated any more.

Running with debug logging now to see if I can spot the cause. No hints in any of the logs previously.

Obviously the connection with Home Connect is terminated for some reason. Would't it be a good idea to run some form of self-check and reopen the connection in case of problems?

Will update this ticket when I find out anything more from the logs.

lancer73 commented 4 years ago

OK, even running with the debug log didn't show any hints. One hour after server start it still works. 2 hours after that it doesn't any more. Nothing shows up in the log.

Log starts at restart of the HA server and each point in time corresponds to an action on the hob. Last action was at 17:02, but that did't show up in the logs

home-assistant_masked.log

DavidMStraub commented 4 years ago

Thanks for debugging this and for the log output.

I am closing this since it is tracked here: https://github.com/DavidMStraub/homeconnect/issues/3

But you are right, this is indeed a problem.

Obviously the connection with Home Connect is terminated for some reason. Would't it be a good idea to run some form of self-check and reopen the connection in case of problems?

Yes, but there is already some code in place that is supposed to do this: https://github.com/DavidMStraub/homeconnect/blob/master/homeconnect/sseclient.py#L74-L83 I don't really understand why it doesn't work.

Note that this module was copied from https://github.com/btubbs/sseclient (I made some modifications to make it more robust). I tried finding other Python SSE libraries but didn't really find anything that worked better. I'd be grateful for help in this direction.