Notify or do something when an appliance like a dishwasher or washing machine finishes

@e-raser I think I might have the solution! You could give my blueprint a try!

Thank you. While I basically donā€™t like the approach of ā€œoutsourced configuration dataā€ (by using helper entities as config parameters instead of handling all inside the blueprint/automation which is much more tidy and centralized) I will have a look at your blueprint. It looks like a very very VERY powerful one. Interesting is the external ā€œonly Italianā€ HA Power Control part :smiley: I donā€™t even get what it does, will probably head over to Google Translate to do the IT/EN or IT/DE job :wink:

Iā€™m really quite happy with @Sbyx ones blueprint here, actually it works perfectā€¦ as soon as the bug/optimization noted here has been fixed/implemented :slight_smile: :+1:

1 Like

@e-raser Well, I am working on a translation myself :shushing_face:
Iā€™d then ask HA Power Controlā€™s author to approve that. Iā€™m like 90% done, but thatā€™s still unfinished.

I answered a question about that specifically, it should explain what it does:

@e-raser

Honestly, even if I do like this blueprint, the problem that you mention, that ā€œcurrently this blueprint is not able to survive reloading automationsā€ is a big deal to me.

I actually doubt that adding the automation_reloaded and the start triggers would make a big difference. What theyā€™d do instead is execute the pre_actions (Actions when starting threshold is crossed) and nothing more. Therefore, unless the appliance is still running and the power consumption is not steady (exactly 0.0W, indefinitely) the waiting for the trigger finishing_threshold would never end/happen.

The problem with state triggers that wait for some time to be valid is that they are completely nullified after home assistant reboots, and thereā€™s no way of getting around this, if not using some ā€˜helperā€™ variables and possibly a state machine that can ā€˜rememberā€™ what was happening before the blueprint was reloaded.


To me, it seems like this blueprint is conceptually made to work this way. Maybe itā€™s just because itā€™s very ā€˜unlikelyā€™ that HA or the automations get reloaded during an applianceā€™s cycle, or maybe because it wasnā€™t as meaningful to the author as it would have overcomplicated things. However, this happened many times already and deserves attention.


My solution was made for at least 4 reasons:

  1. I wanted it to work even after Home Assistant reboots or automations get reloaded, so I made the raw logic as stateless as possible.
  2. I wanted to be able to perform custom actions not just when the appliance finishes.
  3. I wanted it to be more responsive to changes in power consumption and chose not to wait for some time to pass. I thought that this would be useful to measure how long a cycle takes to complete.
  4. I wanted to make the appliance ā€˜awareā€™ of being the cause of an overload.

Obviously, this solution needs 4 of those helper entities but, in my opinion, the trade-off is worth it.

Please note that pt. 4 is optional! In the sense that: when you configure my blueprint, you can leave the ā€œAppliance Suspended entityā€ empty, and it should still work.
The only difference is that youā€™ll never see the detached_overload state ever happen (you still have to put it in the state machine though).

Iā€™ll update my documentation and mention it there as well.

Well, no reply after a week (or even months regarding the initial bringing up that idea point of time), unfortunately.

