Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Home Assistant Blueprint: Notify or do something when an appliance like a dishwasher or washing machine finishes
blueprint:
name: Appliance has finished
description: Do something when an appliance (like a washing machine or dishwasher)
has finished as detected by a power sensor.
domain: automation
input:
power_sensor:
name: Power Sensor
description: Power sensor entity (e.g. from a smart plug device).
selector:
entity:
domain: sensor
starting_threshold:
name: Starting power threshold
description: Power threshold above which we assume the appliance has started.
default: 5
selector:
number:
min: 1.0
max: 100.0
unit_of_measurement: W
mode: slider
step: 1.0
starting_hysteresis:
name: Starting hysteresis
description: Time duration the power measurement has to stay above the starting
power threshold.
default: 5
selector:
number:
min: 0.25
max: 60.0
unit_of_measurement: min
mode: slider
step: 0.25
finishing_threshold:
name: Finishing power threshold
description: Power threshold below which we assume the appliance has finished.
default: 5
selector:
number:
min: 1.0
max: 100.0
unit_of_measurement: W
mode: slider
step: 1.0
finishing_hysteresis:
name: Finishing hysteresis
description: Time duration the power measurement has to stay below the finishing
power threshold.
default: 5
selector:
number:
min: 0.25
max: 60.0
unit_of_measurement: min
mode: slider
step: 0.25
actions:
name: Actions
description: Actions (e.g. pushing a notification, TTS announcement, ...)
selector:
action: {}
pre_actions:
name: Actions
description: Actions when starting threshhold is crossed
selector:
action: {}
source_url: https://gist.github.com/sbyx/6d8344d3575c9865657ac51915684696
trigger:
- platform: numeric_state
entity_id: !input 'power_sensor'
for:
minutes: !input 'starting_hysteresis'
above: !input 'starting_threshold'
condition: []
action:
- choose: []
default: !input 'pre_actions'
- wait_for_trigger:
- platform: numeric_state
entity_id: !input 'power_sensor'
below: !input 'finishing_threshold'
for:
minutes: !input 'finishing_hysteresis'
- choose: []
default: !input 'actions'
mode: single
max_exceeded: silent
@OmgImAlexis
Copy link

OmgImAlexis commented May 28, 2021

So I noticed a bug with the blueprints, they currently don't accept a large float for the number selector so you'll want to set the max to 100 not 100.0 for https://gist.github.com/sbyx/6d8344d3575c9865657ac51915684696#file-notify-or-do-something-when-an-appliance-like-a-dishwasher-or-washing-machine-finishes-yaml-L42-L43

Personally I have mine set to 2400W(240v @ 10A).

@Dajonny99
Copy link

Dajonny99 commented Nov 16, 2021

something has changed in Homeassistant: there is an Error in Line 63 - "Incorrect Type. Expected null"

@rmjjanssen1
Copy link

rmjjanssen1 commented Jan 22, 2022

Hi Steven,

I use your lovely blueprint for some time now for my washing machine and tumble dryer. I recent added an additional automation to set a 'running' state (using input_select helper) where at the end of this automation I set it back to 'finished'. These states can be used for a run/finished icon on the dashboard or in my case an ask to Siri to find out if the dryer is still running. The reason for this extra automation was that the above automation is not able to do an action at the 'start' of the program, at least I could not figure it out (no options when setting up / configure the blueprint). Is this there a way to execute an optional action as soon as the appliance is started, so just after 'start' is detected? Maybe a suggestion to extent the blueprint with this option?

@guevara777
Copy link

guevara777 commented Jan 23, 2022

  • 1

Would love to see an action for "start" too. I use an extra Automation for that.

My use-case:
I save the "energy_total"-value into an input_number. When the applicance finishes i use this input_number for calculating the power-usage und cost an then use that in a notification.

@popy2k14
Copy link

popy2k14 commented Feb 14, 2022

+1 for an start action

@dawgama
Copy link

dawgama commented Feb 23, 2022

+1 for an start action

@charisketikidis
Copy link

charisketikidis commented Feb 27, 2022

+1 for an start action

@gregoryduckworth
Copy link

gregoryduckworth commented Mar 3, 2022

  • 1

Would love to see an action for "start" too. I use an extra Automation for that.

My use-case: I save the "energy_total"-value into an input_number. When the applicance finishes i use this input_number for calculating the power-usage und cost an then use that in a notification.

