I’m trying to do script which first takes snapshot, uploads it to Google Drive and then updates Hass.io.
First tow parts I have solved (thanks to community), but I’m not able to get hassio cli commands to work from Home assistant configuration.
This would be simple thing, though it does not work:
… and there is something in the log:
Edit: there is error in log:
Error running command: hassio homeassistant update, return code: 127
10:43 AM /usr/src/homeassistant/homeassistant/components/shell_command/init.py (ERROR)
NoneType: None
As google tells,code 127 tells that such command does not exist. Should I do some magic to run command in Home assistant container, or something like that?
… which I did not find earlier, shame on my googling.
But at the moment I don’t want to hassle with this, my use was just to get backup and update in one button operation, which would be neat, but not necessary. I want to keep my HassOS as untouched as possible, to maintain easier restore scenarios.
I am using Phil Hawthornes hadockermon and a depreciated custom_component (@ludeeus) hadocker switch… inexplicably depreciated as it is far superior to his suggested replacement (which doesn’t work with hassio… I just think he doesn’t want to maintain it anymore) but it works perfectly and I can start/stop/restart any docker container i want.
Yeah but it’s not an addon and that sanderhuisman repo won’t work with hassio anyway. Use Portainer to run Phil Hawthorne hadockermon and then the depreciated switch component will work… I don’t need to run it via Portainer as I use debian+ HA-Supervised but you should be able to make Phils repo work with Portainer.
Those hassio -services do work well, for things they exists.
My original dream was to update hassio by button in GUI, chaining backup, its upload to Google Drive, and then running backup.
For that was not possible with shell command, I tried few things:
Doing shell command which opens ssh from HA to HA, and runs command. Go wonder, this does not work at all
Doing shell command, which open SSH to another linux, and runs shell script, which opens SSH to HA, and runs “hassio homeassistant update”
Talk about useless complexity…
I was able to run test commands, such as “touch /root/config/test.txt”, by which I got file created on HA. But hassio -commands result “Unexpected server response”. I suppose that hassio commands are restricted to be run only locally, or something like that.
But anyhow, I think I’ll be waiting for doing my wonder button once there is service displayed next to rest of hassio services.