Command_line encore et toujours

Bonjour, juste une petite info.
Sur mon raspi 4, je viens de passer la Home Assistant 2023.6.1
Supervisor 2023.06.2 Operating System 10.2
Quand je corrige mon configuration.yaml

# Speedtest
  - platform: command_line
    name: "SpeedTest CLI Data"
    unique_id: speedtest_cli_data
    command: "/config/3rdparty/speedtest/speedtest --format=json --accept-license --accept-gdpr"
    # Every 4 hours, 60 * 60 * 4 = 14400
    scan_interval: 14401
    command_timeout: 60
    value_template: >-
      {{ 
        { 
          "ping": value_json.ping.latency, 
          "download": value_json.download.bandwidth, 
          "upload": value_json.upload.bandwidth,
          "isp": value_json.isp,
          "country": value_json.server.country,
          "location": value_json.server.location,
          "id": value_json.server.id,
          "server_name": value_json.server.name,
          "server_host": value_json.server.host
        }
        | to_json 
      }}

par

command_line:
  - sensor:
      name: "SpeedTest CLI Data"
      unique_id: speedtest_cli_data
      command: "/config/3rdparty/speedtest/speedtest --format=json --accept-license --accept-gdpr"
      # Every 4 hours, 60 * 60 * 4 = 14400
      scan_interval: 14401
      command_timeout: 60
      value_template: >-
        {{ 
          { 
            "ping": value_json.ping.latency,
            "download": value_json.download.bandwidth,
            "upload": value_json.upload.bandwidth,
            "server_name": value_json.server.name,
            "server_host": value_json.server.host,
            "url": value_json.result.url
          }
          | to_json
        }}

J’ai des erreurs dans tous les sens.
S je remets mon code de départ, tout fonctionne bien mais j’ai juste le message dans paramètres de la correction à faire

Command Line YAML configuration has moved

Euh j’ai loupé quelque chose???
Merci à tous

Bonjour,
quand tu met le code au nouveau format, tu supprime bien le code de l’ancien format?

C’est quoi les erreurs ?

Bonjour,

Pour ma part, j’ai créé un fichier command_line.yaml où j’ai intégré les sensors (sans command-line au départ)

Comme un des tiens :

 - sensor:
      name: "SpeedTest CLI Data"
      unique_id: speedtest_cli_data
      command: "/config/3rdparty/speedtest/speedtest --format=json --accept-license --accept-gdpr"
      # Every 4 hours, 60 * 60 * 4 = 14400
      scan_interval: 14401
      command_timeout: 60
      value_template: >-
        {{ 
          { 
            "ping": value_json.ping.latency,
            "download": value_json.download.bandwidth,
            "upload": value_json.upload.bandwidth,
            "server_name": value_json.server.name,
            "server_host": value_json.server.host,
            "url": value_json.result.url
          }
          | to_json
        }}

Dans configuration.yaml j’ai ajouté la ligne command_line: !include command_line.yaml

Ta la méthode que @R_hum1 parle d’écris ici Intégrer Speedtest CLI Officielle à Home Assistant - #151 par WarC0zes

Bizarre, j’ai déplacé mes lignes vers la fin du configuration.yaml et c’est tout bon…
Par contre l’astuce de @R_hum1 ne fonctionne pas pour moi (Peut-être un problème d’indentation)