When I try to run that shell_command via Developer Tools | Actions I get this:
stdout: ""
stderr: "/bin/sh: magick: not found"
returncode: 127
However, running the same command from the SSH Terminal addon or an SSH terminal from a remote PC the magick executable works as expected.
As I understand it, the shell_command is executed in the /config folder?
From this point, where is the magick executable? Do I include this full path to magick in my config.yaml?
The problem is that the imagemagick has to run within the Home Assistant Core container, instead of the ssh container. The other problem is when you update HA Core, the installed imagemagick is deleted and has to be re-installed.
To install imagemagick in HA Core including after an update, here is what I do:
create a shell command file (I named mine add_imagemagick.sh) under config/shell_commands that contains the following:
#!/bin/bash
if ! test -f "/usr/bin/convert"; then
apk add imagemagick
fi
Note: technically you could instead test for the presence of the file /usr/bin/magick instead of /usr/bin/convert as convert is now just a symbolic link to the real file magick.