Hi,
My Supervisor seems to stop about once per week (“Can’t read Supervisor data”) - but this post isnt so much about that. When it happens, its an easy fix by running “ha core rebuild” and everything works again. When it breaks, all my add-ons stop working so i cannot run this command in the Terminal Add-On, i have to open the laptop that HA is installed on and run it.
Now when i am away from the house i would like to be able to trigger this command via HA itself, without requiring the Terminal add on.
I have looked into the shell_command option and Supervisor API but cant quite get it working.
I have the following in my configuration.yaml
shell_command:
core_rebuild: 'curl -sSL -H "Authorization: Bearer $SUPERVISOR_TOKEN" http://supervisor/core/rebuild'
And then a button hooked up to call this service.
When clicking the button I get error that method not found.
2022-04-05 09:04:43 DEBUG (MainThread) [homeassistant.components.shell_command] Stdout of command: `curl -sSL -H "Authorization: Bearer $SUPERVISOR_TOKEN" http://supervisor/core/rebuild`, return code: 0:
b'405: Method Not Allowed'
I notice in the documentation there is mention of requiring to put “homeassistant_api: true” or “hassio_api: true” in config.yaml - but when i add either of these the configuration checker fails.
Any help would be appreciated! I feel like there might be a step I am missing to enable the Supervisor API to be called.