No notification after washer or dryer completes

Hello,

I am currently working on setting up notifications for when the washer cycle is complete or the dryer cycle is complete.

The washer is based on wattage usage and the dryer is based on a temperature sensor near the air exhaust. 0-20 minute delays arent a big deal but ideally the shorter the better.

Here is my washer yaml.

alias: Power Washer-OFF
description: 'When the watts on the washer is high enough and then reaches 0, send notis'
trigger:
  - type: power
    platform: device
    device_id: abf43f0811ca11eb80527bda4ddf9b35
    entity_id: sensor.zen15_power_switch_electric_w
    domain: sensor
    above: 2
    for:
      hours: 0
      minutes: 5
      seconds: 0
condition: []
action:
  - delay: '00:05:00'
  - condition: state
    entity_id: sensor.zen15_power_switch_electric_w
    state: '0'
    attribute: unit_of_measurement
  - service: notify.hagroupnotifyphones
    data:
      message: Dryer cycle complete
mode: restart
max: 10

I get no errors as far as syntax goes, when testing and hitting execute, I do indeed get a notification. So it appears I canā€™t figure out logic.

Here is my YAML for my dryer.

alias: Temp Dryer-OFF
description: 'When the temperature on the dryer is low enough, time to notify. '
trigger:
  - type: temperature
    platform: device
    device_id: 9c6da5e1f97f4807b7ff18a69a9b87f0
    entity_id: sensor.aqara_temp1_e1b67b04_temperature
    domain: sensor
    above: 70
    for:
      hours: 0
      minutes: 1
      seconds: 0
condition:
  - type: is_temperature
    condition: device
    device_id: 9c6da5e1f97f4807b7ff18a69a9b87f0
    entity_id: sensor.aqara_temp1_e1b67b04_temperature
    domain: sensor
    below: 60
action:
  - service: notify.hagroupnotifyphones
    data:
      message: Dryer cycle complete
mode: queued
max: 10

Notifications were sent successfully when hitting the execute button when creating it but it appears I do not get notifications in real world usage for washer or dryer.

If Iā€™m reading it correctly, your washer yaml says ā€œif wattage is above 2 for 5 minutes, then wait for 5 minutes, then check wattage stateā€™s attribute called unit_of_measurement and stop if it doesnt match string ā€˜0ā€™, then notify with message ā€˜Dryer cycle completeā€™ā€ ? Is that the logic that you intend to have?

Off the top of my head, things that might be causing problems here:

  • state of sensor.zen15_power_switch_electric_w's attribute unit_of_measurement being compared to '0' - do you need that attribute? does that sensor report wattage in floats (0.0) or ints (0)? You might want to try changing that to numeric_state and get rid of the attribute line, as described here: https://www.home-assistant.io/docs/scripts/conditions/#numeric-state-condition something like
- condition: numeric_state
  entity_id: sensor.zen15_power_switch_electric_w
  below: 0.1
  • are you sure on what would happen if your cycle runs for longer than 10 minutes? will the trigger get fired again? and wouldnā€™t mode: restart cause this automation to get constantly restarted by new triggers once the wattage stays above 2 for longer than 5 minutes? Iā€™m not entirely sure how HA would handle that, but it seems a little sketchy?

I happen to have the same kind of automation, except that I do it in four parts:

  1. Define a input_boolean called washer_running thatā€™s set to on or off
  2. Set washer_running to on if itā€™s currently off and wattage is more than 1 for one minute
  3. Set washer_running to off if itā€™s currently on and wattage is below 1 for two minutes
  4. Whenever washer_running changes state from on to off, send notification

This logic seems to work reliably (never had a misfire in the past few months), and I have essentially a binary sensor called washer_running that reflects the current state of the washer without having to look at wattage. Yaml is definitely longer than what you are trying to do, but i donā€™t mind - i did it all thru UI anyway.

Hereā€™s my yaml:

part 1 is a Helper called input_boolean.washer_running defined under Helpers - not sure what the yaml looks likeā€¦

automation 2

alias: Detect washer started
description: Use power consumption data to detect when washer started running
trigger:
  - platform: numeric_state
    entity_id: sensor.basement_washer_plug_electric_w
    above: '1'
    for: '0:01'
condition:
  - condition: state
    entity_id: input_boolean.washer_running
    state: 'off'
action:
  - service: input_boolean.turn_on
    data: {}
    entity_id: input_boolean.washer_running
mode: single

automation 3

alias: Detect washer stopped
description: ''
trigger:
  - platform: numeric_state
    entity_id: sensor.basement_washer_plug_electric_w
    below: '1'
    for: '0:02'
condition:
  - condition: state
    entity_id: input_boolean.washer_running
    state: 'on'
action:
  - service: input_boolean.turn_off
    data: {}
    entity_id: input_boolean.washer_running
mode: single

automation 4

alias: Notify when washer stops
description: ''
trigger:
  - platform: state
    entity_id: input_boolean.washer_running
    from: 'on'
    to: 'off'
condition: []
action:
  - service: notify.mobile_app_iphone
    data:
      message: 'Laundry is washed, time to dry!'
mode: single

hope this helps with the washer part?

2 Likes

First off, thank you.

Thank you for taking the time to post an incredibly helpful and detailed post. I have gone ahead and created a helper for the first time ever. Afterward created two automations, as you have made, to either turn it off or on. Lastly, a final automation to send a notification. Iā€™ve restarted home assistant and have a load in the washer.

