Laundry Is Dumb. Make It Smart.
I’ve automated a good portion of my own home and that of many others over the years. Rarely it’s an easy task, complications come quickly, and navigating endless integrations is near impossible for people who aren’t tech-savvy. That’s arguably one of the biggest downfalls of the home-automation landscape today.
We’re in a time where every company is trying to figure out ways to make it easier for the average person to use their products without having any sort of tech-experience. The problem is we’re in a stage of limbo, and will likely remain in this stage for at least the next decade. Devices can get smarter, but there’s the problem of having them installed, configured, and integrated. This problem extends to having to install 20 different apps on your phone to allow the integrations of all the different brands. It’s a disaster. But, I’ve got the keys.
I’ve built a lot of cool things over the years, but one thing has haunted me for quite some time. My laundry.
The thing is my washer is pretty good, but my dryer absolutely sucks. For whatever reason it takes two complete drying cycles to get anything less than a half load to a place where they can be hung & fold. One would think this is a problem with exhaust, or overloading the device. I’ve read the manual, and I’ve conferred with other residents in my building that have the same device and we all have the same issue. So, I need to run this damned thing for at least 1.5 or 2 cycles. Further, this model doesn’t have any sort of buzzer to alert that the cycle has completed, yet it has the great feature of being incredibly quiet in it’s run cycle, so it’s near impossible to know when it’s finished unless you’re keeping an eye on the clock. That basically means I never know when my drying is done. That needed to end.
I Can Automate This.
There’s “smart” washers and dryers on the market, which come at a hefty price. They’re basically your everyday “dumb” device, just with a nice little LCD control panel and WiFi built into it. The thing is, these devices are generally complete trash. The moment the little microprocessor in the control panel dies (based on many reports, is often) your device suddenly becomes incredibly expensive to fix. These companies rely on this type of repair (or replace) income to bolster their bottom lines. The reality is the “dumb” devices are far better made more often than not (save for my dryer). I’ve got one of the “dumb” washers and also dryers.
It just takes a bit of creativity. The goal was to find a way to make these non-automated devices, well… more automated. With a few sensors, some scripting, and a device to scream at you to get your butt off the couch when things are done.
Components & Their Installation
First thing is first, we need to know what’s going on with the devices. In this instance I used a SmartThings Multi-sensor for the dryer, with the body of the device attached to the main dryer assembly, and the magnetic part of the contact sensor stuck strategically on the dryer door. Getting this right is critical, so you need to ensure the contact sensor properly reads open/closed as the door opens and closes. It is able to provide me open/closed status (contact sensor), and also acceleration (vibration) readings. They also provide temperature readings as well as XYZ Axis readings, but we don’t care so much about that. For the washer, I simply used a smart plug between the washer’s mains and the outlet on the wall. In this case it was a Sengled SmartPlug that has energy monitoring – the critical part of this component. I’ve also installed a contact sensor on the door so I can gather information as to the last time the washer door has been opened. That takes care of gathering the information we need, but now we need to process that info into something useful.
As the main brain of my home automation I run a Samsung SmartThings hub, and also have myself in the Amazon Echo ecosystem for voice control. These all integrate along with WebCORE scripting to make this happen. What’s WebCORE you ask? Well, we’ll get to that.
Putting The Basics Together
After adopting these devices into my SmartThings instance I ensure to move them to the proper groups (optional) and ensure I’m getting readings from everything. I won’t go over that process for the sake of time and ease. Next I need to install WebCORE and link it with my SmartThings instance. While this was done previously for other projects I’d worked on, someone starting out with WebCORE would need to do this. This used to be far more complicated, but the process is dirt simple these days, as easy as installing an app. I ensure to allow WebCORE to read sensor information from my new devices, a step many people miss (and then proceed to want to pull their hair out trying to figure out why it’s not working).
Before getting to the scripting, we need some baselines. For the dryer we know that when it’s not operating there will be no vibration, and vice-versa when it is. We also know the open/close status of the door. The washer is again the same process for the door contact sensor, but we need to establish it’s idle power draw. This is easy to determine, as you simply ensure the washer is powered on, but not actually running a cycle. Measure the power draw and mark this down. For me, it was 14.8W, and during a cycle it usually jumps around between 60-180W. We’ll add 10W for a solid 25W as an idle threshold just to be safe.
We will also create two new virtual switchs in SmartThings and name them “Dryer Completed” and “Washing Completed”. A virtual switch is more or less an “on/off” variable that appears like it’s a wall switch. This is important as it allows us to send information back to our Alexa device and is critical if we want Alexa to do some voice notifications. Currently there’s no elegant integration between SmartThings and Alexa to announce voice notifications from your speaker(s) so we’ll simply build our own. That’s what these virtual switches help with.
Time To Start Coding
I loaded up WebCORE and created 6 different pistons. A piston is a “program” or “script” that is constantly monitoring the readings coming from your various devices it has access to. We need to ensure to define a couple global variables that can be shared between the pistons. I’ve laid out the global variables below along with each of the scripts I’ve created :
@dryer_started (boolean) : Is the dryer running?
@dryer_started_at (date/time) : Time the dryer started it’s cycle
@dryer_completed_at (date/time) : Time the dryer completed it’s cycle
@washer_started (boolean) : Is the washer running?
@washer_started_at (date/time) : Time the washer started it’s cycle
@washer_completed_at (date/time) : Time the washer completed it’s cycle
@wet_laundry (boolean) : Determines if there’s wet laundry waiting to go into the dryer
Dryer Cycle Start
If we know the dryer’s contact sensor is closed (door closed) and we sense vibration for more than 10 seconds straight, we know the dryer has been engaged in a cycle. We then set the @dryer_started_at to the current date/time, change @dryer_started to TRUE and we’re good. We send a quick PUSH notification to our phone and change the status of the virtual switch we created in SmartThings to OPEN which basically resets the voice notification variable (this will be important later).
Dryer Cycle End
If @dryer_started is true (meaning it was running) and we’ve no longer sensed vibration for 20 seconds or more, we know the dryer has completed it’s cycle. I set the timeframe for 20 seconds as my dryer does like to stop, wait, and then start another portion of it’s cycle about half way through and I don’t want to get false positives.
Once this is determined, we change the @dryer_started variable back to “false”, set the @dryer_completed_at date/time, and create a message “Dryer cycle completed – [time]”, where we replace the time with a calculation of how long the cycle lasted (done by subtracting the start time from the end time). This message gets pushed to my phone as an alert. Last we of course change the status of a virtual switch we created in SmartThings to closed, which then triggers a voice notification. I’ll explain how that’s done further down.
Washer Cycle Start
Same concept as the dryer. We check to ensure @washer_started is FALSE and the power draw is more than 25W. If it is, then we set the variable @washer_started_at with the date/time, @washer_started to TRUE, @wet_laundry to FALSE (because it’s not sitting there wet, but actually being washed), send a push notification that a washing cycle has started, and change the virtual switch for washing to OPEN.
Washer Cycle End
Again, exact same theory as the drying. This time we check for @washing_started is TRUE and as soon as the power draw goes under 25W for a period of 30 seconds or more, we know the cycle has completed. We proceed to set @washing_completed_at to the date/time, @washer_started to FALSE, @wet_laundry to TRUE, send a PUSH notification to our phone, and change the virtual switch for washing to CLOSED.
Dryer Interrupted
Here’s a tricky one. Let’s say the dryer door is opened mid cycle, even for a split second. That will pause the cycle, and potentially end it. In the logic of the program, we have to assume the cycle has ended, but we also don’t want our phone blowing up or voice announcements yelling at us. As such, we build a new piston.
This checks to see if @dryer_started is TRUE and the dryer’s contact sensor changes to OPEN. If it does, then we set @dryer_started to FALSE, and mark down the @dryer_completed_at date/time. That more or less resets everything. If we choose to resume the dryer’s cycle, the Dryer Cycle Start piston will pick it up again and we’re back in business.
We don’t need to worry about a Washer Interrupted piston as my machine more or less has to run it’s cycle and the only option to pause it, I never use. I suppose in the future I will code in provisions if the power goes out or something, but that could get complicated quickly as if that happened all my sensors would no longer be communicating back to WebCORE anyways.
Wet Laundry
Nothing is worse than leaving wet laundry in the washer for hours, or worse, overnight. For that reason we build a new piston. This one checks to see if the variables @dryer_started has been FALSE (meaning the washer hasn’t been running), the washer’s contact sensor has been CLOSED (meaning the door hasn’t been opened), and the variable @wet_laundry (which we set when the dryer finishes it’s cycle) have all been TRUE for a period of 10 minutes. If so we know the washer hasn’t been operating for 10 minutes, and the washing machine’s door hasn’t been opened since the cycle finished. A soggy pile awaits us. We then send a PUSH notification to our phone alerting as such.
We could end there, but I decided to setup a second alert (all using a second conditional If/Then statement). This one does everything the first one does, but sets the time at 20 minutes. If it sees these values sitting for a period of 20 minutes it then sends another PUSH notification, and also sets the virtual switch for Completed Laundry to CLOSED.
I decided not to do a reminder alert for the dryer as I do tend to leave the drying running when I leave the house and I don’t want to get reminded constantly when I do. When I get home I toss it on for a quick 10 minute air fluff and I’m good to hang my stuff without wrinkles.
Voice Alerts With Alexa
Finally, the missing piece a lot of people have struggled with. Sadly the plugin “Alexa Talks” has long since been abolished and there’s no real and tangible solution in place. There’s an app called Voice Monkey, but I really don’t want to have to use more 3rd party services. That’s where these virtual switches come into play.
Within Alexa I create a routine for “Dryer Completed Alert”. It monitors the status of the virtual switch “Drying Completed” and when it sees it change to “CLOSED” it knows that a cycle has completed. It then announces “Drying is completed!” over my SONOS speaker in my living room. Realistically this could be broadcast over any Alexa enabled speaker device (like an Echo Dot even), but I prefer the better sound quality out of the SONOS devices as I do like to use them for music occasionally.
We setup the same routine for washing, and that’s about it. We don’t have to worry about further voice alerts as the routine only monitors for when the virtual switch CHANGES TO “closed”. When we set it back to open in WebCORE, Alexa doesn’t care, and doesn’t react.
End Notes
That’s it. There’s some efficiencies I could absolutely write into the code, but for the most part it’s all fairly lean. I’ve been running it for about a week now and I’m quite happy with the performance. I’ve yet to see any problems arise, but should they, I’ll absolutely be tweaking and updating this. The concept is similar to what others have done, but I’ve added a few extra checks, many of this automations don’t have a wet laundry check, and I’ve yet to find one that properly integrates into Alexa for voice notifications.
I’ll consider posting the piston reference numbers so people can copy the code if they’d like. After all, I do believe any good idea is one worth sharing.
If you’re frustrated with your laundry, or want to have a system like this in your home, drop me a line and we can talk about how to make it happen. Maybe this will be your step towards a more automated home!