WTH are so many clicks needed to get error messages from failed YAML configurations

The following sequence occurs if you have an error in your YAML based automations. The issue also is in may other integrations, but most commonly encountered in automations.

  • You click on “Check Configuration” button. Depending on the nature of the error, it will say “Configuration Valid” in green. From what I understand the “Configuration Valid” in green only means your YAML file structure itself has a valid syntax. 1 click
  • However a split second later a persistent notification appears, telling you of your failure. 1 click on persistant notifications on sidebar, another click on persistent notification text to jump to the logs. Total 3 clicks
  • The logs show all recent errors. Find the error. Click on it to get the full text. Read text. Click to dismiss. You’d better click “clear logs” because if you still have an error, it is hard to differentiate old errors from new. 3 clicks. Total 6 clicks.
  • The persistent notification is still there. It has to be dismissed. Otherwise you don’t know if you click “Check Configuration” again if you succeeded or failed. Additional 2 clicks needed. Total 8 clicks.
  • Now to go back the YAML configuration validation by clicking “Developer Tools”. Total 9 clicks.
  • Go back to the beginning hoping that you fixed your error this time and you don’t have to go through this maze of clicks again.

What would be nicer…

  • Click on “Check Configuration”. Homeassistant will return a green “Configuration OK” only if all integrations successfully processed the configuration validation.
  • If it failed and there are errors spawn a window below the button containing the details of what integrations failed the validation and the text logs of error messages generated. Home assistant used to do something like this. It used to be I could click “Check Configuration” just once and instantly obtain useful messages on why it failed.
  • Don’t use a persistent notification, or a the very least have it auto clear somehow instead of having to be manually dismissed after every validation attempt. I think a popup dialog box would be an improvement over a persistent notification.
  • On the logs, show errors only generated after latest press of “Check Configuration”. Stale errors and errors from your previous attempts are distracting and confusing.

If you have your log open on another browser it’s one click :wink:

No. It is less clicks but not one
The annoying part is that persistant notification that you have to dismiss all the time. If at least it dismissed itself after correction and successful reload of automations.
You edit your automation yaml one place. You reload automations a 2nd place. The error pops up as persistant notification a 3rd place and the actual log text is a 4th place. It is not a nice workflow.

One thing that makes it worse is that very often you make a mistake in an automation in a yaml file that gets included and merged from configuration.yaml.
The error message is very often referencing configuration.yaml and not the file that has the error. Often you get the right file name and the line number. But it happens too often that you go through the check yaml, reload automation, see the “1” in persistant notifications, click on that to dismiss it, and look at the log just to find that there is an error in configuration.yaml. Good luck finding the problem. You really need to develop automations in many small steps because may the higher powers have mercy on you if you edited 2 or 3 automation yaml files and you are told there is an unspecified error. Then you can start guessing and undo what you did and go through this cycle of horror maybe 10 times until you find your stupid little mistake.

Less steps to get the error message and better reference to the offending file and line number. That would make my life a little better

I use vs code on a desktop pc, it’s still one click for me. You can have automation dismiss those persistent notifications or ignore them until you have a final solution. But if you use VS code on a separate monitor or in a separate browser, you can have your log and automation open at the same time in the same screen. Making it 1 click, until you dismiss all the notifications. While it’s not a solution to the WTH, it’s definitely avoidable if you use the tools that are provided.

No, all it means is that your configuration won’t prevent Home Assistant from starting. It’s still not valid if the persistent notification is created. See this issue I opened the other day:

1 Like

It still does…kind of…some times…

I’ve had it happen both ways recently.

But I’m not sure what the differences are in the errors that determine whether it will give the feedback directly in the config check box or will provide the feedback as a persistent notification.

but you really can’t ignore them because if you attempt to fix the error and do a recheck if the persistent notification is still there you have indication at all if the error is fixed or not. So you have to clear the notification. do the check and wait to see if the notification comes back or not.

the only other option at that point is to open your actual log file (home-assistant.log) and see what the last entry is there to guide you to the actual error. Even refreshing the UI logs doesn’t always show good info on what the issue is.

That’s what watching the logs is for… Sorry I wasn’t clear about that. You don’t need to see the persistent notification to see the errors. If you reload and there’s no errors in the logs, everythings good. VSCode naturally refreshes files at a high frequency so logs update quickly. You could also use a log viewing application like logExpert or baretail too.

I recall that you’re a notepad++ user, however you really should switch to VSCode. It’s worlds better for everything about HA, and you can copy the settings for highlighting & rules from the HA VSCode addon. Supplement that with LogExpert (Not a fan of baretail), and everything is one click.

I even think you can get auto-complete for entity_id’s working too? I haven’t tried.

1 Like