Get notification when power usage drops

I have a non-smart dryer and I want to get a notification when it finishes.
I bought a smart plug that can read the current going through the dryer.

I want that when the consumption drops to below 4w it should send a notification.
But it should send it once. I thought of checking if the previous data was above 4w and current below or equal to 4w. Is it possible to do that kind of stuff?
I already know how to send notifications.

i got to this point (not to check if the previous one was above 4w):

alias: Dryer finished
description: ""
trigger:
  - platform: state
    entity_id: sensor.tasmota_smartplug_2_energy_power
condition:
  - condition: numeric_state
    entity_id: sensor.tasmota_smartplug_2_energy_power
    below: 5
action:
  - device_id: e6919322b2d75551e03f3c932e03361e
    domain: mobile_app
    type: notify
    message: test
    title: test
mode: single

Will it go up beyond 4 when not running? If not then what you have should be fine, but if it fluctuates above 4 regularly then you’ll be in for a lot of nagging. I’m assuming your washer takes far more than 4 watts to run pretty much anything, maybe increase the threshold if that’s the case just to be safe.

Also, as a failsafe, you’ll want to make sure your conditions include to not fire if the device is unavailable or unknown, otherwise when you restart the integration you will get your notifications as well.

In idle it draws close to 0 watts. Fluctuates between 0 and 1. In the current config I get a notification when the state changes. In the running state it draws close to 1kw.

When I set it to like 50w it still fluctuates and still sends notifications.

The threshold is set to 4 watts because when I pause the dryer it draws like 7 watts, and I don’t want it to trigger a notification

Then I think what you have should be fine. Like I said, you might want to make sure you are testing for unknown and unavailable though.

I think you don’t really understand the problem here. With the current config I get spammed with notifications because it fluctuates between 0 and 1. The check is always succeeding because it is below 4, and it sends a notification.

If it were me, I would probably create a helper switch that turns on when your washer goes above a certain point, indicating that it’s running and you want a notification. Then notify when it falls below 4 and also turn that helper toggle off. Then part of your condition is that if the helper is ON and it falls below 4 then notify. That way the fluctuations won’t impact you and you create a more dynamic system.

And how would I implement stuff like that. I am pretty new to it so i don’t really know what and how can I do it.

First you create a toggle device in your helper entities.

Then you create automation that fires any time your washing machine outlet DEVICE changes power at all, from there you test if it’s above 6 to turn on the new helper entity, and if it falls below 5 and that entity is on then send a notification and then turn OFF the helper entity so it doesn’t fire again.

You’ll need to change the first DEVICE to your own since I don’t know it’s ID and change the helper entity from “washing_machine_on” to whatever you called yours:

alias: "Washing Machine"
description: ""
trigger:
  - type: power
    platform: device
    device_id: 12e8d56a042e0265753eb1411ea4a1d5
    entity_id: fe9037d4fd681c94054cc126c5500d0d
    domain: sensor
condition: []
action:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: sensor.washing_machine_active_power
            above: 6
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id: input_boolean.washing_machine_on
      - conditions:
          - condition: and
            conditions:
              - condition: state
                entity_id: input_boolean.washing_machine_on
                state: "on"
              - condition: numeric_state
                entity_id: sensor.washing_machine_active_power
                below: 5
        sequence:
          - service: persistent_notification.create
            data:
              message: Your laundry is done!
              title: Washing Machine
              notification_id: notify_wash_done
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.washing_machine_on
mode: single

alias: Dryer finished
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.tasmota_smartplug_2_energy_power
    below: 4
    for:
      minutes: 1 # you may have to increase this time if there are longer pauses in your drying  cycle.
action:
  - device_id: e6919322b2d75551e03f3c932e03361e
    domain: mobile_app
    type: notify
    message: test
    title: test
mode: single

Also try to avoid using device ids.

1 Like

This person made a blueprint that might help. It has a starting and ending delay and threshold