Valetudo
Valetudo copied to clipboard
Valetudo MQTT disconnecting every 2 minutes
What is happening?
In short: my backup solution pauses HAOS VM at 1:30 every Monday causing mqtt disconnect from the vacuum robot after which connections last only for 2 minutes until robot is rebooted. I stayed on one of the 2022 valetudo versions and decided to update to 2024.2 last week. This issue is only visible since yesterday (when the mosquitto broker was paused) - on old versions mqtt was always perfectly stable. Using HA 2023.11.2. Robot is Mijia 1C. Attaching screenshots - please let me know what kinds of other logs you need. Robot is not seen disconnecting from wifi, so this seems like MQTT issue. This is also seen on two identical mijia 1c robots (both running same valetudo versions, both under servers that backup VMs in the same way)
Broken or not as expected?
Broken
What should be happening?
MQTT should reconnect and stay connected with no need to reboot the robot.
How to reproduce
- Forcibly pause Mosquitto and let the robot disconnect for a moment
- Resume mosquitto, wait for the valetudo to connect
- Watch how it reconnects every 2 minutes
Is this Valetudo-related?
Certainly Valetudo-related
Please enter the Valetudo version you're using
2024.2
Please enter the vendor and model of robot you're using
Mijia 1C
Please enter the robot's firmware version you're using
1122
Additional context
Issue is seen on two identical robots. This issue did not happen on old (2022) valetudo versions.
Context reflection
No, it's only the Valetudo version that changed.
Screenshots
I was indeed able to reproduce the issue.
By pure coincidence, just 3 hours ago(!) there was a new release of the MQTT library used which contains a single bugfix for "keepalive issues": https://github.com/mqttjs/MQTT.js/pull/1855
Please try the latest nightly build and let me know if the issue still persists
I switched to "nightly" update branch and attempted update twice. I'm not sure install worked because updater still pops up with the same nightly built.
System information after update:
Updater still offers new package:
Well, I think this update attempt broke my robot, or at least this is a very weird coincidence. When attempting to charge it turns on in lower mode and moves a bit in docking station, then complains about charging error. Need to reflash this with official build. (after reflash battery charges fine, I checked logs in previous state and there was nothing worrying. Don't have time to reproduce this and investigate further unfortunately)
I noticed something similar which may or may not be related. When I would disable entities in home assistant for the vacuum, I'd check and a few hours later they'd be back. As if the vacuum was routinely dropping off and back onto the instance.