Command line as a switch

can anybody help me what is wrong with my switch? I try to toggle it but there is no response as if it was locked. Switch doesn’t change state and shows no errors. I’ve tried several variants with quotations and path before sshpass but without success. In HAS terminal works great.
Thank you in advance.

command_line:
  - switch:
      name: screenwaker
      unique_id: screen_waker
      command_on: "/usr/bin/sshpass -ppassword ssh [email protected] 'export DISPLAY=:0.0 ;sleep 1; xset dpms force on'"
      command_off: "/usr/bin/sshpass -ppassword ssh [email protected] 'export DISPLAY=:0.0 ;sleep 1; xset dpms force off'"

From my experience of using command line as a switch on another machine I had to use SSH keys and not a password. This is an example of my command on to give an idea of the layout. You can enter the password in a shell yourself but I don’t think there is a way of using it in YAML.

command_on: "ssh -i /config/ssh_keys/key1 -o 'StrictHostKeyChecking=no' [email protected] 'uci set wireless.radio0.disabled=0; uci commit wireless; wifi reload'"
1 Like