49 lines
1.1 KiB
YAML
49 lines
1.1 KiB
YAML
homeassistant:
|
|
customize:
|
|
package.node_anchors:
|
|
common: &common
|
|
package: 'reminders'
|
|
|
|
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
|
|
trigger:
|
|
platform: state
|
|
entity_id: switch.kaffebryggare
|
|
to: 'on'
|
|
for:
|
|
minutes: 5
|
|
action:
|
|
- service: notify.ios_thomas_iphone
|
|
data:
|
|
title: "Fikadax!"
|
|
message: "Kaffet är färdigt!"
|