I’ve made a binary sensor that is set when a command is running.
binary_sensor.ghostvideo_running
which is set to on and off in the script (via MQTT).
Then in the command line switch I did this:
- platform: command_line
switches:
ghost_in_mirror:
friendly_name: Spøgelse
command_on: "ssh -f -i /config/ssh_keys/badspejl.sshkey -o StrictHostKeyChecking=no [email protected] sudo /home/pi/randomfile.sh"
command_timeout: 10
value_template: "{{ is_state('binary_sensor.ghostvideo_running', 'on') }}"
Shouldn’t that mean that if I switch the binary sensor on, then the switch will be shown as on?