Probleme depuis la mise à jour 2025.12.0

Bonjour,

Depuis la mise à jour, je pends la tête sur les fichiers suivants :

  • sensor.yaml
  • switch.yaml
  • binary_sensors.yaml

Erreur :

  • Invalid config for ‹ binary_sensor › at configuration.yaml, line 118: required key ‹ platform › not provided, please check the docs at Binary sensor - Home Assistant
  • Invalid config for ‹ sensor › at configuration.yaml, line 117: required key ‹ platform › not provided, please check the docs at Sensor - Home Assistant
  • Invalid config for ‹ switch › at configuration.yaml, line 123: required key ‹ platform › not provided, please check the docs at Switch - Home Assistant

Les erreurs :
lignes 118 : binary_sensor.yaml
ligne 117 : sensor.yaml
ligne 123 : switch.yaml

Mon binary_sensor.yaml :

binary_sensor:
  - platform: template
    sensors:
      berlingo:
        friendly_name: "Berlingo"
        unique_id: berlingo_securitas
        value_template: >-
          {{ 'E4:04:xx:xx:xx:xx (Renault R-Link)' in
             (state_attr('sensor.florent_bluetooth_connection', 'connected_paired_devices') | default([])) }}
        device_class: connectivity

      c3_aircross:
        friendly_name: "C3 AirCross"
        unique_id: c3_aircross
        value_template: >-
          {{ 'AC:xx:58:xx:xx:xx (BT_CITROEN)' in
             (state_attr('sensor.florent_bluetooth_connection', 'connected_paired_devices') | default([])) }}
        device_class: connectivity

      home_occupied:
        friendly_name: "Home Occupied"
        unique_id: home_occupied
        value_template: >-
          {{ (states.device_tracker | selectattr('state','equalto','home') | list | count) > 0 }}
        device_class: occupancy

  - platform: meteoalarm
    country: "FR"
    province: "xxxxxxxxxx"
    language: "fr-FR"

Mon sensor.yaml :

sensor:
  - platform: history_stats
    name: temps_allumage_pm_today_salon
    entity_id: binary_sensor.tv_salon
    unique_id: temps_allumage_auj_salon
    state: "on"
    type: time
    start: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}"
    end: "{{ now() }}"

  - platform: history_stats
    name: temps_allumage_pm_hier_salon
    entity_id: binary_sensor.tv_salon
    unique_id: temps_allumage_hier_salon
    state: "on"
    type: time
    end: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}"
    duration:
      hours: 24

  - platform: history_stats
    name: temps_allumage_pm_semaine_salon
    entity_id: binary_sensor.tv_salon
    unique_id: temps_allumage_semaine_salon
    state: "on"
    type: time
    start: "{{ (now().replace(hour=0, minute=0, second=0, microsecond=0) - timedelta(days=now().weekday())).timestamp() | int }}"
    end: "{{ now() }}"

  - platform: history_stats
    name: temps_allumage_pm_mois_salon
    entity_id: binary_sensor.tv_salon
    unique_id: temps_allumage_mois_salon
    state: "on"
    type: time
    start: "{{ now().replace(day=1, hour=0, minute=0, second=0, microsecond=0) }}"
    end: "{{ now() }}"

  - platform: history_stats
    name: temps_allumage_pm_today_manon
    entity_id: binary_sensor.amazon_dongle
    unique_id: temps_allumage_auj_manon
    state: "on"
    type: time
    start: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}"
    end: "{{ now() }}"

  - platform: history_stats
    name: temps_allumage_pm_hier_manon
    entity_id: binary_sensor.amazon_dongle
    unique_id: temps_allumage_hier_manon
    state: "on"
    type: time
    end: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}"
    duration:
      hours: 24

  - platform: history_stats
    name: temps_allumage_pm_semaine_manon
    entity_id: binary_sensor.amazon_dongle
    unique_id: temps_allumage_semaine_manon
    state: "on"
    type: time
    start: "{{ (now().replace(hour=0, minute=0, second=0, microsecond=0) - timedelta(days=now().weekday())).timestamp() | int }}"
    end: "{{ now() }}"

  - platform: history_stats
    name: temps_allumage_pm_mois_manon
    entity_id: binary_sensor.amazon_dongle
    unique_id: temps_allumage_mois_manon
    state: "on"
    type: time
    start: "{{ now().replace(day=1, hour=0, minute=0, second=0, microsecond=0) }}"
    end: "{{ now() }}"

  - platform: utility_meter
    name: distance_daily
    source: sensor.distance_parcourue
    cycle: daily

  - platform: utility_meter
    name: distance_monthly
    source: sensor.distance_parcourue
    cycle: monthly

  - platform: utility_meter
    name: distance_yearly
    source: sensor.distance_parcourue
    cycle: yearly

  - platform: rest
    name: "Distance Parcourue"
    resource: >-
      https://maps.googleapis.com/maps/api/distancematrix/json?origins={{ states('device_tracker.start') }}&destinations={{ states('device_tracker.end') }}&key={{ secrets.google_maps_api_key }}
    value_template: >-
      {% if value_json.rows | length > 0
         and value_json.rows[0].elements | length > 0
         and value_json.rows[0].elements[0].status == 'OK' %}
        {{ (value_json.rows[0].elements[0].distance.value / 1000) | round(2) }}
      {% else %}
        0
      {% endif %}
    unit_of_measurement: km

  - platform: rest
    name: "Latest Lightning Strike Area"
    resource: >-
      https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat={{ states('sensor.latest_lightning_strike_latitude') }}&lon={{ states('sensor.latest_lightning_strike_longitude') }}
    headers:
      User-Agent: HomeAssistant/1.0
    value_template: >-
      {{ value_json.address.suburb
         or value_json.address.city
         or value_json.address.town
         or value_json.address.village
         or value_json.address.state
         or value_json.display_name }}
    scan_interval: 3600