Are you able to share that automation @guevara777? As that is exactly what I'm hoping to do as well.

@realjax
Copy link

realjax commented Apr 13, 2022

not working for me, it says 'Message malformed: Missing input pre_actions'

@popy2k14
Copy link

popy2k14 commented Apr 13, 2022

Here is mine which works really good with SonOff POW2:

For starting:

alias: Bad Trockner Gestartet
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.trockner_durchschnittsleistung
    above: '30'
    for:
      hours: 0
      minutes: 0
      seconds: 0
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.dryer_running
            state: 'off'
        sequence:
          - service: script.alexa_announce
            data_template:
              alexa_device: media_player.badezimmer
              alexa_service: notify.alexa_media_badezimmer
              alexa_volume_speak: 0.3
              alexa_message: Trockner gestartet!
    default: []
  - service: input_boolean.turn_on
    data: {}
    target:
      entity_id:
        - input_boolean.dryer_running
mode: single

for checking finished:

alias: Bad Trockner Fertig?
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.trockner_durchschnittsleistung
    below: '30'
    for:
      hours: 0
      minutes: 1
      seconds: 0
condition:
  - condition: state
    entity_id: input_boolean.dryer_running
    state: 'on'
action:
  - service: input_boolean.turn_off
    data: {}
    target:
      entity_id:
        - input_boolean.dryer_running
  - service: input_number.set_value
    data:
      value: 5
    target:
      entity_id:
        - input_number.dryer_notifications_left
  - service: automation.trigger
    data: {}
    target:
      entity_id:
        - automation.bad_trockner_notification
mode: single

Notification:

alias: Bad Trockner Notification
description: ''
trigger:
  - platform: time
    at: input_datetime.dryer_next_notification
condition:
  - condition: numeric_state
    entity_id: input_number.dryer_notifications_left
    above: '0'
action:
  - choose:
      - conditions:
          - type: is_open
            condition: device
            device_id: 9a7fe1a5534744bc449e99f04fa69755
            entity_id: binary_sensor.trockner_ture
            domain: binary_sensor
        sequence:
          - service: input_number.set_value
            data:
              value: 0
            target:
              entity_id:
                - input_number.dryer_notifications_left
    default: []
  - type: is_not_open
    condition: device
    device_id: 9a7fe1a5534744bc449e99f04fa69755
    entity_id: binary_sensor.trockner_ture
    domain: binary_sensor
  - service: input_number.decrement
    data: {}
    target:
      entity_id:
        - input_number.dryer_notifications_left
  - service: script.turn_on
    target:
      entity_id: script.notify_devices
    data:
      variables:
        speakvolume: 0.35
        speaktext: Trockner ist fertig, bitte ausräumen!
        tvtext: Trockner ist fertig, bitte ausräumen!
        tvicon: http://192.168.0.8:8123/local/trockner.png
  - service: input_datetime.set_datetime
    data:
      time: '{{ (now() + timedelta( minutes = 10 )).strftime("%H:%M") }}'
    target:
      entity_id: input_datetime.dryer_next_notification
mode: single

PS.: this automation's are repeating the notfications until the door is opened or motion is detected in the bath. There the count is reseted to 0 to stop the loop.

Have fun
pOpY

@businescat
Copy link

businescat commented Jun 11, 2022

errors on lines 63 and 68 automation wont save properly if you dont need or want to use the starting action and doesnt seem to work very reliably at all when trying to work around these issues, cant recomend this unless the owner comes and updates it for 2022

@popy2k14
Copy link

popy2k14 commented Jun 12, 2022

As stated above.
My previously compltly other approach is working without any issue (at least with my sonoff pow r2's) on 3x devices.

@HollyFredD
Copy link

HollyFredD commented Jul 14, 2022

Thanks for this very useful blueprint.
It used to work for me prior to delete and reinstall it.

Now the installation is working fine, but when I try to create an automation, I have the following error message 👍
"Message malformed: Missing input pre_actions"

Would you have any clue ?

not working for me, it says 'Message malformed: Missing input pre_actions'

A good solution has been shared on the Home Assistant community forum :
https://community.home-assistant.io/t/notify-or-do-something-when-an-appliance-like-a-dishwasher-or-washing-machine-finishes/254841/117?u=hollyfredd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment