Is there a way to check the current config from the command line in Hass.io?
I use a Makefile to SCP up the config from my local machine and did have it then run a check on the config after it was uploaded, but I can’t figure out how to do the check now I’ve upgraded to Hass.io
As you can see, the WebUI version detected a problem with my config – and did it instantly.
At the same time the CLI’s ha core check took long 24 seconds and didn’t notice any issues.
So… Is there a CLI version of Developer Tools -> Yaml -> Check configuration after all?
Hmmm I hope they haven’t changed stuff - when I do ha core check, it used to take about 5-10 minutes to complete and would spit out the sort of errors the Home Assistant log itself would spit out if there were problems. Though I don’t think I have ever done it in the core-ssh add-on, I always do it in the HAOS CLI directly.
I’m guessing this doc page is outdated not comprehensive (see EDITs):
[core-ssh ~]$ hass --script check_config
-bash: hass: command not found
EDIT:
apparently, it is only available for “Core” installation only [?] (not only \/)
EDIT2:
The hass command is accessible on HAOS with Advanced SSH & Web Terminal addon and docker, but it’s still “not the same” as the WebUI check (doing more stuff, being slow) → see the thread linked above.
EDIT3:
I’ve found a better solution.
I’ve created a long-living authentication token → and I’m just using the same API as the WebUI is → to do the check:
➜ ~ time curl -k -L -X POST -H 'Content-Type: application/json' -H 'Authorization: Bearer THE_TOKEN' 'http://homeassistant.local:8123/api/config/core/check_config'
{"result":"valid","errors":null,"warnings":"Integration error: ddd - Integration 'ddd' not found."}
curl -k -L -X POST -H 'Content-Type: application/json' -H
0.01s user 0.01s system 4% cpu 0.541 total