Fix dishwasher remote-control reminder OR logic and timestamp
This commit is contained in:
@@ -99,17 +99,31 @@
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: "{{ now().hour >= 19 and now().hour <= 21 }}"
|
||||
- condition: state
|
||||
entity_id: binary_sensor.dishwasher_fjernbetjening
|
||||
state: "off"
|
||||
- condition: template
|
||||
value_template: "{{ is_state('sensor.dishwasher_status_2', 'Off') }}"
|
||||
- condition: state
|
||||
entity_id: binary_sensor.dishwasher_dor
|
||||
state: "off"
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.dishwasher_fjernbetjening
|
||||
state: "off"
|
||||
- condition: template
|
||||
value_template: "{{ not is_state('binary_sensor.dishwasher_dor', 'off') }}"
|
||||
|
||||
action:
|
||||
- variables:
|
||||
reminder_time: "{{ now().strftime('%d-%m %H:%M') }}"
|
||||
remote_off: "{{ is_state('binary_sensor.dishwasher_fjernbetjening', 'off') }}"
|
||||
door_not_closed: "{{ not is_state('binary_sensor.dishwasher_dor', 'off') }}"
|
||||
issue_text: >
|
||||
{% set issues = [] %}
|
||||
{% if remote_off %}
|
||||
{% set issues = issues + ['remote control er ikke slået til'] %}
|
||||
{% endif %}
|
||||
{% if door_not_closed %}
|
||||
{% set issues = issues + ['døren er ikke lukket'] %}
|
||||
{% endif %}
|
||||
{{ issues | join(' og ') }}
|
||||
- service: notify.mobile_app_claus_iphone_15pro
|
||||
data:
|
||||
title: "Slå fjernbetjening til på opvaskemaskinen"
|
||||
message: "Opvaskemaskinen er planlagt til natkørsel, men remote control er ikke slået til endnu."
|
||||
message: "[{{ reminder_time }}] Opvaskemaskinen er planlagt til natkørsel, men {{ issue_text }}."
|
||||
Reference in New Issue
Block a user