Would like to run a CLI config check before doing a git commit on my config files. When I run the check via the UI (Configuration > Server Controls > Configuration validation) it only takes a few seconds and passes.
However, when I run from the CLI (via Terminal Add on) it says “Processing” for 1-2 minutes before returning success.
Doc isn’t entirely clear but maybe it’s running a more extensive check via the CLI?
With Home Assistant OS and Supervised you can use the ha command: ha core check .
Interesting. Sure makes the feedback loop painfully slow when I’m checking config status before committing my changes to my repo. Hopefully we can find out if this is expected (though I imagine not) before I submit a bug for it. Would probably be really low priority anyway even if it is a true bug.
Guess it forces me to step away for a bit while it runs instead of constantly plugging away.
I have seen the same problem. I have further debugged this and found following:
1. Using 'ha config check' CLI takes 30+ seconds
2. Logging into homeassistant container using portainer and using 'python -m homeassistant --script check_config --config /config; takes 30 seconds
3. Clicking on "CHECK CONFIGURATION" in UI takes less than five seconds...
Further, I have determined that
"Nest" integration adds 12+ seconds in the first two methods above
"Influxdb" integration - actually I am using external influxdb adds 3+ seconds
"zha" integration adds 4+ seconds
Unsupported "ha-wyzesense" - integration (thru HACS) used to add 2+ minute plus (I removed it)
and it will do the check quickly. I use the pipe to (! grep ERROR) to get the exit code out of the command for my devops pipeline, so if there is an error in the yaml in the pipeline copy it will terminate the pipeline. So just remove that bit after the check_config if you dont want it. Hope this helps someone.