Hi I want to run this python script with a command line switch:
import serial
ser = serial.Serial('/dev/ttyS1', 9600)
ser.write(bytearray('5','ascii'))
here is my conf
switch:
platform: command_line
switches:
arest_pin_four:
command_on: "/usr/bin/python3 --version"
command_off: "/usr/bin/python3 /home/homeassistant/testSerial.py"
so this is a test but the on command works (easy of course)
but the off fails
[homeassistant.components.switch.command_line] Command failed:/usr/bin/python3 /home/homeassistant/testSerial.py
what is strange is that the command works in shell interface (with the user homeassistant): /usr/bin/python3 /home/homeassistant/testSerial.py