Monitoring Washer and Dryer Status in Home Assistant

2017-06-22 in Home Automation using tags HomeAssistant

The washer and dryer that we have doesn’t have any sort of remote notification of load status other than a loud beep. Since it is in the basement in a closed room we often forget or just don’t know when the loads are complete. I wanted a way to see in near real time what the status of the load was in at least an “on/off” fashion remotely as well as receive notifications when loads were complete.

I tried doing this first with an ESP8266 and some vibration sensors. While it somewhat worked, it was difficult to get an accurate reading even with a pretty sensitive gyroscope replacing the vibration sensor. It was especially difficult on the washer as it often would stop moving during its cycle as it filled, soaked and drained. After quite a bit of fiddling I abandoned this method.

I was already using a Z-Wave Aeotec Home Energy Meter to measure my entire house power usage so I knew it was fairly accurate even though it used CT clamps. I bought two more of these devices in the older versions as they were very cheap on eBay. While I use HomeAssistant as my main home automation hub, I still use SmartThings as a bridge for the Z-Wave and Zigbee devices via MQTT.

The default device handler in SmartThings doesn’t have a very quick update frequency so I used a custom device handler that had a much quicker and adjustable frequency. Note that this is only for the Gen1 devices.

After installing a single clamp on one to the feed wires for the washer and a single clamp on the other to the same for the dryer I could then see the current wattage draw of the appliances. Usual warnings apply here for working inside your electrical panel. Don’t do the install yourself if you aren’t comfortable and know what you are doing. I probably could have done this for the washer with one of the outlets that measure current but that wouldn’t work for the dryer and its 240V outlet. Being consistent with the measuring device made sense in the end.

Once I had these in Home Assistant I could easily build automations around it to send me notifications. I decided to use some input booleans for the state so I could flip them on and off through the automations as well as easily test the notification portion without having to start and stop the actual appliances. I also needed to make sure that the washer notification only triggered after so many minutes of low wattage usage since the accuracy of the meters wasn’t quite good enough to always deal with the washer in its ‘quiet’ parts of the cycles using very little power. Home Assistant handled this easily with the ‘for’ time condition on the state change.

It ends up looking like this in Home Assistant for me:

Home Assistant Appliances

Example automations are below, make sure to tweak the wattage values and time threshold for the washer to what makes sense.

automation:
- alias: "Washer On Threshold"
  trigger:
    platform: numeric_state
    entity_id: sensor.washer_power_monitor
    above: 50
  action:
    service: homeassistant.turn_on
    entity_id: input_boolean.washer_state

- alias: "Dryer On Threshold"
  trigger:
    platform: numeric_state
    entity_id: sensor.dryer_power_monitor
    above: 100
  action:
    service: homeassistant.turn_on
    entity_id: input_boolean.dryer_state

- alias: "Washer Off Threshold"
  trigger:
    platform: numeric_state
    entity_id: sensor.washer_power_monitor
    below: 51
  action:
    service: homeassistant.turn_off
    entity_id: input_boolean.washer_state

- alias: "Dryer Off Threshold"
  trigger:
    platform: numeric_state
    entity_id: sensor.dryer_power_monitor
    below: 101
  action:
    service: homeassistant.turn_off
    entity_id: input_boolean.dryer_state

- alias: "Washer Finished Notification"
  trigger:
    platform: state
    entity_id: input_boolean.washer_state
    from: 'on'
    to: 'off'
    for:
      minutes: 8
  action:
    - service: notify.ios_iphone
      data:
        message: "Washer has finished it's load"

- alias: "Dryer Finished Notification"
  trigger:
    platform: state
    entity_id: input_boolean.dryer_state
    from: 'on'
    to: 'off'
  action:
    - service: notify.ios_iphone
      data:
        message: "Dryer has finished it's load"
    - service: notify.ios_kim_anthony_iphone
      data:
        message: "Dryer has finished it's load"