Command line switch with a binary_sensor as state?

I’ve made a binary sensor that is set when a command is 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
        friendly_name: Spøgelse
        command_on: "ssh -f -i /config/ssh_keys/badspejl.sshkey -o StrictHostKeyChecking=no [email protected] sudo /home/pi/"
        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?