Adding smarts to appliances with #homeassistant

Now I love a good gadget, but I need it to justify itself and its cost. As the IoT rage continues the next items to become smart are general home appliances, such as the Bosch Home Connect range.

Personally I can’t justify replacing my existing perfectly working white goods just for the sake of a few additional features I would probably only use rarely. However with the aid of an additional component I can add a simple smart feature.

Recently Amazon had a deal on TP-Link smart plugs, of which I am quite a fan, including the newish KP115 plug with energy monitoring. Previously with TP-Link plugs there had been a security vulnerability discovered in the API and the firm pushed a firmware version which closed access from external sources like Home Assistant. Thankfully this is now resolved and the KP115 has a newer version of firmware which just works with Home Assistant.

Anyway my plan is to use the energy monitoring features of the plug to check and notify me when the washing machine has finished. Not a big thing I know but unlike the tumble dryer which constantly beeps after finishing the washing machine is often forgotten about.

After plugging the washing machine into the plug, setting the plug up in the Kasa software, and then using the TP-Link Kasa integration in Home Assistant the plug was discovered, helpfully with its own energy sensor template.

I tried a few different methods to try and get things to work and the one I had most success with was using an automation which is triggered by an increase in power, i.e. the washing machine starting. This then waits for a good while as I know the wash cycle runs for about an hour so don’t need to check during this period. After this time it repeatedly calls a script, if the power usage is below a certain value, i.e. wash cycle finished then send a notification to my phone.

The automation code:

- id: '<ID>'  
alias: Washing Machine finished  description: ''  
trigger:  
- platform: numeric_state    entity_id: switch.washing_machine    attribute: current_power_w    for: 00:02:00    
above: '1.00'  
condition: []  
action:  
- wait_template: ''    
timeout: 00:60:00    continue_on_timeout: true  
- repeat:      
count: '3'      
sequence:      
- service: script.check_washing_machine_finished      
- wait_template: ''        timeout: 00:05:00        continue_on_timeout: true  mode: single

The script:

check_washing_machine_finished:  alias: check washing machine finished  
sequence:  
- condition: numeric_state    entity_id: switch.washing_machine    attribute: current_power_w    below: '0.01'  
- device_id: <device ID>    domain: mobile_app    
type: notify    
title: Home Assistant Notification    
message: Washing Machine has finished  
mode: single

On completion I get the following notification on my phone:

I’m sure there are far cleverer ways to use the power monitoring features of the plug with Home Assistant, but for now this suits me fine and reminds me to get the wet washing out of the machine. 😃

Related Post

Leave a Reply