Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Command_line switch SSH commands failing after upgrade to 107

$
0
0

@ryanm7780 wrote:

After installing 0.107.0b0, my command_line switches executing SSH commands no longer work. I just receive a “command failed” message in the logs.

I’m using HA to control several Raspberry Pis connected to TVs throughout the house to turn them on and off on different events (motion, etc.) using CEC. This config has worked until 107:

  - platform: command_line
    switches:
        livingroomtv_power:
          command_on: 'ssh pi@192.168.86.11 -i id_rsa -o StrictHostKeyChecking=no ''echo on 0 | cec-client -s -d 1 && echo as | cec-client -s -d 1'''
          command_off: 'ssh pi@192.168.86.11 -i id_rsa -o StrictHostKeyChecking=no ''echo standby 0 | cec-client -s -d 1'''
          command_state: "tvstatus() { local RESULTS; RESULTS=$(ssh pi@192.168.86.11 -i id_rsa -o StrictHostKeyChecking=no \"echo pow 0 | cec-client -s -d 1 | grep -q 'power status: on'\"); echo $?; }; tvstatus"
          value_template: '{{ value == "0" }}'
          friendly_name: Living Room TV        

When I try to turn the switch on, this is the error I get in the logs:

[homeassistant.components.command_line.switch] Command failed: ssh pi@192.168.86.11 -i id_rsa -o StrictHostKeyChecking=no 'echo on 0 | cec-client -s -d 1 && echo as | cec-client -s -d 1'

I’ve tried altering the quotes in the command to use single instead of double quotes, since the documentation said that’s preferred, but it has no effect. Any ideas what could be causing this? It doesn’t look like the command_line integration code itself has changed in a couple of months, so I would think this has to be something about how the new 107 versions interact with it.

Thanks in advance for any help you can provide!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>