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 Discovery in HA throws an error after upgrade to 2024.7.3 - MQTT settings lost after reboot #1882

Closed
zaphood1967 opened this issue Jul 22, 2024 · 6 comments
Labels
bug Something isn't working technical Technical enhancement, or tech-debt issue

Comments

@zaphood1967
Copy link

PROBLEM DESCRIPTION

MQTT Error is shown in the log. Not sure what it means, but all ESM-ESP Entities are offline in HA

REQUESTED INFORMATION

2024-07-22 08:22:20.489 ERROR (MainThread) [homeassistant.components.mqtt.mixins] Error ''max' must be > 'min'' when processing MQTT discovery message topic: 'homeassistant/number/ems-esp/boiler_burnmaxpower/config', message: '{'object_id': 'boiler_burnmaxpower', 'icon': 'mdi:percent-outline', 'device': {'name': 'ems-esp Boiler', 'identifiers': ['ems-esp-boiler']}, 'unique_id': 'boiler_burnmaxpower', 'step': 1, 'min': 100, 'availability': [{'topic': 'ems-esp/boiler_data', 'value_template': "{{'online' if value_json.burnmaxpower is defined else 'offline'}}"}], 'value_template': '{{value_json.burnmaxpower if value_json.burnmaxpower is defined else 100}}', 'max': 100, 'name': 'Maximale Brennerleistung', 'mode': 'box', 'state_topic': 'ems-esp/boiler_data', 'availability_mode': 'all', 'command_topic': 'ems-esp/boiler/burnmaxpower', 'platform': 'mqtt'}'

TO REPRODUCE

Error occurs since update to 2024.07.3

EXPECTED BEHAVIOUR

MQTT should deliver the attributes again

@zaphood1967
Copy link
Author

All of a sudden, EMS-ESP had "forgotten" the MQTT configuration and switched it off as well. Weird.
So after enabling MQTT again, all is fine again. Strange coincidence and I am not sure, why EMS-ESP has deleted the MQTT Configuration.

@zaphood1967
Copy link
Author

Fixed

@proddy
Copy link
Contributor

proddy commented Jul 22, 2024

this is strange. I'm happy it is fixed but would still like to know what may have caused it.

  • has anything rebooted, like HA, or EMS-ESP or the MQTT broker?
  • did you upgrade anything (HA, EMS-ESP, MQTT) ?
  • was their a WiFi/Network reconnect?
  • to get it working did you just have to re-enable MQTT in EMS-ESP? Or were all the settings lost and you had to re-enter them?

@zaphood1967
Copy link
Author

zaphood1967 commented Jul 22, 2024

Agree, this is really strange. I updated HA yesterday to 2024.7.3 and did not notice anything unusual. This morning, one value from the ESP was missing, so I rebooted HA, just to make sure it was not HA. After the reboot, all values of EMS went offline, so I checked the EMS website, but all looked good. I then rebooted EMS ESP as well, but nothing changed. After finally rebooting Mosquitto I filed the issue.
Don't know why, but only then I checked the MQTT settings on the ESP and found MQTT to be disabled, and the IP address of the server as well as the login credentials were gone. After keying in the IP address of the broker and the login data and enabling MQTT discovery for HA again, all worked as expected. No idea what made the ESP forget the data. There was no power outage, no WLAN issues and no other problems I would be aware of.

@proddy
Copy link
Contributor

proddy commented Jul 22, 2024

Thanks for explaining. This has happened to me before as well, it's very odd and I really don't know what is causing it. Sometimes the MQTT settings are removed or not being loaded after a re-boot of EMS-ESP. It's mentioned before in the last 1-2 years, like in #1265 (comment). I just don't know what is causing it.

This is one to keep track of. Thanks for reporting.

@proddy proddy reopened this Jul 22, 2024
@proddy proddy added bug Something isn't working technical Technical enhancement, or tech-debt issue labels Jul 22, 2024
@proddy proddy changed the title MQTT Discovery in HA throws an error after upgrade to 2024.7.3 MQTT Discovery in HA throws an error after upgrade to 2024.7.3 - MQTT settings lost after reboot Jul 22, 2024
@zaphood1967
Copy link
Author

Just to clarify: I cannot tell for sure, if the MQTT settings had already been deleted BEFORE I rebooted the ESP, as I only checked afterwards. But I would assume they had been gone already beforehand, as there was no other reason on why HA did not receive any data from the ESP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working technical Technical enhancement, or tech-debt issue
Projects
None yet
Development

No branches or pull requests

2 participants