Help with automation "power detection"

Hey there, i have a challenge and i need your advice on how to do it.

here i go … i have connected the washer machine to a power monitoring switch , from there everything works great , i can see the power consumption in HA and all.

now i would like to be able to alert receive an alert when the washing cycle finishes .From here, it seems simple.

My challenge is the following, i need to check repeatedly to detect when the cycle is really finished as the consumption is versatile. My starting point is 0.1 amps, to 5 , to 0.something … then 0.1 …then …you see the what i mean

so i would like to detect when it start it’s consumption 0.1 amps …to when it’s completely finished by looking in loop if the power is back down for a certain period of time ( let’s say 2 min ) and then send the notification if it’s the case.

here’s the image of what the consumption look like … it shows 3 complete washing cycles

any idea ???

thanks in advance guys !

You likely will want to use something like this.

- alias: Washer Done
  trigger:
     platform: template
     value_template: "{% if (states.your_power_sensor.state | float) < 0.1 %}true{% endif %}"

     for:
       minutes: 2

  action:
   <insert notification service data here>
1 Like

thanks @firstof9 , will try it out tomorrow and post the result here !

got it to work …

this is what i implemented :slight_smile:
- alias: Lavage terminé
  trigger:
    platform: numeric_state
    entity_id: sensor.zooz_zen15_power_switch_current
    # Optional
    # value_template: '{{ state.sensor.zooz_zen15_power_switch_current.state }}'
    # At least one of the following required
    above: 0.11
    # If given, will trigger when condition has been for X time.
    for:
      minutes: 3
  action:
    service: tts.google_say
    entity_id: media_player.maison
    data:
     message: 'La brasse de lavage est terminé'
     language: 'fr'

thanks for the help , it pointed me in the right direction !

Good, thank you for sharing!

To be fair I only suggested the template as I wasn’t 100% sure the numeric_state would work on floats :wink:

I implemented this by setting a boolean when washing begins, then using that as a condition of reporting that it’s ended. Otherwise, I think the solutions presented so far will give you erroneous alerts if you restart HA when your washer is idle.

My hardware is Z wave, so YMMV.

- alias: 'laundry: washing begins'
  trigger:
    platform: numeric_state
    entity_id: sensor.washing_machine_power
    above: 50
    for:
      minutes: 1
  condition:
    condition: state
    entity_id: input_boolean.washing_active
    state: 'off'
  action:
    - service: notify.low_priority
      data:
        title: ''
        message: 'washing has begun'
    - service: input_boolean.turn_on
      entity_id: input_boolean.washing_active

- alias: 'laundry: washing ends'
  trigger:
    platform: numeric_state
    entity_id: sensor.washing_machine_power
    below: 1
  condition:
    condition: state
    entity_id: input_boolean.washing_active
    state: 'on'
  action:
    - service: notify.medium_priority
      data:
        title: ''
        message: 'washing has ended'
    - service: input_boolean.turn_off
      entity_id: input_boolean.washing_active

Interresting @Human will look into it :slight_smile:

Seems to work like a charm :slight_smile: i’ll will let it run for a few days and come back here if anything . You can take into account that it works

The only addition i would do is that you need to add a logical switch ( boolean sensor ) in your configuration.yaml or external yaml file for it to work :wink:
ie :

input_boolean:
  washing_state:
    name: State of the washing machine
    initial: off
    icon: mdi:washing-machine

Glad it’s working for you! I neglected to mention the input_boolean, so thanks for listing it in your post so that others can see it.