Checking config from command line in Hass.io

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

1 Like

I have the same question as the GUI doesn’t meet my needs and sometimes takes forever to return results.

Type hassio help in the command line. It’s in the list of commands.

It is hassio ha check in case anyone stumbles on this in the future…

4 Likes

Any idea how to get it to check a different directory? I.e. a staging area of the configuration…

By now this command is deprecated, and the advised command is: ha core check

1 Like

ha core check

3 Likes

Surprisingly enough, the CLI command ha core check takes a very long time compared to the GUI “check configuration” button.

Is anyone else experiencing the same issue?

1 Like

It has always taken much longer than the GUI version, but the CLI also provides much more information on errors than the GUI does.

2 Likes

It doesn’t.

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