Hi all, been stuffing around for a week and cant get my head around esphome and home assistant. Ive flashed the wifi component on my esp32 and i want to use as a trigger in home assistant the on_connect and on_disconnect as a trigger for my automations. This is where i get stuck…should the automations be done using the esphome yaml configuration? Because after flashing the wifi component and the intergrating it it home assistant i was expecting to see the on_connect and on_disconnect as options in home assistant but its not the case. Im not sure how to then create automations, can they be done in home assistant UI or must they be done in esphome? Thanks in advance.
Where do you find this documented.
Also take a step back and describe what you’re trying to accomplish not how you think you want to do it.
Thanks for taking the time to respond.
This is where i got my info
Long story short…ive been trying to automate my garage door opening and closing as i arrive. I want it to be fairly responsive because i live on a road with plenty of thoroughfare. Ive tried geo location, wifi and bluetooth. All of them react too slow before the door opens or closes. I was hoping to use my esp32 plugged into my car and adjust the tx power to hopefully be able to get to a point where it is quicker to respond. The best option was when i used bluetooth, as a test i connected my phone to a speaker and would trigger my automation on connecting and disconnecting from my speaker. Not sure what else i can try with my limited experience.
Those are for controlling function on the esp32 itself when the network stack lights up. You need something on HA that reacts when the device is seen on the network. That’s a different animal. You said Bluetooth has been ‘best’ so you have the ability to get esp32 out there already? Do you also have wifi there?
Yes i have a wifi an AP in my garage. Signal strength is too strong before i lose wifi im over in the next block. Just so i understand so no automations are written to esp?
More nuanced than that.
But think about what’s controlling the gate. Thats ha. Not the esp. So ha needs to get the signal.
Since wifi is out (I get ya) you’re probably back to esp32 bt proxy or some kind of 433mhz button. As you’ve seen. Precise location tracking is incredibly difficult to be CONSTANT
Also reconsider jacking with signal strength unless youre an RF engineer. Yes the radios on these are dinky but messing with the RF strength and range in some jurisdictions is actually illegal.
Correct bluetooth proxy was the first thing i tried…but as my title says not sure how to create the automation. You talking about using the proxy to monitor my bluetooth advertisments? If so i couldnt get it to work. I think it was because the mac address for my phone was wrong in saying that should the proxy work if montoring phone traffic?..i then tried my bluetooth speaker and i could see it was responding in the esp logs but again not sure how to use this info when automating in HA…make sense? Is it normal that the speaker would only show in the logs once it was connected to my phone
You need additional stuff to read the distance off the proxy.
-
the proxy
-
a device that can advertise ibeacon (ha companion)
-
something to read the distance
(either the BLE ibeacon integration and/or Bermuda (HACS) -
these will create entities that have things like signal strength and interpolated distance that can be used in automation.
Also with BLE expect about 100’ effective range if you have good line of sight. Some companies make BLE Bluetooth ibeacon that fit in usb ports so they can be always powered by a truck with one of these plugged into the charger port nobody ever uses in the back… For instance
I think you can create a swtich on your esphome device and the use an automation on the wifi section that turn on or off that switch.
WiFi Component — ESPHome (on_connect trigger).
Thanks so i understand…
Setup a proxy esp32
Use the companion app to monitor the distance to the proxy or a beacon in the car.
BLE intergration?
100 feet is plenty probably too much but i remember reading that the output power can be adjusted.
So that means that the companion app will always be montoring to see how far i am from the proxy?
The proxy is the receiver. It notes BLE transmitters and estimated range.
I beacons transmit at set power.
Math gives range (ibeacon integration click add device - look for ibeacon… and/or Bermuda - I use Bermuda in my home to place ibeacon and the ibeacon integration to get distance to trash and recycling bins. Difference being I locate beacons in an area with Bermuda)
Your automation will react to the estimated distance of yojr beacon being less than. X for more than Y time period. Fire trigger.
Makes sense its a pitty its 1am otherwise i would test it now
oriolism i think i would still have the issue is when does the switch operate?
I thought a bluetooth proxy was mainly used to extend bluetooth range in an area?
Ylfkr the switch you would have to manually click it in that scenario or automatically react to it popping on the net. Which has the dame issue as just responding to the device coming online.
Yes BLE proxies extend range but you can also use them as a fixed point bt antenna for distance calculation
Thats why BLE works as a tracker. If J know you are transmitting 50db power and I only see a fraction I can make a very good estimate of your distance with math. A BLE ibeacon transmits that signal every N seconds.
The proxy (now you see why mtod antennae are better) sees the signal and reports it.
The ibeacon integration reads this. Determines if it cares. (do I know this one) and the registers name signal strength and distance.
I currently have 12 proxies on my property. One in every room and at least one at every corner of the house and one strategically hidden in a spot in the front yard.
When the device pings you get distance and which proxy picked it up. So… I know exactly how far you are from a fixed point in space. If I can get this on three antenna I know EXACTLY where you are within tolerance of the antenna.
Cant wait to try it…appreciate your help. Thanks
Doesn’t high accuracy mode on the phone device tracker work?
It usually gives a rather good accuracy.
Mine works well enough H but it bounces all over the place it’s not good enough for pinpointing me to something like a gate with fast enough resolution to be able to trigger it.
op Could use the connection tk wifi to spin up precice location tracking but tbh at driving speeds you might as well have used a BLE signal. It would be faster and way more reliable
High accuracy works but its still hit and miss when you have a small zone. For large zones it works well
It doesn’t need to be a zone. You can use the proximity integration to get the distance.
If this is just to open a gate then I’m rather sure it will work if you just trigger on less than 50 m or something.