Binary_sensor command_line is gonna be depraceted soon?

Hello,

I use a binary_sensor command_line to check if an app is running by scanning an ip address and a port.

This is my configuration.yaml :

  - platform: command_line
    name: Plex Statut
    unique_id: binary_sensor.plex_statut
    command: /bin/bash -c "(echo > /dev/tcp/192.168.1.1/32400) > /dev/null 2>&1 && echo on || echo off"
    device_class: connectivity
    payload_on: on
    payload_off: off
    command_timeout: 15
    scan_interval: 10

It is working great but i get a message saying i need to move my configuration from yaml because the next update will break it.
But where should i need to put it and can i keep the same code ?

Thanks !

Just needs to be moved and updated.

Something like this I believe but you’ll need to validate the options. I literally did this from memory.

command_line:
  - binary_sensor:
      command: /bin/bash -c "(echo > /dev/tcp/192.168.1.1/32400) > /dev/null 2>&1 && echo on || echo off"
      unique_id: binary_sensor.plex_statut
      name: Plex Statut
      device_class: connectivity
      payload_on: on
      payload_off: off
      command_timeout: 15
      scan_interval: 10
1 Like

Oh thank you i though i need to move it to a helper.