Files
homeassistant/packages/binary_sensor/puerta_tendedero.yaml
2021-01-17 12:52:07 +01:00

18 lines
684 B
YAML

binary_sensor:
- platform: template
sensors:
puerta_tendedero:
friendly_name: "Puerta Tendedero"
entity_id:
- binary_sensor.puerta_tendedero_primario
- binary_sensor.puerta_tendedero_secundario
value_template: >-
{% 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