Hello, new to ESPHome. Currently I am using an Arduino sketch on a wemos d1 mini to create a connectivity sensor as per WiFi/MQTT car presence sensor for garage door automation. What I am wanting to do is see if it is possible to achieve similar using ESPHome instead? I want to see if it responds more reliably. Honestly I just need it to create a sensor to send the connected and disconnected signal when in range/out of range of the wifi router. From there I can easily tell it what to do with automations I have set for the other sensor.
Esphome reports connectivity Status Binary Sensor — ESPHome also WiFi Signal Sensor — ESPHome
THANK YOU SO MUCH the Status Binary worked perfectly for my application.
I’ve since moved my cars over to ESPhome as well (I’m the OP you linked to). One thing I found is that, at short ranges, bluetooth LE advertisements happen faster at power-on than my wifi connections do. So, I added a BLE scanner via ESPhome and now trigger the garage doors on either the connectivity sensor mentioned above or on discovery of that BLE advertIsement.
Having two separate signals has greatly increased reliability and reduced response time. ESPhome is rad!
So far I’m actually finding that your arduino sketch was faster at connecting. I’m thinking now that I’ve put a reserved IP it would be too. BLE is a great idea for short range, any idea how to make the long range faster? Thank you for the original btw. I did run it without a pro and without an antenna so even though I have an extender in the garage, it still fights me to connect on the other side of the door.
Care to share your esphome setup? I could be doing it wrong?
@nickrout @luma is there a way to make ESPHome tell the Wemos to flash or turn on the LED when connected and no LED when not connected?
On-board LED
Most of the ESP8266 development boards have a built-in LED. This LED is usually connected to GPIO2. The LED works with inverted logic. Send a HIGH signal to turn it off, and a LOW signal to turn it on. On the Wemos D1 Mini (and clones) GPIO2 is pin D4.
Here’s what I’m using for ESP32 using ESP32-CAM boards, because they are cheap, readily available, and they offer the ability to connect an external antenna which significantly increases BTLE range.
Gateway device code. This guy sits in my garage and listens for BTLE advertisements from my car sensors.
Car presence sensor. Roll out one of these for each car. This code includes the LED connectivity indicator you asked about above.
Home Assistant Automation. Here I demonstrate how to use this with two cars in one garage, so that when both cars arrive close in time, that the garage door doesn’t try to close while the second car is arriving. Don’t ask why I had to add this feature…
You asked about how to make “long range” faster, which in this case means the WiFi connection. I haven’t figured out how to make WiFi consistently connect fast, which is why I am also using BLE. The speed of long-range connection matters a lot less because, by definition, you’re still some ways away. So, if it takes 10 seconds to connect while I’m still rolling up my driveway, no big deal.
It’s much more annoying when you’re waiting 10 seconds while sitting in your car after you turned it on before the door opens, so that’s why I have a fast-short-range solution and a less-fast long range solution. Works out great!
Ah, okay. So ultimately I need to switch to a board with an external antenna or I am never going to get signal from outside my garage. Thanks! Do you have a link for the board you use?
I used a board like this which includes everything you’ll need and also a camera that won’t work at all when you are using BT in ESPhome (if you enable both the camera and BT the device will crash a few seconds after power on). I selected this simply because it has the external antenna connection you need and also an antenna, alternately, there are boards like this without the camera if you have a suitable antenna and U.FL whip to connect it.
OK now here’s the bad part - these boards come with the antenna disabled. To enable, you need to reposition a 0-ohm resistor. No big deal, except it’s an 0402, which means you’re going to need better eyesight than me, or some magnification and some steady hands. I’m pretty handy w/ a soldering iron but manually maneuvering 0402s is enough to give me pause. Here’s a guide showing the deal.
Did the one you got come with the antenna active? My soldering skills leave something to be desired.
Nope! I had to make this modification on a handful of units. I am tooled up for this sort of work and am very comfortable w/ SMD soldering but this is not a fun job and I wouldn’t recommend it if you don’t have magnification and hot air.