Hi, im having problems with a switch command_line. Currently I have this code:
switch: platform: command_line switches: test: command_on: 'echo "1">my_switch' command_off: 'echo "0">my_switch' command_state: 'cat my_switch' value_template: '{{ value ==1 }}' ep: command_on: "curl -i -m 1 http://xxxxx -s " command_off: "curl -i -m 1 http://xxxxx -s" value_template: '{{ return_value == "" }}'
I have Hasbian image on a RPI2
when I toggle the switch the command is executed successfuly, the curl is reported on my webserver, but no my_switch file gets created, or any other component that uses command_line it generates the following error.
homeassistant.components.switch.command_line: Command failed:
for the test and ep: so the sensor always returns to off.
Checked with my standard user executing these commands doing a su to homeassistant user and it executes with no problem
Also have a sensor
sensor:
- platform: command_line
command: “grep -c ‘invalidpassword’ /home/homeassistant/.homeassistant/home-assistant.log”
name: badlogin
also reports
homeassistant.components.sensor.command_line: Command failed: grep -c ‘invalidpassword’ /home/homeassistant/.homeassistant/home-assistant.log
My intuition suggests that it is a problem with the execution rights of the user of hassbian. Any ideas with this ??
Thanks,
Camilo