Washing Machine Done Notification

In reviewing posts, I came across this similar issue: Notification when washing machine is done with KP115

However, I don’t see a solution ID’d, and my automation seems a bit different:

alias: Clothes Washer Done
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.clothes_washer_kp15_current_consumption
    from: ">6"
    to: <3
    for:
      hours: 0
      minutes: 2
      seconds: 0
condition: []
action:
  - service: notify.mobile_app_dave_sm_n986u1
    data:
      message: Clothes Washer is done
mode: single

When I manually run the automation, no errors appear and I get the notification.
But the automation does not run when the washer is actually used.

This automation was built in the GUI.

Your help is appreciated.

I’m not 100% sure what the right answer is as far as syntax goes, meaning quotes or no quotes, but those should match. Either both with quotes or both without.

I’m also not 100% sure that you can do that directly in the automation. You may need to create a template sensor or threshold sensor for your <3 / >6 state.

Someone smarter than me will have to elaborate…

@MandM78 Yes - I saw that too. I have tried changing in the GUI but it reverts back to:

from: ">6"
to: <3

I have never directly built a template or threshold sensor…so something new.

Pretty sure you need to use numeric state instead of state in your trigger.

That will give you above & below options so you won’t need to (incorrectly) use < or >

@ShadowFist so…just to be sure, you mean like this:

description: ""
mode: single
trigger:
  - platform: numeric_state
    entity_id:
      - switch.clothes_washer_kp15
    for:
      hours: 0
      minutes: 2
      seconds: 0
    above: 6
    below: 3
condition: []
action:
  - service: notify.mobile_app_dave_sm_n986u1
    data:
      message: Clothes Washer is done

Hence the trigger is looking for: to be above 6 for 2 minutes and then below 3 for 2 minutes and it should trigger. Right?

See? I knew it. Someone smarter than me DID come along to help! :smiley:

Thanks @ShadowFist !

@ShadowFist Well, tried that and got this error msg:

Message malformed: A value can never be above 6.0 and below 3.0 at the same time. You probably want two different triggers.

so I need two triggers. Thinking about this.

@ShadowFist OK. I’m a bit stumped and getting the following sequence in the yaml:

Washer starts, value goes above 6, then when drops to below 3 for 2 minutes, send notification.

Or am I looking at this wrong and should look at it this way:

When current consumption drops below 3 (meaning, it had to go above 3 at some point) for 2 minutes, then send notification.

Your help is appreciated.

If that’s all you need, then simply removing the above: 6 line.

The warning you got was correct. You can’t have above 6 & below 3 at the same time. Even if it knew you meant “trigger when it goes from above 6 to below 3”, you’d still encounter issues with missed triggers if reported eg. 4 for a second before it went below 3.

If you’re sure the current is never above 3 in standby and doesn’t stay below 3 for more than 2 mins during a cycle, removing the above: 6 line should be enough.
Otherwise play around with the values and timings until you’re happy. The history of the current entity will help avoid trial and error.

PS, speaking of entity. You have the wrong one in your second automation. It should be sensor.clothes_washer_kp15_current_consumption, not switch.clothes_washer_kp15

@ShadowFist Yes - I did catch the entity error - right after I replied…funny - too fast on the mouse - thanks.

I have been looking at the history data, that is how I came up with the 6 and 3 values.

OK - have removed the 6 value and code, will test it out and let you know how it works.

1 Like

For things that I want to track on/off state based on power consumption, I create template binary sensors called <device>_in_use. That keeps on/off detection logic separate from any actions taken based on that, and it makes debugging much easier.

Example:

  clothes_washer_in_use:
      unique_id: clothes_washer_in_use
      friendly_name: Clothes Washer In Use
      device_class: power
      delay_off:
        minutes: 2
      value_template: >-
        {{ states('sensor.clothes_washer_power') |float(default=0) > 7 }}

Then you can use this sensor as a simple trigger for automations.