I’ve been trying to figure out what I’m doing wrong for quite some time now, I’ll try to post anything related to it, but please ask if you need more info
Configuration.yaml
https://github.com/martikainen87/HomeAssistant/blob/master/configuration.yaml
/home/homeassistant/shell_commands.yaml
I’ve installed HA in virtual environment according to Installation - Home Assistant
and everything else is working like a charm!
The script ‘plexmount.sh’ can be executed via ssh with both my homeassistant user and default “pi”, i’ve tried placing the .sh script in different folders /home/pi/, /home/.homeassistant/shell_commands/ ) and made sure that they have full priviligies during the testing.
running it in ssh console
both users “homeassistant” (the user running HA) and “pi” has full access
script works (it connects to another linux server and tries to mount some folders, they are already mounted as you can see) with both users
pi@hassbian:/home/homeassistant $ sh plexmount.sh
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the ‘nonempty’ mount option
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the ‘nonempty’ mount option
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the ‘nonempty’ mount option
pi@hassbian:/home/homeassistant $ sudo su -s /bin/bash homeassistant
homeassistant@hassbian:~ $ sh plexmount.sh
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the ‘nonempty’ mount option
dev-services
I can execute the shell command /dev-service by chosing
Domain: shell_command
service: plex_mount_drives
auth.log at other server after executing it from /dev-service
Mar 2 16:09:13 Plexi sshd[8433]: Accepted password for homeassistant from 192.168.1.4 port 48626 ssh2
Mar 2 16:09:13 Plexi sshd[8433]: pam_unix(sshd:session): session opened for user homeassistant by (uid=0)
Mar 2 16:09:13 Plexi systemd-logind[1230]: New session 18 of user homeassistant.
Mar 2 16:09:13 Plexi sshd[8478]: Received disconnect from 192.168.1.4 port 48626:11: disconnected by user
Mar 2 16:09:13 Plexi sshd[8478]: Disconnected from 192.168.1.4 port 48626
Mar 2 16:09:13 Plexi sshd[8433]: pam_unix(sshd:session): session closed for user homeassistant
Mar 2 16:09:13 Plexi systemd-logind[1230]: Removed session 18.
but no matter what i try i can’t get the script to execute the shell_command from the web front. I’ve tried setting single quoutes ’ ’ for the location of the script, like this plex_mount_drives: ‘/home/homeassistant/plexmount.sh’
All my config is available at github, https://github.com/martikainen87/HomeAssistant if you wanna take a look
Any suggestion?