FIX template change for datetime

This commit is contained in:
dfcarvajal
2021-01-17 12:52:07 +01:00
parent 7be321f4df
commit 6b5e7474c8

View File

@@ -7,6 +7,11 @@ binary_sensor:
- binary_sensor.puerta_tendedero_primario - binary_sensor.puerta_tendedero_primario
- binary_sensor.puerta_tendedero_secundario - binary_sensor.puerta_tendedero_secundario
value_template: >- value_template: >-
{{ is_state('binary_sensor.puerta_tendedero_primario','on') or is_state('binary_sensor.puerta_tendedero_secundario','on') }} {% if as_timestamp(states.binary_sensor.puerta_tendedero_secundario.last_changed) <=
as_timestamp(states.binary_sensor.puerta_tendedero_primario.last_changed) -%}
{{ states('binary_sensor.puerta_tendedero_primario') }}
{%- else -%}
{{ states('binary_sensor.puerta_tendedero_secundario') }}
{%- endif -%}
device_class: door device_class: door