I am super eager because I really think this will work out. Thank you!!!

Iā€™ll see if I can replicate this success with the dryer. I think creating a helper will be part of my solution with the dryer as well. Dryer is electric but I donā€™t have a smart wall plug/switch that can handle 30 amps.

Did you stop your notifications with just mobile? Was thinking about voice alerts from Alexa.

The problem with your original automation is the condition in the action:

- condition: state
    entity_id: sensor.zen15_power_switch_electric_w
    state: '0'
    attribute: unit_of_measurement

You need to remove the last line, currently it checks whether the attribute unit_of_measurement is equal to 0, however this attribute is just a string, like ā€˜wā€™ or ā€˜%ā€™, not the actual value of the sensor.

You are welcome. After I posted the automations yaml last night, I actually did add an audio message to play over the kitchen speakers. WAF is high on that one :slight_smile:

As for the dryer, Iā€™m in the same boat, but Iā€™m going with a sound level sensor and ESPHome instead of a temperature sensor. Still working on a 3d printed enclosure for the sensor.

Let us know how the automation works out!

Hereā€™s a simple automation to report when the laundry is done.

alias: 'Laundry monitor'
trigger:
- platform: numeric_state
  entity_id: sensor.zen15_power_switch_electric_w
  above: 2
  for: '00:01:00'
action:
- wait_for_trigger:
  - platform: state
    entity_id: sensor.zen15_power_switch_electric_w
    to: '0'
    for: '00:00:05'
- service: notify.hagroupnotifyphones
  data:
    message: 'Laundry is done.'

It is triggered by a Numeric State Trigger when the sensor reports a value greater than 2 for at least 1 minute.

After being triggered, the action contains a wait_for_trigger that waits until a State Trigger detects the sensorā€™s value is 0 for at least 5 seconds. Then it sends a notification.

1 Like

Nice and short, thanks. Ideally iā€™d like to have a separate ā€œwasher runningā€ binary sensor that i can display on a card thatā€™s more accurate than a template sensor on top of power consumption reading (because mine jumps to/from 0 watts during wash cycle). By more ā€œaccurateā€ I mean in sync with the notification - @123 can you suggest anything more elegant than having input_boolean.turn_on/off inside the automation you posted? This is already an improvement on 3 separate automations I have, but I still might stick with having a separate boolean input helper for status.

To be clear, what I posted was meant to show the bare minimum for detecting and reporting the end of a washing cycle. As we both know from experience, detecting the true end of the wash cycle is often more complicated than simply the moment it reports zero watts. In addition, we may want to know more about how far along the machine is in its operation (i.e. you are currently using an input_boolean).

I posted a detailed version of my configuration elsewhere in response to someone elseā€™s request for monitoring a washing machine. Itā€™s located here: Washer Monitor. However, hereā€™s a brief overview of the challenge I faced and what I concocted to address it.

For my trusty old washing machine, the reported power consumed by its wash and rinse cycles is nearly the same. In other words, if it reports a value of ā€œ380 Wā€ that information alone isnā€™t enough to determine if itā€™s currently washing or rinsing. All I can conclude is that it is ā€œrunningā€. However, itā€™s enough to tell me it isnā€™t ā€œfillingā€ with water (uses far less power) or in the ā€œspinningā€ phase (uses far more power).

The one saving grace is that when it reports ā€œ0 Wā€ it is truly off. However, thatā€™s insufficient to conclude it just finished a washing cycle. It may have just finished a prewash cycle and now the tub is filled with clothes soaking in wash water and the machine is consuming no power (and waiting for someone to turn the knob from ā€˜prewashā€™ to ā€˜washā€™ mode). The only way to determine if it just finished a wash cycle is to know the previous phase. Something is needed to track the machineā€™s phases (spoiler: itā€™s an Input Select).

The solution Iā€™m using contains three things:

  • Template Sensor to report simple operating phases inferred directly from power consumption: stop, fill, run, pulse, wait.
  • Input Select containing options representing the machineā€™s true operating phases: wash fill, wash, wash spin, wash drain, rinse fill, rinse wait, rinse, rinse drain, stop, and ā€˜unknownā€™ (for when things go awry).
  • Automation triggered by the Template Sensor which sets the Input Selectā€™s option to indicate the machineā€™s true, current operating phase.

The Input Select serves to track the machineā€™s operating phases. For example, if the Template Sensor reports ā€œrunā€ and the Input Select is currently set to ā€˜wash fillā€™ that means the machine just finished the ā€˜wash fillā€™ phase and is now in the ā€˜washā€™ phase. Therefore the automation sets the Input Select to the ā€˜washā€™ option.

  • When the Template Sensor reports ā€˜pulseā€™, the Input Select is set to the next phase: ā€˜wash spinā€™.
  • When the sensor reports ā€œrunā€ again, because the previous phase was ā€˜rinse spinā€™ itā€™s now set to ā€˜rinse drainā€™.
  • And so on and so on until the previous phase was ā€˜rinse drainā€™ and the Template Sensor now reports ā€˜stopā€™. Thatā€™s a clear indication that all wash phases have completed and the machine is truly finished washing a load of laundry.
1 Like

Haha, thatā€™s hardcore! Thanks for the link. I gotta try the input select trick to represent a state machine at some point.