I can’t seem to get my shell command to run, and I’m not sure why. Here is my config:
script:
vpn_on:
alias: Turn VPN on
sequence:
- service: shell_command.vpn_on
shell_command:
vpn_on: ssh [email protected] "vbash /config/scripts/vpnon.sh"
vpn_off: ssh [email protected] "vbash /config/scripts/vpnoff.sh"
Here is my log output when I trigger the “Turn VPN on” script via the Home Assistant front end.
2017-11-25 18:02:08 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=script, service=turn_on, service_data=entity_id=script.vpn_on, service_call_id=4373756504-24>
2017-11-25 18:02:08 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=script, service=vpn_on, service_data=None, service_call_id=4373756504-25>
2017-11-25 18:02:08 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=4373756504-24>
2017-11-25 18:02:08 INFO (MainThread) [homeassistant.helpers.script] Script Turn VPN on: Running script
2017-11-25 18:02:08 INFO (MainThread) [homeassistant.helpers.script] Script Turn VPN on: Executing step call service
2017-11-25 18:02:08 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=shell_command, service=vpn_on, service_data=, service_call_id=4373756504-26>
2017-11-25 18:02:08 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=4373756504-26>
2017-11-25 18:02:08 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=4373756504-25>
2017-11-25 18:02:08 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=script.vpn_on, old_state=<state script.vpn_on=off; last_triggered=2017-11-25T17:28:34.902372+00:00, friendly_name=Turn VPN on @ 2017-11-12T15:54:57.089196+00:00>, new_state=<state script.vpn_on=off; last_triggered=2017-11-25T18:02:08.245378+00:00, friendly_name=Turn VPN on @ 2017-11-12T15:54:57.089196+00:00>>
I have verified that I can run ssh [email protected] "vbash /config/scripts/vpnon.sh"
from the server outside of home assistant, so I know that it works. I’m just not sure whey I can’t get home assistant to do it. Any assistance would be appreciated. Thank you!