I’m very new to Home Assistant and have had some success with basic automations but not much with anything more complex.
I have my washing machine connected to a TP-Link KP115 smart plug with energy monitoring and I’d like to set it up so that when a load is finished and power draw is at idle (approx 2.5w) for 5 minutes that it switches the plug off and notifies me on my phone. I can’t seem to get this working using the UI editor and I’m not confident with YAML yet.
Could I please get some feedback and advice on how to set this automation up correctly?
Many thanks
alias: Washing machine finished
description: Switch off and notify when finished
trigger:
- platform: device
type: turned_on
device_id:
redacted
entity_id: switch.washing_machine
domain: switch
condition:
- condition: and
conditions:
- condition: state
entity_id: switch.washing_machine
attribute: current_power_w
state: below 3
for: '00:05:00'
action:
- type: turn_off
device_id:
redacted
entity_id: switch.washing_machine
domain: switch
- device_id:
redacted
domain: mobile_app
type: notify
title: Washing Machine
message: Your washing is done.
mode: single
Thanks for the feedback nickrout. Would this be more appropriate? I chose 3w instead of 2.5 because at idle (e.g. when the washing cycle is done and the lights are on) the power usage can be anywhere between 1.5-2.7 w.
alias: Washing machine finished
description: Switch off and notify when finished
trigger:
- platform: state
entity_id: switch.washing_machine
attribute: current_power_w
to: below 3
for: '00:05:00'
condition: []
action:
- type: turn_off
device_id: ***
entity_id: switch.washing_machine
domain: switch
- device_id: ***
domain: mobile_app
type: notify
title: Washing Machine
message: Your washing is done.
mode: single
FYI, I tried the above automation and nothing happened.
I manually ran the action and both of the actions worked fine - the switch turned off and the notification appeared on my phone.
It had been more than 5 minutes since the washing machine finished (in which time the watts remained below 3).
Is it possible to access a log or something to determine if HA and the plug are playing nice?
Found this when searching for a way to switch something on & off depending on the level of Solar PV generation. I am new to Home Assistant and was struggling to get the “terms” & “syntax” right.
The solution helped, and I have now been able to get the following to work in 2 separate Automations:
My entity is a Power Meter from a energy monitor on a cord.
Just getting confused here by the Attribute that was mentioned attribute: current_power_w. Is this actually needed? I Checked the Dev Tools and don’t see that listed as an attribute for the energy monitor entity.
This topic seems to capture my problem as well and none of the solutions work in my case. I want to essentially do the same thing (switch a smart plug off when power draw drops below a threshold).
The action works fine, but the trigger just does not. I‘ve also tried using current, but to no success. No errors either. Have confirmed the entity and state in the dev tools. It must be something I‘m not understanding about the plugs, I believe.
Interestingly, this works if I specify the power state of the plug as a condition, not a trigger. Could it be that this only works when switching to a state that the trigger applies to? Then my misunderstanding would be a fairly basic one. Glad if anybody could illuminate.
alias: Entryway off
description: ""
trigger:
- platform: time
at: "21:00:00"
condition:
- condition: numeric_state
entity_id: sensor.plug_1_power
below: 2
action:
- service: switch.turn_off
target:
entity_id: switch.plug_1_switch
data: {}
mode: single
I’m looking to do the opposite. I want to turn a switch off for 5-10min if too much power is being used. Basically like a self-resetting circuit breaker. I have an outdoor wyze outlet and don’t want too much power being drawn.