Washing machine/tumbledryer notifications with Home Assistant
What do you do when you have appliances housed in an external detached garage that you want notifying of upon their completion, yet they’re too old to be natively capable and you have a fervent dislike of manufacturer shipped IoT? You build your own with HomeAssistant (HA) and Zigbee devices, of course!
My washing machine and tumbledryer live a few steps away from my house in a detached garage to attempt to mask some of the whiney noise they generate and to make more room in my relatively small kitchen. Naturally, every time I put a load of washing on I either check it before it’s finished and forget about it or forget about it entirely until a few hours later.
Though a simpler solution no doubt exists, my recent foray into home automation and local smart home systems has resulted in me attempting to force its use wherever possible. It’s fun, and though I was a cynic for so long, actually useful.
The Equipment
A problem I needed to solve before building anything else was the lack of reach of the Zigbee network into my garage. Fortunately, the majority of mains connected devices act as routers in the mesh relaying messages back to the co- ordinator. A spare plug top^1 in the corner of the kitchen later and a suitable extension of the network range was established.
I then plugged a current sensing plug^1 in the socket for each appliance to connect to. I chose to go with the higher rated 20a plugs assuming they’d be better suited to prolonged high current draw heating elements require than their 16a equivalents.
Next, I attached a door contact sensor^2 to the face and door of both machines and manually paired all of the devices to the router in the kitchen by “enabling joins” on the specific kitchen plug in Zigbee2MQTT. On one appliance I located the sensor on the top half of the door, on another the bottom. I’ve lost count of the number of times I’ve broken the one placed on the bottom off of its mount whilst taking washing out so I’d recommend positioning it on the top half of the door instead!
The Automation
Next I needed to create an automation to persist state, monitor inputs and notify upon certain triggers. Fortunately, HA makes this incredibly simple through their automation editing GUI.
I first needed a persisted value for the “state” of each appliance. This is to track whether the appliance is empty, running or requiring emptying. I accomplished this by creating a dropdown helper entity^3 for both the washing machine and the tumble dryer.
I then began to set the automation up the same way I always do: encapsulating all related logic to a given “process” in one automation, and utilising trigger IDs to perform relevant steps later. This reduces the number of “automation spaghetti” you end up with when creating individual automations and makes it easier to modify once you’ve completely forgotten how it all ties together.
Next, I created five triggers:
- Appliance power above a certain wattage for a period of time
- Appliance power below a certain wattage for a period of time
- Appliance contact sensor opened
- Appliance in “Needs Emptying” state for 2 hours
- Appliance in “Needs Emptying” state for 6 hours
Then, I configured different actions dependent on those triggers:
- Where the appliance power is above a certain wattage, it sets the appliance’s state tracker as “Running”.
- Where the appliance power is below a certain wattage, it sets the appliance’s state tracker as “Needs Emptying” and sends a notification.
- Where the appliance contact sensor is moved to an open state AND the appliance’s state tracker is “Needs Emptying”, it changes it to “Empty”.
- Where the appliance has been in the “Needs Emptying” state for 2 hours it sends a snarky text message to my wife and I.
- Where the appliance has needed emptying for 6 hours, it sends an even more snarky message given we’ve likely gone out or completely forgotten about it.
Findings
I’ve actually found this to be surprisingly useful. My wife indicates otherwise but between us we get more washing done after big trips away than we have done previously. At its core though, it was a fun and simple introduction into the world of home automation for us both that isn’t a complete gimmick AND solves a real life problem we were having. You can’t get much better than that!
At the same time I’ve learned numerous quirks of Zigbee, HomeAssistant and my appliances in general.
Firstly, cheaper Zigbee devices often remain “sticky” to the router they’re initially paired to. Though a better LQI route back to the co-ordinator likely exists, devices won’t move. To get around this, you need to enable joining on your specific router device and then reset the end device. It’ll then join the network through that router and hopefully remain sticky to it.
Secondly, some appliances stand by for a while before they finish their final cycle. Your automations need to cater for this. I set my tumble dryer finish trigger to have to be the case for 15 minutes.
Finally, Zigbee2MQTT (as far as I am aware) does not offer any indication of device failures. You have to work this out for yourself from the last report time.