Mearman
(Joseph Mearman)
1
So, I’ve finally stopped fiddling with my HomeAssistant configuration so I’ve set it to run via systemd.
I know the code below won’t work, but I’m wondering is it possible to get a script to do updates for me with something like:
script:
update_script:
sequence:
- shell_command:
run_update: 'pip3 install --upgrade homeassistant && sudo systemctl start home-assistant@pi'
andrey
(Andrey)
2
I would advise against it.
A new release can have breaking changes. If you update without reading release notes - you HA instance might become broken.
Mearman
(Joseph Mearman)
3
I would probably have it as a script, so I would still trigger it manually.
I would also like to see something similar…
zanerv
(fane)
5
You could use something like this
#!/bin/bash
oVer=$(curl -s https://home-assistant.io/| grep -o '<h1>C.*</h1>'|sed 's/\(<h1>Current Version: \|<\/h1>\)//g')
lVer=$(cat /root/.homeassistant/.HA_VERSION)
if [ "$oVer" != "" ] && [ "$oVer" != "$lVer" ] ; then
/usr/local/bin/pip3 install --upgrade homeassistant
/usr/sbin/service home-assistant@root restart
curl "https://api.simplepush.io/send/XXXXXXX/Hass Update! https://home-assistant.io/blog/" >/dev/null 2>&1
fi
Maybe this works with shell_command?
shell_command:
hass_update: 'pip3 install --upgrade homeassistant && sudo systemctl start home-assistant@pi'
automation
- alias: Update hass
trigger:
platform: whatever
entity_id: whatever
# condition:
# condition: whatever
action:
service: shell_command.hass_update
1 Like
phillijw
(Joe Phillips)
7
How ironic is it that automation software doesn’t automatically update itself? 
this works on virtual env?
1 Like