Command failed (with return code 1): iwlist wlan0 scan | grep ESSID

This is my sensor:

command_line:
  - sensor:
      name: Redes WiFi Disponibles
      command: "iwlist wlan0 scan | grep ESSID"
      value_template: "{{ value }}"

this the error in logs:
Command failed (with return code 1): iwlist wlan0 scan | grep ESSID

iwlist wlan0 scan | grep ESSID is running in terminal ¿why not from configuration.yaml?

I took a look inside the HA Core docker container (which is where this command would be run from) and the command/binary iwlist is not there.