template:
  - sensor:
      - name: "État Berlingo"
        unique_id: berlingo_state
        state: >-
          {% if is_state('binary_sensor.berlingo', 'on') %}
            Activé
          {% elif is_state('binary_sensor.berlingo', 'off') %}
            Désactivé
          {% else %}
            Indisponible
          {% endif %}
        availability: "{{ not is_state('binary_sensor.berlingo', 'unavailable') }}"

      - name: "État C3 AirCross"
        unique_id: c3_aircross_state
        state: >-
          {% if is_state('binary_sensor.c3_aircross', 'on') %}
            Activé
          {% elif is_state('binary_sensor.c3_aircross', 'off') %}
            Désactivé
          {% else %}
            Indisponible
          {% endif %}
        availability: "{{ not is_state('binary_sensor.c3_aircross', 'unavailable') }}"

      - name: "Distance Florent-Maison"
        unique_id: distance_florent_home
        unit_of_measurement: km
        state: >-
          {% set florent_gps = state_attr('device_tracker.florent', 'gps') %}
          {% set home_gps = state_attr('zone.home', 'gps') %}
          {% if florent_gps and home_gps %}
            {{ distance(florent_gps, home_gps) }}
          {% else %}
            unknown
          {% endif %}

      - name: "Distance Parcourue"
        unique_id: travel_distance
        unit_of_measurement: km
        state: >-
          {{ state_attr('python_script.calculate_distance', 'distance') if state_attr('python_script.calculate_distance', 'distance') is not none else '0' }}

      - name: "Distance quotidienne"
        unique_id: daily_km
        unit_of_measurement: km
        state: "{{ states('sensor.daily_distance') }}"

      - name: "Distance mensuelle"
        unique_id: monthly_km
        unit_of_measurement: km
        state: "{{ states('sensor.monthly_distance') }}"

      - name: "Distance annuelle"
        unique_id: yearly_km
        unit_of_measurement: km
        state: "{{ states('sensor.yearly_distance') }}"

      - name: "Équipements au total"
        unique_id: total_devices
        state: >-
          {{ (state_attr('sensor.network_scanner', 'devices') | default([])) | count }}

      - name: "Home Occupied Details"
        unique_id: home_occupied_details
        state: >-
          {{ (expand('person') | selectattr('state','equalto','home') | list | count) > 0 }}
        attributes:
          is_home_full: >-
            {{ (expand('person') | selectattr('state','equalto','home') | list | count) ==
               (expand('person') | list | count) }}
          present_persons: >-
            {{ expand('person') | selectattr('state','equalto','home') | map(attribute='attributes.friendly_name') | list | sort }}

      - name: "Latest Lightning Strike Entity ID"
        unique_id: latest_lightning_strike_entity_id
        state: >-
          {% set strikes = states.geo_location | selectattr('entity_id','search','geo_location.lightning_strike_') | sort(attribute='last_updated', reverse=true) | list %}
          {{ strikes[0].entity_id if strikes else 'none' }}

      - name: "Latest Lightning Strike Latitude"
        unique_id: latest_lightning_strike_latitude
        state: >-
          {% set id = states('sensor.latest_lightning_strike_entity_id') %}
          {% if id and id != 'none' and states(id) is defined %}
            {{ state_attr(id, 'latitude') }}
          {% else %}
            unknown
          {% endif %}

      - name: "Latest Lightning Strike Longitude"
        unique_id: latest_lightning_strike_longitude
        state: >-
          {% set id = states('sensor.latest_lightning_strike_entity_id') %}
          {% if id and id != 'none' and states(id) is defined %}
            {{ state_attr(id, 'longitude') }}
          {% else %}
            unknown
          {% endif %}

      - name: "Moyennes par matiere"
        unique_id: moyennes_par_matiere
        state: >-
          {% set grades = state_attr('sensor.ecole_directe_eleve', 'grades') | default([]) %}
          {% set subjects = ['Technologie','Sciences vie & terre','Physique-chimie','Latin','Education physique & sport','Enseignement moral & civique','Arts plastiques','Histoire-géographie','Education musicale','Anglais','Français','Mathématique','Espagnol'] %}
          {% set result = {} %}
          {% for matiere in subjects %}
            {% set notes = grades | selectattr('subject','equalto',matiere) | list %}
            {% if notes %}
              {% set somme_pond = 0 %}
              {% set somme_coef = 0 %}
              {% for n in notes %}
                {% set somme_pond = somme_pond + (n.value | float * (n.coefficient | float)) %}
                {% set somme_coef = somme_coef + (n.coefficient | float) %}
              {% endfor %}
              {% if somme_coef > 0 %}
                {% set _ = result.update({matiere: (somme_pond / somme_coef) | round(2)}) %}
              {% endif %}
            {% endif %}
          {% endfor %}
          {{ result | tojson }}

      - name: "OpenStreetMap Reverse Florent"
        unique_id: openstreetmap_reverse_florent
        state: >-
          {% set lat = state_attr('person.florent', 'latitude') %}
          {% set lon = state_attr('person.florent', 'longitude') %}
          {{ (lat ~ ', ' ~ lon) if lat is not none and lon is not none else 'unknown' }}

      - name: "OpenStreetMap Reverse Manon"
        unique_id: openstreetmap_reverse_manon
        state: >-
          {% set lat = state_attr('person.manon', 'latitude') %}
          {% set lon = state_attr('person.manon', 'longitude') %}
          {{ (lat ~ ', ' ~ lon) if lat is not none and lon is not none else 'unknown' }}

      - name: "OpenStreetMap Reverse Sylvie"
        unique_id: openstreetmap_reverse_sylvie
        state: >-
          {% set lat = state_attr('person.sylvie_d_amour', 'latitude') %}
          {% set lon = state_attr('person.sylvie_d_amour', 'longitude') %}
          {{ (lat ~ ', ' ~ lon) if lat is not none and lon is not none else 'unknown' }}

      - name: "OpenStreetMap Reverse Louis"
        unique_id: openstreetmap_reverse_louis
        state: >-
          {% set lat = state_attr('person.louis', 'latitude') %}
          {% set lon = state_attr('person.louis', 'longitude') %}
          {{ (lat ~ ', ' ~ lon) if lat is not none and lon is not none else 'unknown' }}

