I am trying to send a notification on my phone when the washing machine has finished the job. I have an entity which measures the current consumption, and I would like to send a notification when the power consumption is <0.1 for more than 2 minutes.
Apparently works, but after the power consumption is <0.1 it starts sending repeated notifications every few minutes. It looks like a bug to me, but I am not sure. I think that the automation should be triggered only first time when the consumption goes <0.1w. But because it’s not working like that, in my case, the trigger should be a “step down” instead of a fixed value.
Is there a way to trigger the automation when “power consumption goes from >100 to <0.1”? I can’t use a fixed value, like this: “trigger when goes from 100 to <0.1” because Home Assistant may never see exactly 100w due to refresh rate.
Here is my current automation:
alias: keller_alert_washing_machine_finished
description: This automation create an alert if the washing machine is finished
trigger:
- platform: numeric_state
entity_id: sensor.washing_machine_power_consumption
for:
hours: 0
minutes: 2
seconds: 0
below: '0.1'
condition: []
action:
- device_id: 1db2211221942bcf0xxxxxxxxxxxxxxxx
domain: mobile_app
type: notify
message: Ready for another job
title: Washing machine is finished.
- device_id: ec56b2f6f3b1515axxxxxxxxxxxxxxxxx
domain: mobile_app
type: notify
message: Ready for another job
title: Washing machine is finished.
mode: single
The only reason your automation would re-triger would be if the power rose above 0.1 after two minutes, then went below 0.1 for two minutes. You probably have a bit of noise on the signal.
Thank you for your answer. I did that, unfortunately I have discovered the the problem has a different nature. The automation re-trigger because of some reading interruptions. In History Graph, there are some short moments without reading, after which, when everything came back to normal, the automation re-triggers. I am not sure how to investigate the issue…
I believe both answers should work just fine, but for the moment I want to still wait a few days with the “unstable setup” in order to do some more investigations. I will either find the root cause and fix it, or put the condition you suggested as a workaround.
I found the root cause. Unstable Wifi network(via Powerline Wifi Extenders to basement). Therefore I have some wrong readings from time to time.
I am using a mystrom switch, but the integration changed so that I cannot read the power consumption from switch properties anymore, so I have to use Rest Api Sensors:
sensor:
- platform: rest
name: "Washing machine power consumption"
resource: http://172.16.45.81/report
method: GET
unit_of_measurement: W
device_class: energy
state_class: measurement
value_template: "{{ value_json.power }}"
scan_interval: 10
MyStrom integration was more stable than RestAPI sensors, with the same wifi extenders.
I have put the condition as suggested, let’s see if it’s all ok after 1-2 days
Hi Tom.
Thank you. As expected, the solution proposed it works. I see that the automation triggers multiple times a day but the condition prevent it from notifying my phone.
I consider both Drew and Tom solutions valid, but I chose the second one because is more future proof(in case if more status values will be implemented).