Home Assistant: NFC Enabled Garage Door

Now that I’ve installed WiFi controller for my Garage Door I’d though to add some advanced features on it..

Too many times I’ve gone to the garage and forgot to take the original remote control with me. However, I usually have a phone in my pocket so why not use a Home Assistant app to open the garage door? or even better use an NFC tag to open it? (Thanks to my neighbour for the idea).

So.. I go to the garage, get a phone off my pocket and tap it to the door frame and the door magically opens!

Requirements

For this automation you need:

Automation

For the automations you need to actually create two. One to open the door when it’s closed and another one to close the door when it’s open.

But first, write a new NFC Tag with your Home Assistant app by going to “Menu -> App Configuration -> NFC Tags -> WRITE NFC TAG”. After writing you should get your “Tag Id” so make sure to write it down.

Now go to Home Assistant (Computer preferred) and go to “Configuration -> Tags -> + ADD TAG” and create a new tag with your Tag ID.

Now to the fun part, create the automation!

Create new automation and add trigger (scan tag), condition (garage door open/close) and action (open/close garage door). Or copy paste these in your automations.yaml and just change the device_id and tag_id 🙂

- id: '1627225410558'
  alias: 'Garage door tag is scanned (closed)'
  description: ''
  trigger:
  - platform: tag
    tag_id: d22ad2ea-1da1-43e0-9acf-1d086c460214
  condition:
  - condition: device
    device_id: 81bcc36ea8c14cea06f5b3ac9ed7d9a7
    domain: cover
    entity_id: cover.garage_door
    type: is_closed
  action:
  - device_id: 81bcc36ea8c14cea06f5b3ac9ed7d9a7
    domain: cover
    entity_id: cover.garage_door
    type: open
  mode: single

- id: '1627225442700'
  alias: 'Garage door tag is scanned (open)'
  description: ''
  trigger:
  - platform: tag
    tag_id: d22ad2ea-1da1-43e0-9acf-1d086c460214
  condition:
  - condition: device
    device_id: 81bcc36ea8c14cea06f5b3ac9ed7d9a7
    domain: cover
    entity_id: cover.garage_door
    type: is_open
  action:
  - device_id: 81bcc36ea8c14cea06f5b3ac9ed7d9a7
    domain: cover
    entity_id: cover.garage_door
    type: close
  mode: single

Security concerns?

How about security then? For the tag to work the opening person need to have Home Assistant client connected to your Home Assistant server with authenticated user.

Also the tag scanning won’t work unless your phone is unlocked. So no-one can just take your phone and tap it to the tag with phone locked.

I’m also restricting access to my Home Assistant from WAN so basically user also has to be connected in my WiFi network for it to work. So I would not be concerned about the security at all 🙂

2 Replies to “Home Assistant: NFC Enabled Garage Door”

  1. Hi Toni
    I am a newbie to HA. I have followed your instructions above. You have dome very neat stuff in your home!
    I am trying to open the garage door with the NFC tag. My meross works very will directly with their app.
    I have the automaton script, created the tags with my iPhone. but how to transfer the automation to the tag? I am missing something.
    Forgive my lack of knowledge with this, but I hope to hear back from you with some help. Thanks very much.

    Regards
    Krishna

    1. Hi Krishna!

      You don’t transfer the automation to the TAG, the TAG is just a ‘value’ that the Home Assistant understands.
      Meaning that when you read the tag with your phone, that has Home Assistant app installed, it informs Home Assistant to start the automation.

      So write your TAG with the Home Assistant app by doing:
      Settings -> Tags -> + Add New -> Fill in the info -> Create and Write

      And after that just create the automation as in example in the article by using the Tag ID you just created.

Leave a Reply

Your email address will not be published. Required fields are marked *