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

Add Retain Message Flag #5

Open
mkyral opened this issue Nov 12, 2017 · 3 comments
Open

Add Retain Message Flag #5

mkyral opened this issue Nov 12, 2017 · 3 comments

Comments

@mkyral
Copy link

mkyral commented Nov 12, 2017

I'm testing bigclown sensors with homeassistant (hass) on Turris 1.1 and it doesn't work well. Hass connects to mqtt broker periodically and in many times it simply miss the value change from sensor.

After some searching I've found that there is "Retain Message Flag", that tells broker to store the last value. So hass always gets the last value when asks.

I've tested it, extended the publish function call with parameter retain=True and now hass works as I expect.

So it will be nice to have this flag in configuration and I can enable it when need.

Only question I have: is it OK to enable it for all published messages in general or should be configurable per message type or even per message?

@jirutka
Copy link

jirutka commented Nov 13, 2017

It makes sense to use retain messages for some topics, but definitely not for all (in general) - it'd be incorrect solution for this issue. MQTT supports persistent sessions.

@mkyral
Copy link
Author

mkyral commented Nov 13, 2017

Thanks for info. I have to test it, but it looks like setting mqtt client_id in homeassistant configuration should be enough.

https://home-assistant.io/docs/mqtt/broker/#run-your-own

@blavka
Copy link
Member

blavka commented Nov 15, 2017

Its good idea, added to config, list for topics with retain flag.
I'll definitely add it in the near future.

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

3 participants