smar000 / evoGateway

Python script for listening in and responding to evohome heating control radio messages
46 stars 17 forks source link

Feature request: auto reconnect to MQTT server #17

Closed dystechnic closed 3 years ago

dystechnic commented 3 years ago

Hi, While doing some maintenance on my MQTT server I noticed that when the script looses connection to the MQTT server it does not reconnect automatically. I had to bring the MQTT server down for a short while (reboot) so the connection was lost. The only way to reconnect is manually stop and restart the script.

Is it possible to implement a function so that it will reconnect on a connection-los and tries this forever or for a defined period?

Thanx and regards,

Ed.

number42net commented 3 years ago

I've submitted pull request #19 which addresses this issue. Currently the script already re-connects automatically, but only subscribes once during initialisation and not on re-connect.

In the mean time you can clone my fork as well to confirm the fix.

dystechnic commented 3 years ago

Thanx. I will test your fork after this weekend.

number42net commented 3 years ago

@dystechnic It might be better to wait a bit, I think my commit also has a different key in devices.json (zone_id instead of zoneId).

smar000 commented 3 years ago

Thanks @number42net for all your help on this and the zoneId matter. Your changes have been merged a short while ago, and so good to go.