[ Docker ] - Command line ping doesn't work for me

Hello,

I just copy exemple on the site to check if my Raspberry pi is connected. But is always off on home assistant.

If i write this line in bash of the docker it’s work :

ping -c 1 192.168.0.20 &> /dev/null && echo success || echo fail success

But this configuration doesn’t work :

binary_sensor:
  platform: command_line
  name: RPi_1
  command: ping -c 1 192.168.0.20 &> /dev/null && echo success || echo fail
  payload_on: "success"
  payload_off: "fail"

Thanks a lot for help me

As reference: github.com/balloob/home-assistant.io/pull/285

Piping commands is a shell feature. It is not supported when Home Assistant runs commands. Instead, just put that in a shell script and you’re all good.

Yes it’s work. Thanks a lot.

Do you think it’s the same problem with nmap component ?
nmap locator doesn’t work for me.