Keep track of when to put out the bins

This commit is contained in:
Thomas Lovén 2019-03-06 22:21:41 +01:00
parent 0faa4b9a77
commit 668b2b6ed6

View File

@ -7,6 +7,31 @@ homeassistant:
automation.rem_kaffet_ar_klart:
<<: *common
binary_sensor:
- platform: template
sensors:
sopor:
friendly_name: Sopor
icon_template: >-
{% if is_state('binary_sensor.sopor', 'on') %}
mdi:delete
{% else %}
mdi:delete-outline
{% endif %}
value_template: >-
{% set retval = False %}
{% if (states('sensor.week') | int) % 2 == 0 %}
{% if now().weekday() == 6 %}
{% set retval = True %}
{% endif %}
{% else %}
{% if now().weekday() == 0 and now().hour < 12 %}
{% set retval = True %}
{% endif %}
{% endif %}
{{retval}}
automation:
- alias: REM - Kaffet är klart
initial_state: True