dawidchyrzynski / arduino-home-assistant

ArduinoHA allows to integrate an Arduino/ESP based device with Home Assistant using MQTT.
https://dawidchyrzynski.github.io/arduino-home-assistant/
GNU Affero General Public License v3.0
480 stars 116 forks source link

Request for changing KeepAlive of mqtt connection #153

Closed thierry7100 closed 7 months ago

thierry7100 commented 1 year ago

Hi,

I am using this library on several project with success; However, for one among them which is using deep sleep (my ESP32 wakes up every 5mn) I have a problem. The default keepalive is 15s in the PubSub library so after 15s, my device is reported as offline by home assistant. I have just added a one line function in hamqqtt.cpp to be able to set the keepalive time in the PubSub object and it is working fine (I use 350s keepalive). Would it be possible to enhance the library in a future release ?

Thanks in advance.