{"id":550,"date":"2021-07-10T12:37:22","date_gmt":"2021-07-10T12:37:22","guid":{"rendered":"https:\/\/www.creatingsmarthome.com\/?p=550"},"modified":"2021-07-10T12:37:22","modified_gmt":"2021-07-10T12:37:22","slug":"home-assistant-pause-cooling-when-the-door-is-open","status":"publish","type":"post","link":"https:\/\/www.creatingsmarthome.com\/index.php\/2021\/07\/10\/home-assistant-pause-cooling-when-the-door-is-open\/","title":{"rendered":"Home Assistant: Pause cooling when the door is open"},"content":{"rendered":"\n<p>A big heat wave has hit Finland lately and it&#8217;s been quite hot for the last couple of weeks. That got me wondering about energy usage of the A\/C.<\/p>\n\n\n\n<p>Quite often we are hanging out on our terrace and the backdoor is open. However, I don&#8217;t want to cool the outdoor air and waste energy for that. That got me an idea, how about shutting down the A\/C unit when the door is open and continue cooling when the door is closed again? <\/p>\n\n\n\n<p>Oh, and of course it should work also on winter when heating is on. I don&#8217;t want to heat the outdoor air either \ud83d\ude42<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Required components<\/h2>\n\n\n\n<p>For this automation only two components are required: A\/C unit that can be controlled through Home Assistant and a magnetic door sensor.<\/p>\n\n\n\n<p>I have a Mitsubishi FH35 A\/C unit that has <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/gysmo38\/mitsubishi2MQTT\" data-type=\"URL\" data-id=\"https:\/\/github.com\/gysmo38\/mitsubishi2MQTT\" target=\"_blank\">custom made MQTT network controller<\/a> and a <a rel=\"noreferrer noopener\" href=\"https:\/\/www.aqara.com\/us\/door_and_window_sensor.html\" data-type=\"URL\" data-id=\"https:\/\/www.aqara.com\/us\/door_and_window_sensor.html\" target=\"_blank\">Xiaomi Aqara door\/window sensor<\/a> that is connected to Home Assistant through ZigBee network.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Automation<\/h2>\n\n\n\n<p>The automation logic is pretty simple:<\/p>\n\n\n\n<p><strong>When the door opens:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>If backdoor state is changed from &#8216;off&#8217; to &#8216;on&#8217; for 3 minutes (I don&#8217;t want to turn off the A\/C immediately if someone is just visiting the terrace and closing the door immediately)<\/li><li>If A\/C unit state is something else than &#8216;None&#8217;<\/li><li>Take a snapshot scene of A\/C unit<\/li><li>Turn off the A\/C unit<\/li><\/ol>\n\n\n\n<p><strong> When the door closes:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Restore the scene that was previously stored.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Bonus: Ready made automations<\/h2>\n\n\n\n<p>Here are the automation scripts I wrote. Of course, you need to modify those at least with your entity ids.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>- id: '1625563681954'\n  alias: 'Climate: Turn off A\/C when back door is open'\n  description: 'Turn off A\/C when back door is open'\n  trigger:\n  - platform: state\n    entity_id: binary_sensor.door_sensor_terrace\n    from: 'off'\n    to: 'on'\n    for: 00:03:00\n  condition: &#91;]\n  action:\n  - service: scene.create\n    data:\n      snapshot_entities: climate.heat_pump\n      scene_id: heat_pump_previous_state\n  - service: climate.set_hvac_mode\n    target:\n      entity_id: climate.heat_pump\n    data:\n      hvac_mode: 'off'\n  mode: single\n\n- id: '1625563856240'\n  alias: 'Climate: Restore A\/C when backdoor is closed'\n  description: 'Restore A\/C when backdoor is closed'\n  trigger:\n  - platform: state\n    entity_id: binary_sensor.door_sensor_terrace\n    from: 'on'\n    to: 'off'\n  condition: &#91;]\n  action:\n  - scene: scene.heat_pump_previous_state\n  mode: single\n\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A big heat wave has hit Finland lately and it&#8217;s been quite hot for the last couple of weeks. That got me wondering about energy&hellip;<\/p>\n","protected":false},"author":1,"featured_media":552,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[100,2],"tags":[101,105,106,7,103],"class_list":["post-550","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-home-assistant","category-inspiration","tag-a-c","tag-automation","tag-energy-saving","tag-home-assistant","tag-mitsubishi","has-post-thumbnail-archive"],"acf":[],"featured_image_src":"https:\/\/www.creatingsmarthome.com\/wp-content\/uploads\/2021\/07\/mitsubishi.png","author_info":{"display_name":"Toni","author_link":"https:\/\/www.creatingsmarthome.com\/index.php\/author\/topsy\/"},"_links":{"self":[{"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/posts\/550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/comments?post=550"}],"version-history":[{"count":4,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/posts\/550\/revisions"}],"predecessor-version":[{"id":555,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/posts\/550\/revisions\/555"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/media\/552"}],"wp:attachment":[{"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/media?parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/categories?post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creatingsmarthome.com\/index.php\/wp-json\/wp\/v2\/tags?post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}