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