Carpe Diem:27 November, 2020

Older Washing Machine -> Smart Washer with Notifications

This post may contain affiliate links. Please see our disclaimer for more info.

Part of just about everyone’s regular routine is washing clothes. It can be a pain especially with kids – dirty clothes build up like mad. If you’re like me and don’t have a fancy smart washing machine, you have to keep any eye on the washer to know when it has completed its cycle. This can be a pain when you have a few loads to go through and don’t want to babysit the washer all day. Luckily with a little additional hardware, you can set up notifications with Home Assistant to alert you when the cycle has finished.

Ingredients

Equipment

Not much is needed for this one. Just a smart outlet that is able to report on energy consumption. Any protocol (zigbee, zwave, wifi, etc.) is fine as long as it’s compatible with home assistant. For this project, I’m using a IRIS Zigbee Smart Outlet with Zwave repeater built in. This outlet is great because it runs like a normal zigbee outlet, but also it able to serve as a zwave repeater to boost signals in your home. Unfortunately Lowes. the owner of the brand, discontinued the brand early 2019, and it’s no longer available. Good news is that there are many alternatives out there like the TP-Link h110 – this outlet runs on WiFi, reports on energy consumption, and is a breeze to pair with HA. I’ll be writing in more detail on this outlet in a later post.

Integration

Smart Outlet

For the Iris outlet, integration is easy. Simply put the device in Zigbee pairing mode and add a device to ZHA within ZHA settings. To put the device in Zigbee pairing mode, press and hold the on/off button on the outlet for 10 seconds until you get the blinking LED indicator. To put this device in Z-wave pairing mode, folks have reported varied techniques. For me, I needed to press the on/off button rapidly 10-15 times until I received the blinking LED indicator. Once in pairing mode, use the add Z-wave device functionality in home assistant. See my post here for more details on Zigbee and Z-wave.

Once you have the outlet set up, plug your washing machine into the outlet and outlet into the wall. The outlet is a little larger so you might need to add an extension cord or multi-outlet plug.

Binary Sensor

Here we’re going to add a binary sensor template to HA. This takes into account the wattage currently being used on the switch and translates it to an on/off sensor for easy automation in HA. This is the part that took some trial and error. The goal is to read wattage to determine if the washing machine is running or not. The issue with this approach is that the washing machine uses a variety of currents that causes power consumption to fluctuates during run time. For my washer, I determined the following:

  • While the machine is in standby (not running) it used a trickle of current .1W
  • While the machine was running, it generally used > 10W, but did drop to below 1W for decent stretches of time (e.g. immediately after the spin and the basket is spinning down)
  • After the machine finished a load, it used a little bit more power in standby until the lid was opened .2W

I couldn’t just include a threshold wattage that if was exceeded consider the machine on and if lower consider the machine off because it dipped below that threshold a handful of times during the wash cycle. Luckily HA has a delay function built into templates. This essentially allows us to wait x minutes before changing from the on state to off. So if during this delay the wattage goes back up, the delay is reset. After some trial and error, I found 5 minutes to be the sweet spot. This does mean that I’m ultimately delayed in receiving my notification, but this hasn’t been a concern for me.

# configuration.yaml

binary_sensor:
  - platform: template
    sensors:
      washer_status:
        friendly_name: 'Washer Status' # whatever name you'd like
        delay_off:  #  delays turning the sensor 'off' from 'on'
          minutes: 5 #  by 5 min once the 'off' value condition is met
        value_template: >
          {{ states('sensor.washing_machine_energy')|float > 0.6 }}

Automation

Setting up automation is pretty simple, but I did need to do some trial and error. There are a few components for the automation:

HA Startup: This is just a little fail-safe I put in. Since normally this switch should always be on. I’ve set HA to turn the outlet on every time I boot HA. This likely isn’t needed at all since the outlets should remember their last state in the event of a power loss, but it can’t hurt.

# automations.yaml
- id: hass_startup
  alias: 'Hass startup'
  trigger:
    - platform: homeassistant
      event: start
  action:
  - service: switch.turn_on
    entity_id:
      - switch.washing_machine

Notification Trigger: Now that we have our binary sensor working correctly, we can use this to trigger automations. My automation is simple – when the sensor goes to the off state (from the on state, the only other possible normal state), send me and the wife (if we are each home) a notification that the machine has completed the cycle . For the notification, I use the iOS app, but you can use whatever notification protocol you normally use with HA. The below is a screenshot of my Node Red automation setup.

A nice thing about this setup is that the concept of tracking an appliances state can be used in a variety of situation. In my next post, I’ll be tracking my sump pumps to do some fun things.

Leave a Reply

Your email address will not be published. Required fields are marked *