πŸ“³ Appliance Notifications & Actions - Washing Machine - Clothes Dryer - Dish Washer - ETC

@ulih

Welcome to the community.

First, providing your YAML of your setting really helps me as I can see exactly what you have and it helps me help you... thanks.

This error normally means your missing an input in the blueprint.

The three (3) inputs your missing are in Energy Tracking;

You can disable this option or add the inputs. In that section there is a link for more information and it shows you how to do the inputs.

Blacky :grinning_face:

Works like a charm now - Thank You! Very useful information that this error means missing input.

@ulih

Your welcome.

Blacky :smiley:

Hello @Blacky ,
first of all thank you for the enormous work done and sharing it with us :slight_smile:

But I need some help. I'm getting an error:
Error: TypeError: cannot use 'list' as a dict key (unhashable type: 'list')

Did I miss something in configuration?

Here is my yaml for this section:

Summary
choose:
  - alias: Check if end of notification is enabled
    conditions:
      - condition: template
        value_template: '{{ include_end_notify == ''enable_end_notify_options'' }}'
      - alias: Check if notify time restriction is enabled before sending the message
        condition: or
        conditions:
          - condition: template
            value_template: '{{ include_time == ''time_disabled'' }}'
          - condition: and
            conditions:
              - condition: time
                after: '00:00:00'
                before: '00:00:00'
                weekday:
                  - mon
                  - tue
                  - wed
                  - thu
                  - fri
                  - sat
                  - sun
              - condition: template
                value_template: '{{ include_time == ''time_enabled'' }}'
    sequence:
      - variables:
          zone_filtered_end_devices: |
            {% if 'zone_end' in include_device_tracker %}
              {% set zone_short_name = notify_zone.split('.')[-1] | lower | trim %}
              {% set ns = namespace(devices=[]) %}
              {% for device in end_notify_device %}
                {% set device_status = namespace(in_zone=false) %}
                {% set trackers = device_entities(device) | select('search', '^device_tracker\\.') | list %}
                {% for tracker in trackers %}
                  {% if (states(tracker) | string).lower().strip() == zone_short_name %}
                    {% set device_status.in_zone = true %}
                  {% endif %}
                {% endfor %}
                {% if device_status.in_zone %}
                  {% set ns.devices = ns.devices + [device] %}
                {% endif %}
              {% endfor %}
              {{ ns.devices }}
            {% else %}
              {{ end_notify_device }}
            {% endif %}
          message: >-
            {% set message = namespace(text='') %} {% if
            include_service_reminder == 'enable_service_reminder_and_notify' %}
              {% set service_count = states(service_reminder_counter_helper) | int(0) %}
              {% set service_threshold = service_reminder_cycles | int %}
              {% if service_count >= service_threshold %}
                {% set message.text = message.text + service_reminder_end_message + '\n' %}
              {% endif %}
            {% endif %} {% if include_time_service_reminder ==
            'enable_time_service_reminder_and_notify' %}
              {% set service_reminder_helper_value = states(service_reminder_time_helper) %}
              {% if ':' in service_reminder_helper_value %}
                {% set time = service_reminder_helper_value.split(':') %}
                {% set service_reminder_helper_seconds = (time[0] | int * 3600) + (time[1] | int * 60) + (time[2] | int) %}
              {% else %}
                {% set service_reminder_helper_seconds = 0 %}
              {% endif %}
              {% set service_reminder_time_threshold_seconds =
                (service_reminder_time_threshold.hours | int * 3600) +
                (service_reminder_time_threshold.minutes | int * 60) +
                (service_reminder_time_threshold.seconds | int)
              %}
              {% if service_reminder_helper_seconds >= service_reminder_time_threshold_seconds %}
                {% set message.text = message.text + service_reminder_time_end_message + '\n' %}
              {% endif %}
            {% endif %} {% set message.text = message.text + end_message %} {%
            if include_power_tracking == 'enable_power_tracking' %}
              {% set kwh = (states(end_power_consumption) | float - states(start_power_consumption) | float) %}
              {% set message.text = message.text + '\n' + end_message_kwh + ' ' + (kwh | round(2) | string) + ' kWh' %}
            {% endif %} {% if include_power_tracking ==
            'enable_power_tracking_and_cost' %}
              {% set kwh = (states(end_power_consumption) | float - states(start_power_consumption) | float) %}
              {% set cost = kwh * (states(cost_per_kwh) | float) %}
              {% set message.text = message.text + '\n' + end_message_kwh + ' ' + (kwh | round(2) | string) + ' kWh' %}
              {% set message.text = message.text + '\n' + end_message_cost + (cost | round(2) | string) %}
            {% endif %} {% if include_runtime_tracking ==
            'enable_runtime_tracking_and_notify' %}
              {% set run_time = states(runtime_tracking_helper) %}
              {% set message.text = message.text + '\n' + runtime_tracking_end_message + ' ' + run_time %}
            {% endif %} {% if include_duration_tracking ==
            'enable_duration_tracking' %}
              {% set end_time = now().timestamp() %}
              {% set duration = (end_time - start_time) | int %}
              {% set hours = (duration // 3600) %}
              {% set minutes = ((duration % 3600) // 60) %}
              {% set seconds = (duration % 60) %}
              {% set message.text = message.text + '\n' + end_message_duration_tracking + ' ' + '%02d:%02d:%02d' | format(hours, minutes, seconds) %}
            {% endif %} {% if include_cycle_counter ==
            'enable_cycle_counter_and_notify' %}
              {% set cycle_count = states(cycle_counter_helper) | int(0) %}
              {% set message.text = message.text + '\n' + cycle_counter_end_message + ' ' + (cycle_count | string) %}
            {% endif %} {{ message.text }}
      - alias: Send a notification to each device
        repeat:
          for_each: '{{ zone_filtered_end_devices }}'
          sequence:
            - action: >-
                notify.mobile_app_{{ device_attr(repeat.item, 'name') | slugify
                }}
              data:
                title: Washing Machine
                message: |
                  {{message}}
                data: '{{ end_message_data }}'
              continue_on_error: true
      - choose:
          - alias: Check if end reminder notification is enabled
            conditions:
              - condition: template
                value_template: >-
                  {{ end_reminder_notification !=
                  'disable_reminder_notification' }}
            sequence:
              - variables:
                  reminder_message: >-
                    {% set message = namespace(text='') %} {% if
                    include_service_reminder ==
                    'enable_service_reminder_and_notify' %}
                      {% set service_count = states(service_reminder_counter_helper) | int(0) %}
                      {% set service_threshold = service_reminder_cycles | int %}
                      {% if service_count >= service_threshold %}
                        {% set message.text = message.text + service_reminder_end_message + '\n' %}
                      {% endif %}
                    {% endif %} {% if include_time_service_reminder ==
                    'enable_time_service_reminder_and_notify' %}
                      {% set service_reminder_helper_value = states(service_reminder_time_helper) %}
                      {% if ':' in service_reminder_helper_value %}
                        {% set time = service_reminder_helper_value.split(':') %}
                        {% set service_reminder_helper_seconds = (time[0] | int * 3600) + (time[1] | int * 60) + (time[2] | int) %}
                      {% else %}
                        {% set service_reminder_helper_seconds = 0 %}
                      {% endif %}
                      {% set service_reminder_time_threshold_seconds =
                        (service_reminder_time_threshold.hours | int * 3600) +
                        (service_reminder_time_threshold.minutes | int * 60) +
                        (service_reminder_time_threshold.seconds | int)
                      %}
                      {% if service_reminder_helper_seconds >= service_reminder_time_threshold_seconds %}
                        {% set message.text = message.text + service_reminder_time_end_message + '\n' %}
                      {% endif %}
                    {% endif %} {% set message.text = message.text +
                    end_reminder_notification_message %} {{ message.text }}
              - wait_for_trigger:
                  - trigger: state
                    entity_id: []
                    to: 'on'
                timeout:
                  minutes: 10
              - repeat:
                  while:
                    - condition: template
                      value_template: >-
                        {{ (is_state(end_reminder_notification_entity, 'off'))
                        and (repeat.index <=
                        end_reminder_notification_max_count) }}
                  sequence:
                    - variables:
                        zone_filtered_end_devices: |
                          {% if 'zone_end' in include_device_tracker %}
                            {% set zone_short_name = notify_zone.split('.')[-1] | lower | trim %}
                            {% set ns = namespace(devices=[]) %}
                            {% for device in end_notify_device %}
                              {% set device_status = namespace(in_zone=false) %}
                              {% set trackers = device_entities(device) | select('search', '^device_tracker\\.') | list %}
                              {% for tracker in trackers %}
                                {% if (states(tracker) | string).lower().strip() == zone_short_name %}
                                  {% set device_status.in_zone = true %}
                                {% endif %}
                              {% endfor %}
                              {% if device_status.in_zone %}
                                {% set ns.devices = ns.devices + [device] %}
                              {% endif %}
                            {% endfor %}
                            {{ ns.devices }}
                          {% else %}
                            {{ end_notify_device }}
                          {% endif %}
                    - repeat:
                        for_each: '{{ zone_filtered_end_devices }}'
                        sequence:
                          - action: >-
                              notify.mobile_app_{{ device_attr(repeat.item,
                              'name') | slugify }}
                            data:
                              title: Washing Machine
                              message: |
                                {{reminder_message}}
                              data: '{{ end_message_data }}'
                            continue_on_error: true
                    - choose:
                        - alias: >-
                            Check reminder notification entity is OFF and max
                            count is less before waiting
                          conditions:
                            - condition: template
                              value_template: >-
                                {{ (is_state(end_reminder_notification_entity,
                                'off')) and (repeat.index <=
                                end_reminder_notification_max_count - 1) }}
                          sequence:
                            - wait_for_trigger:
                                - trigger: state
                                  entity_id: []
                                  to: 'on'
                              timeout:
                                minutes: 10
              - choose:
                  - alias: Perform the run status action
                    conditions:
                      - condition: template
                        value_template: '{{ include_run_status == ''run_status_enabled'' }}'
                      - condition: template
                        value_template: '{{ run_status_end_reminder != [] }}'
                      - condition: state
                        entity_id: []
                        state: 'off'
                    sequence:
                      - action: input_select.select_option
                        target:
                          entity_id: []
                        data:
                          option: []
              - choose:
                  - alias: Entity is ON, check run status options
                    conditions:
                      - condition: state
                        entity_id: []
                        state: 'on'
                    sequence:
                      - choose:
                          - alias: Perform the run status action
                            conditions:
                              - condition: template
                                value_template: >-
                                  {{ include_run_status == 'run_status_enabled'
                                  }}
                              - condition: template
                                value_template: '{{ run_status_end_attended != [] }}'
                            sequence:
                              - action: input_select.select_option
                                target:
                                  entity_id: []
                                data:
                                  option: []
                  - alias: Entity is OFF, wait for it to turn ON
                    conditions:
                      - condition: state
                        entity_id: []
                        state: 'off'
                    sequence:
                      - wait_for_trigger:
                          - trigger: state
                            entity_id: []
                            to: 'on'
                      - choose:
                          - alias: Perform the run status action
                            conditions:
                              - condition: template
                                value_template: >-
                                  {{ include_run_status == 'run_status_enabled'
                                  }}
                              - condition: template
                                value_template: '{{ run_status_end_attended != [] }}'
                            sequence:
                              - action: input_select.select_option
                                target:
                                  entity_id: []
                                data:
                                  option: []
              - choose:
                  - alias: Check if end reminder notification + notify is enabled
                    conditions:
                      - condition: template
                        value_template: >-
                          {{ end_reminder_notification ==
                          'enable_reminder_notification_notify' }}
                    sequence:
                      - variables:
                          zone_filtered_end_devices: |
                            {% if 'zone_end' in include_device_tracker %}
                              {% set zone_short_name = notify_zone.split('.')[-1] | lower | trim %}
                              {% set ns = namespace(devices=[]) %}
                              {% for device in end_notify_device %}
                                {% set device_status = namespace(in_zone=false) %}
                                {% set trackers = device_entities(device) | select('search', '^device_tracker\\.') | list %}
                                {% for tracker in trackers %}
                                  {% if (states(tracker) | string).lower().strip() == zone_short_name %}
                                    {% set device_status.in_zone = true %}
                                  {% endif %}
                                {% endfor %}
                                {% if device_status.in_zone %}
                                  {% set ns.devices = ns.devices + [device] %}
                                {% endif %}
                              {% endfor %}
                              {{ ns.devices }}
                            {% else %}
                              {{ end_notify_device }}
                            {% endif %}
                          attended_message: >-
                            {% set message = namespace(text='') %} {% if
                            include_service_reminder ==
                            'enable_service_reminder_and_notify' %}
                              {% set service_count = states(service_reminder_counter_helper) | int(0) %}
                              {% set service_threshold = service_reminder_cycles | int %}
                              {% if service_count >= service_threshold %}
                                {% set message.text = message.text + service_reminder_end_message + '\n' %}
                              {% endif %}
                            {% endif %} {% if include_time_service_reminder ==
                            'enable_time_service_reminder_and_notify' %}
                              {% set service_reminder_helper_value = states(service_reminder_time_helper) %}
                              {% if ':' in service_reminder_helper_value %}
                                {% set time = service_reminder_helper_value.split(':') %}
                                {% set service_reminder_helper_seconds = (time[0] | int * 3600) + (time[1] | int * 60) + (time[2] | int) %}
                              {% else %}
                                {% set service_reminder_helper_seconds = 0 %}
                              {% endif %}
                              {% set service_reminder_time_threshold_seconds =
                                (service_reminder_time_threshold.hours | int * 3600) +
                                (service_reminder_time_threshold.minutes | int * 60) +
                                (service_reminder_time_threshold.seconds | int)
                              %}
                              {% if service_reminder_helper_seconds >= service_reminder_time_threshold_seconds %}
                                {% set message.text = message.text + service_reminder_time_end_message + '\n' %}
                              {% endif %}
                            {% endif %} {% set message.text = message.text +
                            end_attended_notification_message %} {{ message.text
                            }}
                      - alias: >-
                          Send a notification to each device to notify it has
                          been attended to
                        repeat:
                          for_each: '{{ zone_filtered_end_devices }}'
                          sequence:
                            - action: >-
                                notify.mobile_app_{{ device_attr(repeat.item,
                                'name') | slugify }}
                              data:
                                title: Washing Machine
                                message: |
                                  {{attended_message}}
                                data: '{{ end_message_data }}'
                              continue_on_error: true
              - choose:
                  - alias: Check if end reminder notification + clear is enabled
                    conditions:
                      - condition: template
                        value_template: >-
                          {{ end_reminder_notification ==
                          'enable_reminder_notification_clear' }}
                    sequence:
                      - alias: >-
                          Send a notification to each device to clear
                          notification
                        repeat:
                          for_each:
                            - a8136e6c8cc8acd8800b36a9c7202bed
                          sequence:
                            - action: >-
                                notify.mobile_app_{{ device_attr(repeat.item,
                                'name') | slugify }}
                              data:
                                message: clear_notification
                                data:
                                  tag: washing-clothes
                              continue_on_error: true

here is the blueprint params:

Summary
alias: Skalbimas baigtas
description: ""
use_blueprint:
  path: Blackshome/appliance-notifications.yaml
  input:
    power_sensor: sensor.skalbimas_power
    start_appliance_power: 3
    start_time_delay: 0.25
    end_appliance_power: 4
    include_end_notify: enable_end_notify_options
    end_notify_device:
      - a8136e6c8cc8acd8800b36a9c7202bed
    end_notify_tag: washing-clothes
    end_notify_data:
      - high_priority
      - icon
    end_reminder_notification: disable_reminder_notification
    end_reminder_notification_max_count: 4
    include_power_tracking: enable_power_tracking
    power_consumption_sensor: sensor.skalbimas_energy
    runtime_tracking_helper: input_text.skalbimas
    end_custom_actions:
      - action: notify.messenger
        metadata: {}
        data:
          message: Skalbimas baigtas
          target: Robertas
    include_custom_actions:
      - enable_end_custom_actions
    start_power_consumption: input_number.skalbimas_startingenergy
    end_power_consumption: input_number.skalbimas_endingenergy
    cost_per_kwh: sensor.electricity_cost_rate

@rupertas

First, providing your YAML of your setting really helps me as I can see exactly what you have and it helps me help you... thanks. Just a quick tip... when posting code into this forum use the </> button as it will keep the correct alignment and format.

This error normally means your missing an input in the blueprint.

The three (3) inputs your missing are in Energy Tracking.

You can disable this option or add the inputs. In that section there is a link for more information and it shows you how to do the inputs.

Blacky :grinning_face:

Thank you, this was the case.

I somehow misunderstood the requirement for helpers

corrected the post

@rupertas

That's great news... glad you got it all working.

PS: The code update looks much better.

Enjoy

Blacky :grinning_face:

Hi I see that the automation is running but it is not sending any notifications to my phone when it starts or ends. Thanks in advance any help, I just got in to HA. @Blacky

@nsteiner

Welcome to the community.

Not sure if you had HA send you a notification yet but go into your phone settings and then into the HA app and make sure your in notifications that you allow them.

If that was already enabled then could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on β€œ</>” and paste code in there.

Blacky :grinning_face:

I have gotten some notifications from HA so I think the phone side is working.

Below is the YAML that I copied its very simple

@Blacky

alias: Appliance Notifications & Actions
description: ""
use_blueprint:
  path: Blackshome/appliance-notifications.yaml
  input:
    power_sensor: sensor.washer_current_consumption
    start_time_delay: 2
    running_dead_zone: 5
    end_appliance_power: 1
    end_time_delay: 3
    include_start_notify: enable_start_notify_options
    start_notify_device:
      - 3e7564153d6e91c8e13da5e4dd6dc901
    include_end_notify: enable_end_notify_options
    end_notify_device:
      - 3e7564153d6e91c8e13da5e4dd6dc901
    end_reminder_notification: disable_reminder_notification
    include_time: time_enabled
    after_time: "22:30:00"
    before_time: "08:00:00"
    include_runtime_tracking: disable_runtime_tracking
    include_watchdog: enable_watchdog
    watchdog_timeframe:
      hours: 1
      minutes: 25
      seconds: 0
    watchdog_notify_device:
      - 3e7564153d6e91c8e13da5e4dd6dc901

@Blacky Love your applience blueprint!! I have two things, that in my opinion would be valuable to add.

  1. When sending an end notification to devices within a zone (home) when nobody is home results in no notification at all. Is there a way to send the notifications to all devices if everybody left the zone?
  2. Will there be support for notification groups? (Group - Home Assistant). e.g. when i get a new phone it's much easier to update a single group than to go over all the automations and update the device

@nsteiner

If you have gotten a notification to your phone from HA then that should rule that one out as working.

All your settings look good except for Notify Time Restrictions.

Start is set to 10:30 pm and End is set to 8:00 am, and I think that's where the problem lies. I think what you want is Start at 8:00 am and End at 10:30 pm. Start is when notifications are allowed to begin, and End is when notifications should stop being sent. Swap the Notify Time Restrictions around, and I think you'll be all good.

Let us know how you go.

Blacky :grinning_face:

@Jeroenll

Welcome to the community and thanks for your kind words.

  1. No, this would be a very specific use case. What you could do instead is use the Run Status . When a person gets home, if the Run Status is still active (or the run hasn't completed), you could send a custom notification to that person's device. For example:

    "The washing machine needs to be attended to."

    That approach may help achieve what you're after.

  2. Yes, I have already done some work on this. I going to make it through the one input if possible (well we know anything is possible in HA) so everything stays clean. I just got a new phone and I get it.

Blacky :grinning_face:

1 Like

@Blacky Thank you! That was the fix that I needed! Can't wait to use this for the washer. Mine is older and makes no chimes when the load is finished.

Thanks again!

1 Like

Just wanted to say thank you for this. I kept forgetting to empty the washing machine. Not anymore!

1 Like

Hi,
i am quiet new, this is the first blueprint i am using.
I have a shelly 1Pm Gen4, used behind a socket connected to the washing machine.

I imported the Blueprint, select the Power Sensor from Shelly, activate the run status, enter the values from my input.select helper with the state for the different phases.

thing is, I expect the blueprint, once below the W for a time, to change the input.select helper to the proper state.
Somehow i have the feeling the automation stops in between. I do not use the energy tracking but the automation stop there i think and does not change my input.select.

Do i have some problems in my thinking/setup or is there a bug?

Thanks for the great template, big potential for me.

@hansolu

Could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on β€œ</>” and paste code in there.

Maybe also a screen shot of your Dropdown Helper

Blacky :smiley:

1 Like

Hi

here is the yaml

alias: test_wash
description: ""
use_blueprint:
  path: Blackshome/appliance-notifications.yaml
  input:
    power_sensor: sensor.shelly1pmg4_acebe6e52808_power
    include_run_status: run_status_enabled
    run_status_entity: input_select.washing_machine_status
    run_status_start: Washing in Progress
    run_status_end: Cycle Complete!
    run_status_end_reminder: Cycle Complete!
    run_status_end_attended: Ready for Next Load
    start_appliance_power: 9

for the helper, i dont know how to see the yaml for it, therefore i added a screenshot.

Thanks a lot for the reply and help

Hi, I'm using Ticker β€” Smart Notification Management for Home Assistant to manage my notifications. Ticker registers as a virtual device so it can be used by blueprints.

It looks like the Appliance Notification blueprint filters for mobile devices specifically. Is it possible to relax this filter to allow notifications to any device rather than just mobile devices?

EDIT: I ended up just editing the blueprint yaml directly to add a ticker integration as part of the filter

Editing the blueprint surely works but I wonder why it doesn’t allow any notify entity to be used. Surely all the specialties for iOS and Android would not work, but it could maybe be at least be an option?