Last update state stop working since last update

Good evening.

Long time ago I just copy and paste how to configure last updates sensors inside a sensor.yaml. It was working fine, but it looks since last upgrade, all of them are not working and I don´t know why.

I asked on reddit, and the only answer was the entity_id was missing, but I put it and restart it and still the same, it looks like they don´t exist anymore. Can someone help me please?

platform: template
sensors:
    hvac_heat_sensor:
        friendly_name: Hvac Heating
        value_template: >
            {% if is_state_attr('climate.home', 'hvac_action', 'heating') %}
            on
            {% else %}
            off
            {% endif %}

    puerta_principal_contact:
        entity_id: binary_sensor.puerta_principal_contact
        friendly_name: "Door last opened:"
        value_template: >
            {{ as_timestamp(states.binary_sensor.puerta_principal_contact.last_changed) | timestamp_custom('%H %M',True)  }}
    door_window_sensor_158d0003176782:
        friendly_name: "Window last opened:"
        value_template: >
            {{ states.binary_sensor.door_window_sensor_158d0003176782.last_changed.strftime('%H:%M %d/%m') }}

The second one was the new style with the entity id and the 3rd was the old style.

Thank you in advance

The entity_id will get deprecated in the next HA release.

What do the templates show if you copy and paste them in Dev Tools/Templates?

yes, was showing what should do.

SOmeone told me to check the history (like any normal person have to check the first) and there was telling me that I have a duplicate sensor in the config. I put some lines to track parcels and that kills the other ones.

As soon as I took them up, everything is showing again…

Thank you!