If the washing machine completes the cycle and the clothes stay inside, bad things could happen. At least this is what my wife tells me. So here is a guide to detect the event of a washing cycle and export it to Home Assistant. There, it could trigger all kinds of notifications – phone app, smart speaker announcement, and so on. Here, I'm using a simple indicator light. As a bonus, the same sensor can also figure out when the washer door is opened, and only then turn off the indicator light.
I can think of several ways to detect a washing machine cycle. You could power it with a smart socket that includes power metering, and detect the surge in power input; you could tape some kind of light sensor to the control panel so it sees when the appropriate indicator comes on; you could use a microphone to record the beeps it make, possibly with the help of some signal processing. I chose to use a vibration sensor. The advantage is that if you place it on the door, then it can also double as a door-opened detector. I used an Aqara Zigbee vibration sensor, and placed it on the door with two-sided tape. It sits next to the handle, and far from the hinge (to amplify the swing).
This sensor can detect one of two things: vibration and drop. The vibration is what you get when the machine is spinning. A "drop" is a sudden jolt, which could work to detect when the door is opening. But it doesn't appear quite like this in HA – see below. Actually, this sensor can also report how it's positioned, as angles on the X, Y, and Z axes, but I'm not using that, and I think that once it's on the door, these never change. Well, maybe if the washing tips over, but I'm not too worried about that.
Ideally, the vibration sensor would detect when the machine spins, and that is the last step of a washing cycle. So a simple solution to the problem would be an automation rule for something like "vibration event detected for more than 5 minutes". That's what I tried first, and it doesn't work. To see why, here is a chart of the "vibration" and "action" (drop) events over time, as the machine runs through its cycle:
There are several things going on here: first, there are some short periods during the cycle when the vibration sensor activates. Second, action events sometimes also register as a vibration event. What I found is that this sensor never sends an event that's shorter than 89 seconds, even if it's just a drop (I dropped it on the table to test). This probably has to do with the software on the device, and we'll need a way to work around it.
So the solution, at least on my Bosch machine, is a split rule that goes like this: you wait for two separate vibration events, each lasting at least 2:30 minutes, spaced no more than 30 minutes apart. Only after you have those, then you wait for the final spin of more than 5 minutes. When it happens, the machine is done and you can trigger the desired notifications. And once that happens, this is when you look for an "action" event, which will tell you when the door is open.
To make it work, I used two separate automations: one for counting how many short (2:30 minute) events occurred, and the second to wait for the final spin and door open. They communicate with each other using a helper counter.
For the indication device I chose a small USB night light connected to a smart USB switch. It's located centrally in the house so anyone could see it and know to at least open the washer door. Here is what it looks like:
And here is what happens when you open the washer door:
I must admit that this is not bullet-proof. Sometimes the machine is on a short program. Or maybe it's loaded with a single heavy item so it dances a lot. Or maybe the dryer on top of it is vibrating just enough to itch the sensor. But for the regular program we most use, it works.
Next, I will probably look into the approach of hearing the beeps. Probably a little harder (my plan is to attach a microphone to a Raspberry pi and do the signal processing on it). But if it works, it could also send alerts for microwave beeps, and maybe the doorbell or smoke detectors. We'll see. And we'll hear. Hope you found this useful!
כתיבת תגובה