From 2d8b32eef9608fd23e7224b6cd12ef81b5128ebc Mon Sep 17 00:00:00 2001 From: Kevin Eifinger Date: Sun, 23 Dec 2018 15:18:08 +0100 Subject: [PATCH] alarm_time now set by hassalarm --- sensor.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sensor.yaml b/sensor.yaml index 4ab6dabc..c1e8932f 100644 --- a/sensor.yaml +++ b/sensor.yaml @@ -694,10 +694,12 @@ sensors: alarm_time: friendly_name: 'Uhrzeit' - value_template: '{{ "%0.02d:%0.02d" | format(states("input_number.alarmhour") | int, states("input_number.alarmminutes") | int) }}' + value_template: '{%if states.device_tracker.sina.state == "home" and states.device_tracker.kevin.state == "home" %}{% if as_timestamp(states.sensor.alarm_kevin.state) > as_timestamp(states.sensor.alarm_sina.state) %}{{states.sensor.alarm_kevin.state}}{% else %}{{states.sensor.alarm_sina.state}}{% endif %}{% elif states.device_tracker.sina.state == "home" %}{{states.sensor.alarm_sina.state}}{% elif states.device_tracker.kevin.state == "home" %}{{states.sensor.alarm_kevin.state}}{% endif %}' entity_id: - - input_number.alarmhour - - input_number.alarmminutes + - device_tracker.sina + - device_tracker.kevin + - sensor.alarm_kevin + - sensor.alarm_sina ################################################################# ## Broadlink #################################################################