2 of 7 template sensors are not created

I correctly receive 7 MQTT topics. These are temperature readings.
I calibrate them using templates.
For 5 out of 7 the calibrated sensors are created. I can find them in developers tools status.
2 however are not created, these are:
- nefit_retourtemp_gecorrigeerd:
- nefit_aanvoertemp_gecorrigeerd:

Why are the latter 2 missing?

There are no errors reported.

Regards,
Rinus

My sensor.yaml file:

####### sensor.yaml
- platform: template
  sensors: 
### elga temperatuur sensoren corrigeren ()ijken)
    buitentemp_gecorrigeerd:
      unit_of_measurement: °C
      value_template: "{{((states ('sensor.buitentemperatuur_elga')|float/1-0)|round(1)) }}"
      unique_id: buitentemp_gecorrigeerd

    elga_aanvoertemp_gecorrigeerd:
      unit_of_measurement: °C
      value_template: "{{((states ('sensor.elga_aanvoer_temp')|float/1-0)|round(1))}}"
      unique_id: elga_avt_gecorrigeerd

    elga_retourtemp_gecorrigeerd:
      unit_of_measurement: °C
      value_template: "{{((states ('sensor.elga_retour_temp')|float/1-0)|round(1))}}"
      unique_id: elga_rt_gecorrigeerd

    cv_aanvoertemp_gecorrigeerd:
      unit_of_measurement: °C
      value_template: "{{((states ('sensor.cv_avt_temp')|float/1-0)|round(1))}}"
      unique_id: cv_avt_gecorrigeerd

    cv_retourtemp_gecorrigeerd:
      unit_of_measurement: °C
      value_template: "{{((states ('sensor.cv_rt_temp')|float/1-0)|round(1))}}"
      unique_id: cv_rt_gecorrigeerd

    nefit_aanvoertemp_gecorrigeerd:
      unit_of_measurement: °C
      value_template: "{{((states ('sensor.nefit_avt_temp')|float/1-0)|round(1))}}"
      unique_id: nefit_avt_gecorrigeerd

    nefit_retourtemp_gecorrigeerd:
      unit_of_measurement: °C
      value_template: "{{((states ('sensor.nefit_rt_temp')|float/1-0)|round(1))}}"
      unique_id: nefit_rt_gecorrigeerd

My mqqt.yaml file:

mqtt:
  sensor:
    # elga
  - name: "elga_avt"
    state_topic: "esp32-elga/elga_avt"
    unique_id:  "esp32-elga/elga_avt"
    state_class: measurement
    unit_of_measurement: °C 
    device_class: temperature
  - name: "elga_rt"
    state_topic: "esp32-elga/elga_rt"
    unique_id:  "esp32-elga/elga_rt"
    state_class: measurement
    unit_of_measurement: °C
    device_class: temperature
  - name: "nefit_avt"
    state_topic: "esp32-elga/nefit_avt"
    unique_id:  "esp32-elga/nefit_avt"
    state_class: measurement
    unit_of_measurement: °C
    device_class: temperature
  - name: "nefit_rt"
    state_topic: "esp32-elga/nefit_rt"
    unique_id:  "esp32-elga/nefit_rt"
    state_class: measurement
    unit_of_measurement: °C
    device_class: temperature
  - name: "cv_avt"
    state_topic: "esp32-elga/cv_avt"
    unique_id:  "esp32-elga/cv_avt"
    state_class: measurement
    unit_of_measurement: °C
    device_class: temperature
  - name: "cv_rt"
    state_topic: "esp32-elga/cv_rt"
    unique_id:  "esp32-elga/cv_rt"
    state_class: measurement
    unit_of_measurement: °C
    device_class: temperature   
  - name: "buitentemperatuur"
    state_topic: "esp32-elga/buitentemp"
    unique_id:  "esp32-elga/buitentemp"
    state_class: measurement
    unit_of_measurement: °C
    device_class: temperature

I don’t use mqtt so most of this is speculation, but your mqtt sensor ids do not seem to match with the names used in the templates. So my guess is that that they may be undefined. On top of that you use a float filter without a (now required) default. in that case float will produce an error, which may result in the sensor not being created. So check the sensors you mention are actually defined, and replace the float filter with for instance float(0) and see what happens. Oh, and round also seems to need a default:

Thank you for the reply.

To my opinion that is not the cause of the missing sensors.
I removed all of the float en round operations for these 2 sensors. Still they are not created.
But thank you for the tip anyway

After some trial end error I have found a way to solve it.
I verified the mqtt topic names sent by the esp32 board and the mqtt.yaml.
It apprears that the unique_id and the state_topic name must differ.
The difference now is a “-” vs a “_”.
That does it. It is working now.

mqtt:
  sensor:
    # elga

  - name: "nefit_avt"
    state_topic: "esp32-elga/nefit_avt"
    unique_id:  "esp32-elga/nefit-avt"
    state_class: measurement
    unit_of_measurement: °C
    device_class: temperature
  - name: "nefit_rt"
    state_topic: "esp32-elga/nefit_rt"
    unique_id:  "esp32-elga/nefit-rt"
    state_class: measurement
    unit_of_measurement: °C
    device_class: temperature

etc.....[

 Thank  you,