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

Home Assistant MQTT Config Lost (Awkward Retain Situation...) #1028

Open
MaJaHa95 opened this issue Jun 28, 2024 · 1 comment
Open

Home Assistant MQTT Config Lost (Awkward Retain Situation...) #1028

MaJaHa95 opened this issue Jun 28, 2024 · 1 comment

Comments

@MaJaHa95
Copy link

Is your feature request related to a problem? Please describe.
I've been having trouble lately where Home Assistant loses the MQTT configuration from ecowitt2mqtt. The whole thing is a little frustrating (why can't HA just persist it? is there a workaround?), but it's not ecowitt2mqtt's fault.

The simple answer to my woes is to set the retain flag and let my MQTT broker handle the rest.

The issue is that I'm using RabbitMQ as my MQTT broker (for reasons), and RabbitMQ doesn't really handle retained messages in clustered environments. There are workarounds, but nothing I'm too keen to dive into right this moment.

Describe the solution you'd like
I have a couple ideas that aren't too outlandish, I believe.

  1. I've heard that it's good practice for MQTT publishers to react to homeassistant/status by republishing config, but I don't actually know if that would solve my problems.
  2. For a more broadly-applicable solution, what if there was an endpoint for ecowitt2mqtt that forced it to republish? Then I could even go nuts and set up an automation that automatically called it if a sensor went unavailable for some amount of time.

Additional context
I'm very open to recommendations too. I'm sure I don't know everything about RabbitMQ, MQTT, ecowitt2mqtt, nor indeed Home Assistant. If anyone has ideas of how I can work around these issues, I'm all ears. The most correct solution would be for me to set up RabbitMQ to share retained messages across the cluster, but I see these workarounds as being independently valuable additions to ecowitt2mqtt, so I figured I'd pitch them.

@bachya
Copy link
Owner

bachya commented Jul 11, 2024

Thanks for your patience.

For a more broadly-applicable solution, what if there was an endpoint for ecowitt2mqtt that forced it to republish? Then I could even go nuts and set up an automation that automatically called it if a sensor went unavailable for some amount of time.

Is the idea here that this new endpoint would simply republish whatever the most recently received payload was?

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

2 participants