3 minutes

View into the living room through an open doorAt the beginning of the coronavirus pandemic, my neighbors and I started to work at home. I took advantage of that. I played some work-related videos on my home theater system when one of my neighbors knocked on my front door to complain about the loud music. Without noticing, I left my balcony door open. I admit, that’s not a very friendly thing to do when playing loud music in an apartment building full of people working at home. So, I turned the volume down, closed my balcony door and my neighbors and I went along happy ever after. What’s left is a solution to avoid such things to happen ever again.

My idea was to trigger some sort of alarm when turning on the tv while my balcony door is open. I looked for WIFI enabled contact sensors to monitor the state of my balcony doors. It had to be WIFI enabled, since my only Zigbee hub was a Philips Hue Bridge which doesn’t support contact sensors. Buying smart home hub number six was no option for me. 😉

I bought and waited almost two months for a pair of WIFI enabled contact sensors from China. After trying hard, I learned the hard way that it is almost impossible to integrate WIFI sensors into Home Assistant without flashing. Flashing isn’t my thing and I don’t know if it was even possible with this specific sensor. So, I gave them to a good friend. He had some ideas to make use of these WIFI contact sensors.

Door contact visible on an open doorI surrendered and went looking for smart home hub number six, until I met a guy on a Dutch online marketplace. This guy had a flashed Zigbee stick with a custom 3D printed case, which works great with Home Assistant on a Raspberry Pi. I decided to try it out. After some research to prevent another mistake, I also bought myself two Zigbee contact sensors. To my own surprise, they both are working perfectly, so I started to create my warning system.

The system I had in mind is really simple. The only thing I needed, was a binary sensor which turns on when the home theater system is on while the balcony door is open. I created two sensors, so I can create the same warning in my bedroom. I dropped the following lines into my configuration file:

# Binary sensors example
binary_sensor:
  - platform: template
    sensors:
      br_tv_balcony_door_warning:
        friendly_name: "Bedroom tv and balcony door warning"
        delay_on:
          seconds: 6
        device_class: motion
        value_template: >-
          {{ is_state('binary_sensor.bedroom_tv', 'off')
             and is_state('binary_sensor.br_balcony_door', 'on') }}
      lv_tv_balcony_door_warning:
        friendly_name: "Living Room tv and balcony door warning"
        delay_on:
          seconds: 6
        device_class: motion
        value_template: >-
          {{ is_state('switch.home_theater', 'on')
             and is_state('binary_sensor.lv_balcony_door', 'on') }}

A screenshot of an Alexa RoutineNext, I created an Alexa routine for an audible notification. I used the ‘living room tv and balcony door warning’ sensor’ as trigger. When this sensor turns on, my Echo dot in the living room gives me a warning about the tv and the balcony door. See the screenshot to the right. I could also add a volume change to give this warming more power, but I decided not to do that. I like the soft and warm voice of Alexa at a low volume setting. With this warning system, I tried to create more of a friendly reminder than a smart speaker yelling at me. I think I succeeded.

Hopefully, there will be a proper Apple TV integration for Home Assistant in the near future. If that comes available, I will improve the balcony door warning in my living room. While waiting for that, I have some more ideas for the tv in my bedroom, since I can control more things like volume and media controls in there. I will tell you what I did, as soon as I made it.

I think this warning system will get the job done for now. If you have any ideas to improve my warning system, or if you know other situations where this can be helpful? Let me know in the comments.