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

homeassistant messages in MQTT being sent when homeassistant is turned off #383

Closed
xoseperez opened this issue Jan 10, 2018 · 4 comments
Closed

Comments

@xoseperez
Copy link
Owner

Originally reported by: Scott Wilson (Bitbucket: Scotty86, GitHub: Scotty86)


MQTT messages are being sent on the network with the prefix homeassistant/light/{name}/config and homeassistant/switch/{name}/config even though in the configuration homeassistant is turned off. The messages have no content.

@xoseperez
Copy link
Owner Author

That's a known "behavior". Since MQTT messages sent by ESPurna have the retain flag set to true by default, those messages stick and Home Assistant receives the old configuration message when it restarts even if you have disabled it on ESPurna. The way to solve this is to overwrite that retained message with a blank one. The broker will then remove the message from it's retained database and Home Assistant won't receive it again.

The only solution I can think off is to have a button on the web UI to manually delete that message (send an empty message).

@xoseperez
Copy link
Owner Author

Another option, send the empty message only one when the user disables that feature. The message gets queued if no MQTT connection available. It will always send a discovery message on boot if enabled. There is one corner case: no MQTT connection, the user disables home assistant and then resets the board. The empty message will not be sent in this situation. The user will have to enable and disable it again. I think this is a minor problem.

@xoseperez
Copy link
Owner Author

Released with 1.12.0

@xoseperez
Copy link
Owner Author

Removing milestone: 1.12.0 (automated comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant