Notification based on washing machine power level

Hi,

I set up notifications based on the power level of my TP-Link hs110 power plug connected to my washing machine.

laundry finished:

  alias: Notification - Washing Machine finished
  description: ''
  trigger:
  - below: '10'
    entity_id: sensor.washingmachine_current_watts
    for: 00:05:00
    platform: numeric_state
  condition:
  - condition: state
    entity_id: switch.waschmaschine
    state: 'on'
  action:
  - data:
      data:
        type: tts
      message: Laundry is ready
    service: notify.alexa_media_echo_dot

If the power level drops below 10 watts for 5 minutes, I assume the laundry is done and a message is played via alexa echo.

laundry started:

  alias: Notification - Washing Machine started
  description: ''
  trigger:
  - above: '10'
    entity_id: sensor.washingmachine_current_watts
    for: 00:01:00
    platform: numeric_state
  condition:
  - condition: state
    entity_id: switch.waschmaschine
    state: 'on'
 action:
  - data:
      data:
        type: tts
      message: Laundry started
    service: notify.alexa_media_echo_dot

if the power level goes above 10 watts, I assume it just started.

for washing machine started, the message keeps repeating as long as it stay above 10 watts. Is there a way to run it only once until it drops below 10 watts again? Or maybe is there a way to define the trigger to fire when watts start below 10 and goes above 10. I tried state instead of numeric state with from <10 to >10 but this seems not to be supported.

In general, is there a smarter way to handle this task by using power level which is more reliable?

thx & Best
Pete

1 Like

For those who are also looking for a smarter way of doing this automation, I share this great tutorial I found while looking for a solution.

5 Likes

I think I figured this one out and it is an easy solution.

Step 1. Create a toggle (Settings → Device and Services → Helpers → Create Helper)

Step 2. Set the input toggle to on once the power goes up (say more than 500W is a safe bet)

Step 3. Use the value as an additional condition in your script.