Kodi CEC not working

Trying to use this to control my TV on/off using the cec client. It works exactly as I’d hoped when I use putty to login to the rpi3 with kodi on, but when I try and do it via the below HA code nothing happens.

  • platform: command_line
    switches:
    tv_kodi:
    command_on: ssh [email protected].## “echo ‘on 0’ | cec-client -s”
    command_off: ssh [email protected].## “echo ‘standby 0’ | cec-client -s”