Problem with template binary_sensors rendering in configuration

Hello,
When a setup several binary_sensors in configuration.yaml
only the few first ones are rendered, the others are just ignored…
No error message in logs nor in config checking.
i know i’m passing booleans to binary_sensor, but it usualy works…
And why the first ones are working and not the others, it looks like if HA stops rendering the next ones ?

Here is the configuration.yaml

template:
  - binary_sensor:
    - name: onkyo_mute_state
      unique_id: onkyo_mute_state      
      state: "{{ states('input_text.onkyo_amtqstn_response') == '01' }}"
    - name: onkyo_preset_1
      unique_id: onkyo_preset_1
      state: "{{ states('input_text.onkyo_prsqstn') == '1' }}"
    - name: onkyo_preset_2
      unique_id: onkyo_preset_2
      state: "{{ states('input_text.onkyo_prsqstn') == '2' }}"
    - name: onkyo_preset_3
      unique_id: onkyo_preset_3
      state: "{{ states('input_text.onkyo_prsqstn') == '3' }}"
    - name: onkyo_preset_4
      unique_id: onkyo_preset_4
      state: "{{ states('input_text.onkyo_prsqstn') == '4' }}"
    - name: onkyo_preset_5
      unique_id: onkyo_preset_5
      state: "{{ states('input_text.onkyo_prsqstn') == '5' }}"

Thanks for any help :slight_smile:
Eddy

PS: The script that sets the input_text is calling when needed by automation and is working fine:

onkyo_prsqstn:
  variables:
    temp: ""
  sequence:
  #----------------------------------------
  - service: shell_command.onkyo_command
    data:
      cmd: PRSQSTN
    response_variable: onkyo_response
  #----------------------------------------
  - if: "{{ onkyo_response['returncode'] == 0 }}"
    then:
      - service: input_text.set_value
        target:
          entity_id: input_text.onkyo_prsqstn
        data:
          value: >
            {% set temp = onkyo_response['stdout'] %}
            {{ temp.split("PRS")[1] | int(base=16)  }}
  #----------------------------------------
  mode: single

It looks like when preparing my binary sensors in config, i did make some mistakes that i corrected later BUT home assistant was still keeping the old erroneous IDs for these sensors and i had to :

  1. remove all these sensors from configuration (a copy to a clipboard to save the work…).
  2. reload full YAML config, check in entities and remove bad ones…
  3. copy clipboard back to config, reload full yaml config

And now, all new binary sensors are working fine :slight_smile:

So same sensors names with different “IDs” still in HA entities even if not present anymore in configuration.yaml were THE PROBLEM.

Exemple below: