complete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line at line 108, column 133:
… webmin --full | grep -oc “Active: active”
Isn’t your command missing some quotes? You’re trying to run the command systemctl status kodi --full on the other machine right? But you haven’t wrapped it in quotes like the others. Your command_on for example is this:
Also just an FYI, it looks like you generated id_rsa inside the normal .ssh folder in the home directory (which is actually /root/.ssh). If so, you need to move it out of there.
The /root folder is wiped every time HA updates so your sensor will break every update when your id_rsa file is wiped away. You should move any files you rely on somewhere inside the /config folder since that is preserved through updates and then reference the file there with the -i flag.
You need to mount the key to the docker container, the directory you are showing is on the host machine, to which the docker container doesnt have access.
Because of your double quotes, put the whole ssh command in double quotes.
Inside the command used double quotes or backslash characters you have to escape with the \ (backslash character), see my ssh command to start and run VLC on a Windows machine using the task scheduler. Good luck
FYI for future reference, the home assistant CLI is an add-on which means it is a separate docker container from HA application itself. It has its own set of dependencies and filesystem other then the few shared folders such as /share and /config. So the fact that your command works when running it while ssh’ed in to the HA using one of the Terminal & SSH add-ons actually doesn’t tell you anything about whether it will work when run from HA using a command line sensor or shell command.
If you plan to do a lot of command line sensors and shell commands my advice is to install the Portainer add-on. That will let you get to the homeassistant container (which is what actually runs HA) and access the console within that container. Then you can test your commands from there since that is running that command in the exact same way HA will be. If a command works in the console within the homeassistant container then you know it will work from a sensor or shell command.
Well as long as its not relying on a file outside of /config, /share or any of the folder subsystems which actually persist over update. That’s the other gotcha to watch out for like I mentioned earlier, since it will appear to work in that case but break next update.