Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT messages sometimes not delivered after Home Assistant reboots #6

Open
RobertD502 opened this issue Oct 29, 2020 · 0 comments
Open

Comments

@RobertD502
Copy link
Contributor

I started to notice that MQTT messages will sometimes fail to be delivered to Home Assistant if HA is rebooted. This doesn't always occur and I haven't been able to pin down the exact conditions since sometimes MQTT messages from the Neato are still being delivered after a HA reboot and at other times they are not. I tailed the log for the neatoserialmqtt.service and notice that it reports that it is continuing to send messages although the MQTT broker isn't receiving them. Whenever this happens, I manually connect to my broker and can see that the "vacuum/state" topic is not present. The only way to get MQTT messages to properly arrive to the broker and be seen by HA again is to restart the neatoserialmqtt service at which point the "vacuum/state" topic reappears and everything is functioning again. I'm not sure if this problem is specifically due to the broker on HA, but I did notice that the only MQTT device experiencing this problem is the Neato.

In case anyone else runs in to this problem, what I have done is:

  1. Generated a ssh key in HA and placed the files in /config/ssh.
  2. I then added the contents of the generated id_rsa.pub file on HA to the authorized_keys file on the pi running the neatoserialmqtt service.
  3. In HA, I created a shell command which restarts the neatoserialmqtt service when it is called:
    restart_bedroom_neato_mqtt_service: ssh -i /config/ssh/id_rsa -o StrictHostKeyChecking=no pi@192.168.1.174 -t 'sudo systemctl restart neatoserialmqtt.service'
  4. I then created an automation that runs the shell command if the vacuum's attribute "status" is "Unknown" for 30 seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant