⛩️ Automatic Gate : don't ever use your remote again

I have a question. I only want the gate to open if I am driving home from the road going down on the left. On the right is my front yard and so if we drive there, we will leave the car on the street. Also, if I get in the car in front of my house, I do not want the gate to open.

Any way to accomplish this in the automation? or anyone has a clue on how to accomplish this?

Great Automation by the way @etiennec78!

Hello @toxic :wave:

For your first issue, maybe you could edit the blueprint manually to add a stopping point if you are located on the wrong road while arriving (you could add a zone there, or maybe read the street name attribute from Waze).

However, since both roads seem really close to your house, the blueprint could open your gate before you even arrive there…
For this reason I don’t think there is a viable solution, but maybe someone else could help you.

And for your second issue, the “optional sensors” category could come in handy. You can either put an iBeacon near your gate and enable “Only open while near iBeacon”, or instead add your wifi sensor to “WiFi devices”, which has the same behavior, but over wifi. (maybe I should rename these inputs to make them clearer)

I hope this helps !

You are actually right about the gate opening sooner. last night I looked at me camera to see when the gate would opened and it did open before I hit any of those 2 roads but I thought this would maybe be something that can be tweaked (haven’t looked at it yet).

Something I was also thinking about it putting a zone on the road i am interested in and then only trigger the automation (or enable it) or something similar but haven’t looked at that just yet.

I ain’t much of a coder/programmer so looking at your blueprint seems daunting but I’ll start there maybe and see if others have solutions/ideas that may also help.

If you have any idea or tweak from the sensors o your own automation please do let me know. I do have a Shelly plus 2pm at the gate so I am trying to set it up with mqtt to catch my phone when I am close by or something.

Thanks for your feedback!

If you want to tweak the timings, you need to change the “Lead time” (3rd input in the “Essential Sensors” category).
However, keep in mind that the opening of your gate heavily relies on Waze timings, so I cannot guarantee that it won’t open a bit too soon.

Another solution would be to reduce the “ETA planning zone” in the “Automation Settings” category, to only start calling Waze when you have already passed the road.

Also, I’ve created a branch containing a new optional input: “forbidden zones”.
If you are detected in one of these zones while driving, the blueprint will stop. If it had previously opened the gate, it will close it before stopping.
If you want to try this out, import this blueprint.
Could you also provide me some feedback so I can push these changes if they work as intended ?

Thank you for your interest in my project !

Something I could do is create a new zone for the gate location and put it maybe further away from my house. There are no roads there so that may be an other workaround.

But first, let me try playing around with the new blueprint and adjusting the lead time as proposed.

Another question I had early on and forgot to ask. Is or will it be possible for the blueprint to support separate open and close switches? I have connected my shelly plus 2pm to both open and close (also have a shelly 1plus connected to the STOP of my gate)? If not, it is fine, I will use the auto-close or figure it out via a separate automation!

I don’t think I’ll support separate open and close switches in the blueprint itself.

So, I would suggest you to look into template covers.
This will allow you to merge multiple switches into a singular gate entity.
However, since you have a pin managing both open and close, pressing the wrong button or pressing the same one twice could dissociate the virtual state from the real state.

I’ve created an ESPHome firmware specifically for this use case, so I think you should take a look at it. Also, it comes with quite a few features, and some of them might be useful to you (like the iBeacon).
I don’t have a Shelly device, but iirc it can be flashed like any ESP32.

I just fixed a bug in the dev branch, could you please re-import the blueprint ?

I have imported it. Haven’t left the house yesterday to test but will make an effort to do so today!

1 Like

I think the import button is broken.

Hello @TheElectrich !

Sorry, I saw that the button hasn’t worked for a few months but the Home Assistant developers don’t seem to want to fix it. I plan to reorganize my repo soon to create a working link.

For now, you can import the blueprint manually into your blueprints by clicking on “add blueprint” in the blueprint settings, and paste the following link : https://github.com/etiennec78/Home-Automation/blob/a47ea4c8e13506ef1de47a567a762e408bdc8eca/Automatic%20Gate/automatic-gate.yaml

Thank you, that worked. Can’t wait to try it out

1 Like

Hi @etiennec78
I’m using the automation for a long time and it works very well.
Just an idea:
Instead of opening based on travel times, could it be that the on_approach is triggered by the ibeacon? So when arriving, it opens the gate as soon as the car ble connects to the tracker

Hello @manuelmrmorgado !
Thanks for your suggestion !

I had already thought of a similar idea at the beginning of this project, but I didn’t clearly see the point of opening with an iBeacon.

It would work, but you would have to be closer to your house to be detected, so it would trigger too late, and you would have to wait for your gate to fully open before entering.

With the current implementation, you can easily tweak the blueprint so that your gate is fully open when you are in front of it.
But I remain very open to this idea, I just need to see an example where the iBeacon would be more relevant.

Don’t hesitate to get back to me if you see a situation that I have not thought of.

I totally get the idea. My case is a two-way narrow street that sometimes what happens is that the gate opens when I’m close but it stays open for a long time as I can take a lot to arrive due traffic.

Hello @manuelmrmorgado !
Sorry for the late response.
Could you please try this branch and select “iBeacon” for “Open on arrival when connected to” ?

Thanks! Will give it a try!

I saw a critical bug in the version I gave you. Could you please disable the blueprint while I work on it ?

Yes, just found out today that the gate was opening when I entered the car wile away. :wink:

Hello !
I’m really sorry about this issue, I had set a wrong indentation which shortcut some steps :grimacing:
I have worked on another branch which should work as expected.

Could you please try it out and provide some feedback ?
Thanks !

mapping values are not allowed here in “”, line 35, column 28: --tab-size-preference: 4; ^