Mon switch.yaml :

 switch:
  - platform: template
    switches:
    
    Prise_Cafetière:
        unique_id: prise_cafetiere
        state: "{{ is_state('binary_sensor.prise_cafetiere','on') }}"
        turn_on:
          service: switch.turn_on
          target:
            entity_id: switch.prise_cafetiere
        turn_off:
          service: switch.turn_off
          target:
            entity_id: switch.prise_cafetiere

    Prise_Manon:
        unique_id: prise_manon
        state: "{{ is_state('binary_sensor.prise_manon', 'on') }}"
        turn_on:
          service: switch.turn_on
          target:
            entity_id: switch.prise_manon_prise
        turn_off:
          service: switch.turn_off
          target:
            entity_id: switch.prise_manon_prise

Quelqu’un peut il m’expliquer pourquoi depuis la version 2025.12 faut il mettre la platform alors qu’avant c’était pas obligatoire pour le fonctionnement ?

Ensuite ai je fais une bêtise quelque par qui justifie le problème des platforms non fournie ?

Merci de votre aide, je suis dessus depuis 48h; et je n’arrive pas à comprendre.

Ma configuration


  • Méthode d’installation : Home Assistant OS
  • Core2025.12.0
  • Supervisor2025.12.2
  • Operating System16.3
  • Interface utilisateur20251105.1[/center]

C’est l’ancienne façon de faire des template. Tu as plusieurs poste dessus. Il y a une tolérance de fonctionnement jusqu’à juin prochain

Tu as toutes les explications dans le changelog :

1 « J'aime »