#13: Saving Energy with Backdoor sensor
Home Assistant Automation Hardware

#13: Saving Energy with Backdoor sensor

William Zink

Introduction

In this post, I will be talking about all my complex automations that happen when the condo backdoor is open. I really enjoy this automation as it has a bit of wow factor when the lights come on automatically but also has some hidden features that I don't get to talk about as much.

TL;DR - I talk about my Z-Wave sensor for the backdoor, demonstrate my complex Node-Red automation.

Requirements

  1. Backdoor :)
  2. Sensor for the backdoor

First Steps

First I will define the ultimate goals with my backdoor

  1. If the shades are half way down and I open the backdoor, send them up. And pause the automation
  2. If the door is left open more than 3 minutes, turn off the AC.
  3. If someone opens the backdoor, turn on the alarm and notify me.
  4. If the backdoor is open after sunset turn on the outdoor lights automatically

So now that we define what we want to have happen when the backdoor opens, we now need to find a sensor capable of the job. There are quite a lot of options when it comes to finding a door sensor.

There are multiple protocols when it comes to picking your sensor that you might want to consider.

  1. Wi-Fi
    Pro: No Hub needed, custom firmware options
    Con: Battery hog, plus size is bigger
    Option: Sonoff Door Sensor Wi-Fi
  2. Z-Wave
    Pro: Reliable mesh-network
    Con: Not as stable as I would prefer, you need a Z-Wave specific Hub
    Option: Monoprice Z-Wave Plus Door Sensor
  3. Zigbee
    Pro: Many companies support Zigbee
    Con: You need an Zigbee specific hub
    Option: Ecolink Zigbee Door Sensor

Since I already was using Z-Wave with my August Lock (I have since just gone to the custom integration) I had already purchased the Aeotec Z-Wave Hub. So this narrowed down my choices and ended up choosing the Monoprice Z-Wave plus door sensor. I picked two of them up. One to automate my washer door, and the second for the backdoor.

Installation

You can place these anywhere on the door where it will separate. Since my door is a sliding class door, I chose towards the top so that I could replace the battery easily. Also, I chose the top because I also have a pretty drastic step down onto my deck and knew most people would be looking down at that and didn't want people to look at that.

After your sensor is installed it's time to set it up in Home Assistant. Since I chose Z-Wave I will be discussing that process.

Setup in Z-Wave

I have the Aeotec Z-Wave Hub setup in my Home Assistant, so this was easy as going to the Z-Wave network manager tab and adding a new secure node.

Sensor to Binary Sensor

Once the Node has been added you will have a sensor. With this sensor it gives you a lot of information, but the only information (attribute) that I care about in this instance is whether the door is open or closed. For this I created a binary sensor that would help readability and I could quickly see if the door was open or closed rather than determining the value of 22 or 23.

---
platform: template
sensors: 
  back_patio_door:
    friendly_name: 'Back Door'
    device_class: door
    value_template: "{{ is_state('sensor.back_door_status', '22') }}"

Source Code

Automation

I will post the picture of the backdoor automation in Node-Red then I will talk through it. If you are familiar with Node-Red then you can just copy what you need.

Node-Red flow for backdoor

If the binary sensor is turned on (door is open) then the top flow will execute:
Check the time, if it's after sunset then turn the backdoor light on
If I'm not home, set the alarm and notify me
Also start a 3 minute timer that if the door is still open it will turn off the AC
If the door is shut the bottom will execute:
Stop the 3 minute timer if it's on
   If the guest isn't home, return the AC and blinds to normal

Issues

My Monoprice Z-Wave sensors are not that expensive but I will say that I thought they would be a little bit more durable than I thought they would be. I had one of them crack due to temperature changes on a metal door and had another one completely stop working after about 3 months.

I contacted Monoprice and they sent me a new one for the one that completely stopped working which was nice but at roughly $20 USD it is frustrating.

Conclusion

I chose the Monoprice one due to their sleek design and toted battery life. I am happy with how small the sensor is and how well it performed. It is also a nice benefit that it adds to my Z-Wave mesh network so it can repeat if I add more devices near it. I have found my Z-Wave network pretty stable minus the two issues. The automation has a pretty cool wow factor and also nice that I can open my door when the weather is nice and not have to worry about the AC :)

Question

What other backdoor automations do you have that I might have missed?