Adding "Smart" to My Tumble Dryer Using a Power Metered Smart Plug.
Tags: homeassistant, homeautomation, hass, hassio
Published: 2022-02-20 18:25:46

Have you ever wanted your washing machine or tumble dryer to tell you when it's finished by sending you a push notification? I know this sounds like a very first world problem, but I wondered if I could put in place a simple solution to send out a notification when the washing machine or tumble dryer has finished so that the washing doesn't get forgotten about.

The chances are that if you've got a new washing machine or tumble dryer, it may already have smart capabilities built-in. Unfortunately, we're not so lucky, so I'm looking for a good retrofit option.

In a recent blog post, [I covered how I used a TP-Link Kasa Smart Plug with Energy Monitoring (KP115) to monitor the power consumption of my desk](https://www.jamesridgway.co.uk/monitoring-eaton-5sc-ups-scripts-and-integration-network-tools-home-assistant/). Where my desk setup is concerned, I'm monitoring the power consumption just for curiosity, but for the tumble dryer and washing machine, could I have an automation monitor the current consumption to determine when the machine has finished.

## The TP-Link Kasa Smart Plug with Energy Monitoring (KP115)
I already have one of these smart plugs, and I love it — it's reasonably priced at around £18, and adding the device into Home Assistant is very straightforward.

TP-Link has its own Kasa app for controlling their devices and performing the initial connection of the device to your network. I've used the Kasa app to do the device's initial setup and get it connecting to my network, but all of my automations run out of Home Assistant.

![TP Link KP115](https://www.jamesridgway.co.uk/content/images/2021/10/tp-link-kp115-power-monitoring-1.jpg)

Once you have used the Kasa app to add the device to your home network, go into Home Assistant, and under **_Configuration_** > **_Integrations_**, add a new Integration and select **_TP-Link Kasa Smart_**:

![Setup a new integration - TPLink Kasa Smart ](https://www.jamesridgway.co.uk/content/images/2021/10/add-integration-tp-link-kasa-smart.png)

And then provide the IP address of the plug; it's that simple:

![TP Link Integration - Specify host](https://www.jamesridgway.co.uk/content/images/2021/10/tp-link-specify-host.png)

You're now ready to start adding graphs to your dashboard or writing automations that use the smart plug!

![Example power comsumption graph that I use for my desk.](https://www.jamesridgway.co.uk/content/images/2021/10/office-desk-current-consumption.png)

## Monitoring the Tumble Dryer

With the new plug added to my network and registered within Home Assistant, the next step in the process is to see the power consumption of the tumble dryer. I put some washing into the tumble dryer, set it running, and was careful to observe when the tumble dryer actually finished.

This is what the current consumption looks like:
![Tumble Dryer Consumption](https://www.jamesridgway.co.uk/content/images/2021/10/tumle-dryer-current-consumption.png)

I started the tumble dryer at ~16:20, and it mostly draws around 11 amps for the main part of the drying cycle; after about 40 minutes, the current consumption varies between 11 and 7.9 amps for the final part of the drying process.

Based on these observations, it seems reasonable to assume that if the current drops below 5A for more than 1 minute, we can infer that the tumble dryer has finished and send out a group notification via Home Assistant:

```

alias: Tubmle Dryer Finished Push Notification
description: ''
mode: single
trigger:
  - type: current
    platform: device
    device_id: 682c615f60ea094f9ac185f64c8d0328
    entity_id: sensor.tumble_dryer_plug_current
    domain: sensor
    below: 5
    for:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
condition: []
action:
  - service: notify.family
    data:
      title: Tumble Dryer
      message: The tumble dryer has finished
```

I have several automations like these where I want any notifications to go to more than one person. Initially, I added a notification action per device to each automation, but this is incredibly tedious and will be painful to maintain in the future if devices change.

Whilst setting up the tumble dryer automation, I moved over to using groups for notifications.

Within my main `configuration.yaml` I split out different areas of my configuration into separate files:

```
group: !include groups.yaml
automation: !include_dir_list automations
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensor.yaml
notify: !include notify.yaml
```

In this update, I now have a `notify.yaml` that defines all the devices that should be notified when I send a notification to `notify.family`:

```
- name: Family
  platform: group
  services:
    - service: mobile_app_james_s_ipad
    - service: mobile_app_pixel_3
    - service: mobile_app_x20_pro
```

## The End Result
Thanks to a simple smart plug with power monitoring, Home Assistant can detect when the tumble dryer finishes and notify the family!

![Tumble Dryer - Push Notification](https://www.jamesridgway.co.uk/content/images/2021/10/tumble-dryer-push-notification.png)