diff --git a/include/automations/opvaskemaskine.yaml b/include/automations/opvaskemaskine.yaml index d3d7808..a08aad6 100644 --- a/include/automations/opvaskemaskine.yaml +++ b/include/automations/opvaskemaskine.yaml @@ -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." \ No newline at end of file + message: "[{{ reminder_time }}] Opvaskemaskinen er planlagt til natkørsel, men {{ issue_text }}." \ No newline at end of file