Sensor template disappeared from my HA

Hi !
Has something changed in the last couple of months in the way custom templates are defined in configuration.yaml ? I used to have a custom sensor trigerred by my smartphone’s alarm clock, to run an automation in the morning.
However it doesn’t work anymore, I don’t see “reveil_loic” anymore in the developer tools.

See below.

Any idea ?

#Templates
template:
  - sensor:
    - name: reveil_loic
      state: >
        {% if not is_state('sensor.pixel_7_loic_next_alarm', 'unavailable') %}
          {%- set diff = states('sensor.pixel_7_loic_next_alarm')|as_timestamp - now()|as_timestamp -%}
          {%- if diff <= 3600 and diff >= 0 -%}
            on
          {% else %}
            off
          {% endif %}
        {% else %}
          off
        {% endif %}
    - name: reveil_alexa
      state: >
        {% if not is_state('sensor.pixel_7_alexa_next_alarm', 'unavailable') %}
          {%- set diff = states('sensor.pixel_7_alexa_next_alarm')|as_timestamp - now()|as_timestamp -%}
          {%- if diff <= 3600 and diff => 0 -%}
            on
          {% else %}
            off
          {% endif %}
        {% else %}
          off
        {% endif %}

Thanks !
Loic

The developer tool uses your browsers cookies to store data.
So every browser you will use, will show the latest edits you made on that machine/browser…
And I guess sometimes it will just loose track, and reset to default…

But the automation will never change

make sure sensor.pixel_7_alexa_next_alarm still exists. Also your template doesn’t check for unknown, which is a possible ‘bad’ state.

Lastly, make sure that the state from your sensor.pixel_7_alexa_next_alarm is a valid value for as_timestamp. as_timestamp requires a specific format for use. There’s a very good chance that the entities state may have changed depending on the integration. There has been an active effort to correct states on sensors with known device classes.