{"id":213,"date":"2021-04-26T20:27:53","date_gmt":"2021-04-26T19:27:53","guid":{"rendered":"https:\/\/www.slowergram.com\/?p=213"},"modified":"2021-04-26T20:42:07","modified_gmt":"2021-04-26T19:42:07","slug":"adding-smarts-to-appliances-with-homeassistant","status":"publish","type":"post","link":"https:\/\/www.slowergram.com\/index.php\/2021\/04\/26\/adding-smarts-to-appliances-with-homeassistant\/","title":{"rendered":"Adding smarts to appliances with #homeassistant"},"content":{"rendered":"\n<p>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 <a rel=\"noreferrer noopener\" href=\"https:\/\/www.bosch-home.co.uk\/bosch-innovations\/homeconnect\/homeconnect-washers-and-dryers\" target=\"_blank\">Bosch Home Connect<\/a> range.<\/p>\n\n\n\n<p>Personally I can&#8217;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.<\/p>\n\n\n\n<p>Recently Amazon had a deal on TP-Link smart plugs, of which I am quite a fan, including the newish <a rel=\"noreferrer noopener\" href=\"https:\/\/www.amazon.co.uk\/dp\/B08LZWBTR6\/ref=cm_sw_r_cp_apa_glt_fabc_YEA6Z7K1XRACJS6TNPRQ?psc=1\" target=\"_blank\">KP115 plug<\/a> 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.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>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&#8217;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.<\/p>\n\n\n\n<p>The automation code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>- id: '&lt;ID>'  \nalias: Washing Machine finished  description: ''  \ntrigger:  \n- platform: numeric_state    entity_id: switch.washing_machine    attribute: current_power_w    for: 00:02:00    \nabove: '1.00'  \ncondition: &#91;]  \naction:  \n- wait_template: ''    \ntimeout: 00:60:00    continue_on_timeout: true  \n- repeat:      \ncount: '3'      \nsequence:      \n- service: script.check_washing_machine_finished      \n- wait_template: ''        timeout: 00:05:00        continue_on_timeout: true  mode: single<\/code><\/pre>\n\n\n\n<p>The script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>check_washing_machine_finished:  alias: check washing machine finished  \nsequence:  \n- condition: numeric_state    entity_id: switch.washing_machine    attribute: current_power_w    below: '0.01'  \n- device_id: &lt;device ID>    domain: mobile_app    \ntype: notify    \ntitle: Home Assistant Notification    \nmessage: Washing Machine has finished  \nmode: single<\/code><\/pre>\n\n\n\n<p>On completion I get the following notification on my phone:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"310\" src=\"https:\/\/www.slowergram.com\/wp-content\/uploads\/2021\/04\/Screenshot_20210426-104917-1024x310.png\" alt=\"\" class=\"wp-image-214\" srcset=\"https:\/\/www.slowergram.com\/wp-content\/uploads\/2021\/04\/Screenshot_20210426-104917-1024x310.png 1024w, https:\/\/www.slowergram.com\/wp-content\/uploads\/2021\/04\/Screenshot_20210426-104917-300x91.png 300w, https:\/\/www.slowergram.com\/wp-content\/uploads\/2021\/04\/Screenshot_20210426-104917-768x233.png 768w, https:\/\/www.slowergram.com\/wp-content\/uploads\/2021\/04\/Screenshot_20210426-104917.png 1080w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I&#8217;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. \ud83d\ude03<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;t justify replacing my existing perfectly working white goods just <a href=\"https:\/\/www.slowergram.com\/index.php\/2021\/04\/26\/adding-smarts-to-appliances-with-homeassistant\/\" class=\"btn btn-link continue-link\">Continue Reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[19,33,34],"class_list":["post-213","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-automation","tag-homeassistant","tag-smartphone"],"_links":{"self":[{"href":"https:\/\/www.slowergram.com\/index.php\/wp-json\/wp\/v2\/posts\/213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.slowergram.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.slowergram.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.slowergram.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.slowergram.com\/index.php\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":0,"href":"https:\/\/www.slowergram.com\/index.php\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.slowergram.com\/index.php\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.slowergram.com\/index.php\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.slowergram.com\/index.php\/wp-json\/wp\/v2\/tags?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}