I am trying to make an automation that when triggered, does a wget command for a URL. I tried to do do this all in the configuration.yaml file but since it has a “&” in it fails. In Discord, it was reccomended to me to make a bash script but I cannot seem to get that to work either. I now get an exit code of “2” with the following setup.
The command that I am trying to run:
wget 'http://192.168.1.80/admin?profile=1&lock=1&user=user&pw=pw' -O arm.txt
My configuration.yaml file
shell_command:
lotbot_motion_arm: sh ./usr/bin/lotbot_motion_arm.sh
My /usr/bin/lotbot_motion_arm.sh file
#!/bin/bash
# Trigger Blue Iris to Set to Profile 1 and not lock
/usr/bin/wget 'http://192.168.1.80/admin?profile=1&lock=1&user=user&pw=pw' -O arm.txt
From the Log
2018-11-30 17:09:59 ERROR (MainThread) [homeassistant.components.shell_command] Error running command:
sh ./usr/bin/lotbot_motion_arm.sh, return code: 2