Configuring command line sensor using yaml has moved, after Home Assistant 2023 update.
This gist is guiding you how to perform a quick fix.
configuration.yml:
binary_sensor: !include sensors.yaml
sensors.yml
- platform: command_line
name: "Port Open"
command: '/usr/bin/nmap -p<port> <ip> | /bin/grep open > /dev/null && (echo true) || (echo false)'
device_class: connectivity
payload_on: "true"
payload_off: "false"
Just change 'binary_sensor' section to 'command_line' in your configuration.yml.
configuration.yml:
command_line: !include sensors.yaml
besides, replace 'platform: command_line' to 'binary_sensor:' the your sensors.yaml.
sensors.yaml
- binary_sensor:
name: "Port Open"
command: '/usr/bin/nmap -p<port> <ip> | /bin/grep open > /dev/null && (echo true) || (echo false)'
device_class: connectivity
payload_on: "true"
payload_off: "false"
Every thing should be restored again. :)