Hi All,
This project is an addition to the already existing BLE scanner in my garage. My trash can reminder project already uses this same scanner to determine if the trash cans are inside the garage on trash night and, if so, reminds me to take them out to the street. Since the scanner is already there in the garage, I thought it would be fun to add on this garage door open/close automation.
Overall, I am really happy with the results. This automation is the first one that my wife is visibly impressed with every time we arrive back at our house. I had to do some tweaking on the smoothing filter settings, but just some small adjustments to the numbers to prevent the garage door from closing on its own after I drove my car back into the garage. Other than that, it’s been very smooth and effective.
Before you click the link below, the basic idea is (quoting from my write-up):
The basic concept
This one is obvious: it opens and closes the garage door automatically.
Firstly, we will place a BC-U1 usb-powered beacon in the car in one of the powered/unpowered slots. When the car is turned off, the usb beacon gets no power so doesn’t broadcast. When the car is turned on, the beacon begins to broadcast. (If your car doesn’t have this sort of USB outlet, you will probably need to make some adjustments to the settings and automations, but it shouldn’t be too difficult.)
Secondly, we will attach a BC-S1 door position beacon to the frame of the garage door, and attach the little magnetic sensor thingy to the garage door itself. The gateway will also scan for the beacon broadcast from this beacon in order to determine if the door is open or closed, since we have different thresholds/conditions for action based on whether the door is open or closed.
The BLE beacon-scanning gateway (BCG04) was already installed inside the garage for my other project. The gateway scans for this known “car beacon”, then sends this scan data to our Home Assistant (HA) installation running on the same wifi network. The HA can be anywhere in the house as long as it is connected to the same wifi.
The HA will have an MQTT server integration installed on it in order to act as an MQTT server (a.k.a. broker). So the MQTT server on the HA will receive the data “published” from the gateway, and make it available to any service “subscriber” on the HA that wants to use this data.
Next, we will create an MQTT sensor (sort of a virtual sensor since there is no hardware) on the HA that will subscribe to this specific beacon’s published MQTT data. This sensor will report the signal strength of the beacon.
But since the signal strength of all BLE beacons is sometimes a bit jumpy due to signal bouncing and wifi interference, we will create a second “filter sensor” that will smooth this MQTT sensor data.
Finally, we will create two HA automations. The “open the door” automation checks:
1. Is the car beacon seen by the scanner?
and
2. Is the door closed now?
(and some other conditions)
If so, then trigger the door to open.
That automation takes care of the initial opening of the door when you first get in the car and turn the ignition key (or press the start button for an electric car like mine).
It also opens the door when you return from a drive.
The other automation, the “close the door” automation, checks:
1. Is the car beacon seen by the scanner and the signal power weaker than -65 (i.e. the car is out of the garage now)?
and
2. Is the door open now?
(and some other conditions)
If so, then trigger the door to close.
Required hardware (at least this was required for my old-fashioned door):
Car Beacon: In this project I am using a BC-U1 USB-powered beacon.
Door Position Beacon: I used the BC-S1 Door Position Beacon. This beacon can be configured to broadcast one UUID when open and a different UUID when closed. The gateway can see this broadcast and thus know whether the door is currently open or not. If you have a more high-tech garage door opener, you might not need this.
*Beacon Scanning Gateway: I am using the BCG04 BLE scanning gateway. *
HA: My HA is running on an rPi and is (something something technical info here)…Honestly, I am not much of an HA expert.
Garage Door Opener: My garage door opener is quite old so completely not compatible with anything high tech. Even the door open/close button is one single button instead of two distinct buttons. So I attached a Shelly 1 Wifi Relay switch to it.
Shelly 1 Wifi Relay Switch 15A. I powered the relay switch with an old power plug I had laying around.
I am quite sure you HA aficionados will be able to improve on my automation. In addition, while you are walking through this setup, I can imagine that you will think of lots of other things a BLE gateway can do with beacons and automations. Remember that a single gateway can scan for many different beacons and report this data to the HA. Once there, the data can be used for multiple different automations based on multiple MQTT sensors (i.e. beacons or a virtual beacon on your smartphone).
Thanks for reading. Let me know what you think!
Thomas at Blue Charm
Here’s the link for the full project write-up: