@finity, I’m curious why you have used an OR condition. Wouldn’t you want it as an AND? have you ever had it operate while you were driving away?
Somehow during editing that condition got messed up.
here is the correct one:
condition:
- condition: or
conditions:
- "{{ state_attr('proximity.home_me_ft', 'dir_of_travel') == 'towards' }}"
- "{{ state_attr('proximity.home_me_ft_mobile', 'dir_of_travel') == 'towards' }}"
- "{{ '84:DD:20:62:FA:FE' in state_attr('sensor.me_mobile_app_bluetooth_connection', 'connected_paired_devices') }}"
- condition: state
entity_id: cover.north_garage_door
state: 'closed'
The ‘or’ was supposed to be for two proximity sensors I set up to increase reliability of the condition.
the two condiitions as shown in the original code was indeed supposed to be ‘and’
It would be nice to figure out why my trips keep triggering stationary especially when close to home.
This trip there were 2 or 3 short stationary periods near the beginning but the last half or more there were zero stops…
what do you mean
its only going to work when the D1 mini joins the networks
when the car is switch off or leave the network ← this we DONT know which but I DONT want to know that I just want to know when the car join the network and it open the garge that all i use it for
I use differance logic for tracking person
this was my mark 1
until I updated my MQTT could not get it to work so that when I did the esphome one
for faster join to the net work give a static IP
unreliable for me = proximity sensor!
The D1 mini is working as well as my Clarity’s Wi-Fi ping sensor does but both make me sit and wait a bit for the door to open and so far the ping sensor has beaten it. Today I added back the proximity sensor and it was first to trigger such that I only had to slow down a little as the door was opening.
I now have 6 entities triggering the automation and keep track of the trigger id with an input_text helper: WeMos D1 mini=on, BLE dongle=home, Clarity Wi-Fi ping=on, direction of travel=arrived, close to home=on if < 500.
Good suggestion about using static IP! I am setting that now…
I have been using Zigbee for my arrival sensor. I started with SmartThings Arrival sensor. It got discontinued and has a few issues with battery.
I end up make my own arrival sensor with Zigbee as the protocol. It also double up to help secure my car because I added microwave radar and vibration sensor. Here is a short video.
I have posted my project here.
My system is pretty simple. I put an ESP8266-01 (with a tiny buck voltage converter) in each car. In Home Assistant, for example, I look for sensor.jeep_status that only goes true if the Jeep is connected to my local WiFi. The reason I do this is because I can open or close my garage doors from Alexa, and I didn’t want Alexa to open a door if the car isn’t in the vicinity.
Are you using Tasmota or ESPHome on your ESP8266-01’s?
You don’t have to use multiple zones if you use ‘High accuracy mode trigger range for zone (meters)’. That will turn on high accuracy when the device is within XX meters of zone.home (or whatever zones you have created).
They have ESPHome flashed on them.
Hi,
about zone.home_expanded
, with your same settings no way to find this entity!
Any suggest to get it ?
I read many time this doc without success.
Thanks
Just create a new zone in HA called Home Expanded with the same latitude & longitude as your home zone but with a larger circle.
The expanded zone I created in HA was called zone.hamilton. I picked both zone.home & zone.hamilton and had set High accuracy mode trigger range for zone (meters) to 100. I can see now that was incorrect as the app creates an internal expanded zone that is 200m bigger than both of my zones and high accuracy mode is only enabled when inside the expanded zone yet outside zone.home. Which explains now why I was seeing high accuracy mode True but then False when I got closer to home! I’m not sure if the docs have been rewritten since I read them of if I just misunderstood how zone.expanded worked. I moved away from using app location as a tracking method for arriving home and opening garage door as I never could get it working right 100% or even 80% of the time, but I might now though, armed with new understanding! I likely only need zone.hamilton for high accuracy mode and high accuracy mode trigger range " " but that would depend on what the app does when I enter another zone within a zone…
I just played with background location settings, and I could not get High Accuracy Mode to turn on while in zone.home. I had to also pick zone.hamilton. HA shows 1 person in zone.home & 0 in zone.hamilton but the app may behave differently. I now need to see what happens when I leave zone.home but remain inside zone.hamilton. I may need to get rid of zone.hamilton and just use a larger zone.home…
UPDATE
So I made a “beer run” earlier and monitored settings. I was outside zone.home AND zone.hamilton yet High Accuracy mode remained enabled despite the setting to enabling "and"ing BT Connected and zone. HA showed 0 in zone.hamilton and 0 in zone.home. As I drove home, zone.hamilton changed to 1 and when I entered zone.home (radius 25), zone.hamilton changed to 0 and zone.home changed to 1. High accuracy mode finally turned off when I disconnected from car BT. So my last hurdle is resolving why High Accuracy mode stayed on while connected to car BT yet outside both zones…
New Update
So far, 6 out of 6 trips have resulted in my garage door opening while I can see it and early enough that I do not have to sit and wait, and high accuracy mode turns off when car BT disconnects.
These are my settings…
zone.home: configuration.yaml override:
zone:
- name: Home
latitude: <redacted>
longitude: <redacted>
radius: 30
icon: mdi:home
zone.hamilton with a radius of 300 meters with center being my home coordinates.
Automation trigger: when device_tracker.my_phone changes from: zone.hamilton
to: zone.home
Companion App settings:
Location Sensors
Background Location: Enabled
Sensor Settings:
- High accuracy mode: Enabled
- High mode only when connected to BT devices: Kona
- High accuracy mode only when entering zone: zone.home
- High accuracy mode trigger range for zone (meters): 500 (I am going to try 300m)
- High accurace mode update interval (seconds): 5
- High accuracy mode enabled only when in zone and connected to BT: Enabled
- Minimum accuracy: 200
- Location Sent: exact
My android sensors setup:
- range activation trigger: 2000m (this means zone.expanded … I suppose)
- high accurancy when: zone.home
- no option regarding Bluetooth activated (all BT disabled)
These options should (zone.expanded MINUS home.zone - see doc above):
- trigger high accurancy when I go toward home (distance < 2000m)
- disable accurancy when I am in zone.home
In addition these values should:
- trigger high accurancy when I leave home (within 2000m)
- disable it whan I am over the 2000m from home
I will reply here when I tested all this…
It will run on any Linux system with a Bluetooth chip, including the Pi4.
@dbrunt mind sharing your automation YAML/steps for this? Curious if you set it up using zone triggers or something else. Thanks for sharing your method and updates in a clear and easy to understand post!
Edit
Ah… Figured out that the device_tracker entity actually reports the zone as it’s state! Docs FTW
“If you’re using a presence detection method that includes coordinates then when it’s in a zone the state will be the name of the zone (case sensitive). When a device isn’t at home and isn’t in any zone, the state will be
'not_home'
.”
Device tracker - Home Assistant
You can also add a condition in the automation’s that checks if a tracked device is still in the zone after it enters it as well before an automation is scheduled to run.
i.e Trigger is Phone being home or away via choose and in choose options the condition it will validate that its inside the zone since it last entered it and say Android Auto sensor is set to on in the companion app so it knows you are in the car.
Adjust the Home radius size via the config file using
zone:
-name: Home
latitude:
longitude:
radius:
icon: mdi:account-multiple
The radius you can set to how small in meters you want the primary home zone size to be since there is no other way to change it at the moment, then you can add another zone with the same coordinates that is adjustable if you want an external passive zone for more granular control of what zones each trigger is on.
Should be handy for many others since I figured this out myself.