-
Notifications
You must be signed in to change notification settings - Fork 36
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
Setting MQTT log topic to null produces error #6046
Setting MQTT log topic to null produces error #6046
Comments
also happens in 2024.7 |
Do you get the same error with empty string? The following works for me. Notice that empty string is null, not string literal
|
And empty string gives
Note that The validation for this in the code is here: But this will fail because the topic is required: And when it does get parsed it will become empty string anyway: But this is just validation. The The reason it thinks we should be using mqtt is because it is the only option available when we get to show_logs. At this point I'm not sure what to do. Maybe it could print a friendlier error message, but fundamentally there are no show_logs options that will work. Too bad it can't use whatever method the web interface uses? |
For esphome/issues#6046, when MQTT logging is disabled (either via the `log_topic` or `topic_prefix` set to null), the error message a user sees is python exception. This detects the configuration and prints a more human-readable error message, reminding the user why MQTT logs are unavailable.
Related to esphome/issues#6046, it isn't necissary to remove the api component entirely. In fact, it is kinda nice to keep it there for tailing logs if the log_topic is `null`. This clarifies that you can just set `reboot_timeout` and keep it enabled.
This is a second pass at esphome/issues#6046 I have a situation where sometimes I have MQTT logging enabled, but sometimes not depending on the device. This PR removes the choice so that one doesn't have to remember that MQTT logging is disabled, so that `esphome logs` goes right for the API method (if available).
Related to esphome/issues#6046, it isn't necissary to remove the api component entirely. In fact, it is kinda nice to keep it there for tailing logs if the log_topic is `null`. This clarifies that you can just set `reboot_timeout` and keep it enabled.
The problem
In documentation(https://esphome.io/components/mqtt) and #3047 it is mentioned setting
would disable logging via mqtt. However, when I do that and install the firmware wirelessly or attempt to retrieve the logs wirelessly, the error below appears. The upload itseld and the device do seem to work.
What might be relevant is I also disabled the api.
Which version of ESPHome has the issue?
2024.6.6
What type of installation are you using?
Docker
Which version of Home Assistant has the issue?
issue not relevant to home assistant
What platform are you using?
ESP32
Board
No response
Component causing the issue
mqtt
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: