I’ve been using Home Assistant for about a month now (running HAOS directly on a Pi 5) successfully set up a few automations, but there’s one particular automation I can’t seem to figure out. I’m trying to manage my smart plug (switch.aqara_plug_switch), specifically focusing on its power consumption as monitored by sensor.aqara_plug_power. The objective is to have the switch automatically turn off under two conditions:
When it’s turned on but not in use, leading to a power draw of less than 5W for more than 1 minute.
When it has been used, but the power consumption subsequently drops below 5W for over 1 minute.
I can’t get the automation meant to turn off the switch to trigger. (it works if I manually run it). Here are the YAML configurations I’ve been working with:
Could anyone offer some advice on what might be causing this issue or suggest how I might adjust my automation to work as intended? I’d greatly appreciate any guidance or examples of similar automations that have been successful.
Thanks for pointing this out. I forgot to mention that the automation works when the value of sensor.aqara_plug_power start above 5. The problem was getting it to trigger when the switch turned on but never reached a number bigger than 5.
I think that i’ve actually managed to find a solution but i don’t know if its a good one.
It seems to be working so far.