Just wanted to note: my forked blueprint containing these two simple additional triggers (see Notify or do something when an appliance like a dishwasher or washing machine finishes - #127 by e-raser) and setting mode to restart work just perfectly* :ok_hand::ok_hand::ok_hand: for all my use-cases (mainly powering off power plugs or sending notifications when dishwasher, washing machine etc. finished their work).

* meaning: restarting HA as well as reloading automations (which might happen A LOT sometimes) donā€™t break automations based on this blueprint anymore. Only ā€œdownsideā€ is of cause they get triggered and are constantly (shown as) running (attribute current: 1) until the numeric_state condition is met - which is therefore just a cosmetic issue I warmly buy for the mentioned benefits.

1 Like

hi, where exactly did you add

- platform: event
  event_type: automation_reloaded
- platform: homeassistant
  event: start

or maybe you can share a link to your fork? ist it on github?

thanks

1 Like

All,

Iā€™m getting this error in my trace with this BP.


Executed: July 24, 2022 at 12:25:13 PM

Error: offset should be format 'HH:MM', 'HH:MM:SS' or 'HH:MM:SS.F'

Any thoughts?

Error that popped up on the recent beta 2022.8b01

2022-07-29 23:51:30.063 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: Invalid trigger configuration. Got OrderedDict([('default_config', {}), ('homeassistant', OrderedDict([('packages', OrderedDict([('automations', OrderedDict([('automation', [OrderedDict([('id', '1649570579323'), ('alias', 'Appliance has finished - washing machine'), ('description', ''), ('use_blueprint', OrderedDict([('path', 'sbyx/notify-or-do-something-when-an-appliance-like-a-dishwasher-or-washing-machine-finishes.yaml'), ('input', OrderedDict([('power_sensor', 'sensor.tasmota_energy_power'), ('actions', [OrderedDict([('ser.... (See ?, line ?). 

Hi e-raser,

Got a link to your fork? Want to share?

greetz

I didnā€™t publish it, just using the file locally. As noted it wasnā€™t a big thing, only minor changes as described.

You forget to configure the startup delay time, It is at the bottom of the automation.

Thanks for this blueprint. Itā€™s working perfectly. For my own purposes, I have improved the blueprint.

I have shared the blueprint back to the community:

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

1 Like

In my case I use a Zooz Z-Wave Plus Power Switch ZEN15 to report power consumption on my washing machine. I was planning to use this automation to get notified when the spin cycle is finished, since thatā€™s usually a few minutes from the end of the full washer load.

During the spin cycle the power consumption can get as high as 400W, but occasionally the washer takes a pause during the spin such that the wattage falls back down to very nearly the idle wattage.

Bottom line: spin cycle instantaneous power consumption is not guaranteed to remain above a reasonably high threshold for even 10 seconds, even though the moving average is definitely above 100W for 5+ minutes.

So maybe detecting onset of the spin cycle is not the point, and I should just trigger ā€œstartedā€ by the washer being something like 2x the idle wattage for X minutes, and ā€œstoppedā€ at a later point when itā€™s back to idle wattage for Y minutes, and pray that the pauses in the spin cycle donā€™t approach the idle wattage.

Anybody else with a ZEN15 and a washing machine in the same camp as me?

Iā€™m not using a ZEN15 - rather, Iā€™m using less expensive TP-Link KP125 Wifi smartplugs.

However, I have run into a similar with my Whirlpool clothes washing machine. The power usage is all over the place.

The fix for me is to using a long finishing hysteresis, of 4 minutes below 6W. I came up with it by studying the consumption curve of the washer.

I came up with the 4 minutes because the ā€œTumblefreshā€ option of the washer spins once every 5 minutes, if enabled. I hadnā€™t enabled it in this particular cycle, though. Making the finishing hysteresis longer than 5 minutes would cause the finish action never to be executed if I had turned on that option in the washer, which I usually do, but forgot this time.

Have you considered a sensor that flattens the jumps?

Is there a way to use this blueprint automation to manage a sensor that contains the state of my dishwasher/laundry/dryer?

Iā€™d love to have a simple entity that shows ā€œrunningā€ or ā€œfinished X hours agoā€ or something

I have a template binary sensor like this with the running state. You could use the last changed time attribute to show the ā€˜running for x minutesā€™ or 'finished for y days. Or a helper or template sensor. To show energy used for last run you need 2 helpers or template sensors.

Iā€™m not getting notifications from this blueprint, although I am from others. The logs donā€™t show anything (although I may be looking in the wrong place!).

The sensor is a TuYa TS011F_plug_3 (TuYa TS011F_plug_3 control via MQTT | Zigbee2MQTT), currently the only power plug I have as I learn to migrate from a z-wave Vera setup.

Any pointers from the community would be greatly appreciated, my searches have been without fruit.

alias: Utility - Washing Machine has finished
description: ""
use_blueprint:
  path: >-
    sbyx/notify-or-do-something-when-an-appliance-like-a-dishwasher-or-washing-machine-finishes.yaml
  input:
    power_sensor: sensor.washing_machine_power
    actions:
      - service: notify.phones
        data:
          message: ....has finished
          title: Washing Machine
    pre_actions:
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 0

I used ā€œifā€ action for this. Eg. if time condition 09:00 - 20:00, then tts+tts+notification, else only notification.
Please let me know if you need help with this.