UPDATE: This is a simple method how to use cheap motion sensor SW-420 and ESP8266 with Tasmota taped to a side of dryer to measure motion ( Dryer is ON ) and to tell when motion ended ( Dryer is OFF ) using cycle in HA to avoid false measurements.
This post is mainly for US where dryer has industrial RV power outlet/plug thus conventional power monitoring using smart plug is not possible
Hello Team
Im trying to create simple automation to announce via Alexa that DRYER is complete. Im using SW-420 motion sensor which is now integrated in HA and works. See in the picture.
The problem I have is that can not create a logical automation to recognize that Drying cycle is complete. The sensor goes ON and OFF very quickly and I can not use single movement event with delay since sensor can register if somebody will accidental trigger the motion e.g. wife putting a basket on top of the dryer.
something like When Cycle Count = 20 or more and last OFF was before 5 min than execute the Voice Notification.
Hey there! I am doing the same thing but with the Xiaomi vibration sensor. This device allows me to read the sensivity of the vibration which helps me figure out the spin cycle.
However, in your case, all you need to do is check that the state has been “off” for a certain amount of time, which is perfectly possible in Home Assistant. I use it on my washing machine sensor.
So, setup an automation, with a trigger like so:
platform: state
entity_id: switch.washing_machine_motion
to: 'off'
for: '0:05:00'
You will need to change the for attribute to be longer than the longest gap between state changes during a cycle.
Just to expand on my explination comment, I didn’t account for the off activation if someone knocks it.
In that case, I would make an input_number that counts how many times the sensor was activated. Then, add a condition in the automation trigger that checks that that input boolean is greater than 10.
This will stop false positives.
Also remember to reset the input_number to 0 every time your automation triggers after passing the condition.
Thank you Darren, it is what I was thinking about at first, But then when somebody would bump into the Dryer which unfortunately could happen when for example my wife puts something on top of it it will trigger ON/OFF falsely this automation.
I have to somehow group ON/OFF cycles and when it reaches e.g. 50 than execute time off.
something like
When Cycle Count = 20 or more
and last OFF was before 5 min
than execute the Voice Notification.
Agree with @hsepm and @vendo232, monitoring power consumption is probably more reliable. I use Hive plugs (UK), but TP Link HS110 plugs provide power monitoring too.
Bear with me…
I set up a sensor to expose the power attribute (which can be graphed);
…and then a binary sensor off this using the threshold platform - which, crucially, allows hysteresis. (graphing the above sensor helps to establish what values to use);
What is your motion sensor connected to? I have the same sensor on an esp8266 and I am using ESPHome to run this. In the yaml file for the esp device you can define delayed on and delayed off. See https://esphome.io/components/binary_sensor/index.html
I set the delayed_on to 5s, meaning the sensor only turns on when it detects motion for 5 seconds. This is long enough to avoid false triggers from someone opening the door.
I set delayed_off to just longer than the longest pause in the dryer cycle. In my case 6 minutes. So the sensor will only switch off when it hasn’t detected motion for a full 6 minutes.
This means the vibration sensor now stays on for the entire cycle instead of rapidly switching between on and off all throughout.
I then get my notification when the sensor goes off (which is 6 minutes after the dryer actually finishes but I can live with that.)
so far, trying to incorporate the simple cycle count and run the announcement when 20 counts are reached and OFF state for 5 min is present. Will have to figure out how to Reset the counter once the Dryer Complete automation runs.
The “Dryer Complete” automation may not work the way you expect.
It triggers when dryer_counter exceeds 20. This trigger will occur when the count changes from 20 to 21 It will not trigger when it changes from 21 to 22, or 22 to 23, etc (it triggers when the threshold value is crossed). So when the count is 21, it will check if dryer has been off for at least 5 minutes. If it has not the automation’s action is not executed … and the automation will not be triggered again (because the count has to drop below 20 and then rise above 20 to trigger the automation again).
Why not use the “Dryer Complete” automation to reset the counter? What’s the need to wait another 2 minutes before resetting it?
When “Dryer Complete” executes its action, the counter has served its purpose so you may as well reset it there as opposed to using a separate automation.
I have tried both: Xiaomi vibration sensor and power measurement and found power management far superior in terms of reliability.
You could even use the temporary additional power usage of crease protection (or anti-creasing, if your dryer has that feature) for a repeating reminder.