NFC reader with Home Assistant

WS2812B

100 is a lot so I pulled mine off of another project I had around. Also ordering from Amazon would probably be cheaper.

You can also use the 3 pin headers in the corner to control a full light strip if you want to avoid soldering tiny things. I used a heat gun on the bottom of the board to reflow the LED because the pads behind on the bottom make it hard to solder.

1 Like

I finally got to scratch the itch to try this and installed Home Assistant on a Raspberry PI and I can see that the PN532 V3 is not impressive but it does the job.

Now what? Hopefully I’m not the only cyborg living in a dumb old house. This seems pretty useful for an alarm or in combination with a smart lock and a UPS or two. Murphy’s law states that you’ll end up in the rain during a power outage otherwise.

But I should probably look into more ideas on what to do with HA.

3 Likes

I got my first implant when I had an apartment complex that has everything key fobbed and loved it! Spent the last year in a dumb apartment complex lol
Looking for a new apartment now and my main concern is having a smart lock XD
I’ve been wanting to set up some home assistant stuff and scratch that itch too. Been following to see what others do to build a to do list.

2 Likes

I feel that most(if not all) electronic entry/exit systems should always have a way to allow passage when power fails(like getting a lock with a physical key in addition to the electronic system)

1 Like

I was thinking about that today and thought about how many times I have drilled out a lock at work because someone lost a key.
I was thinking of a a key cylinder backup that had pins too long for the sheer line of the core in order to be picked, but you could drill out the core in order to reach the turning mechanism for the latch. If you drilled out the core, then you could unlock the door, and barring any over drilled spots, you could replace the coren.
That would rely upon design of the lock to accommodate a standard core, but would eliminate any picking attempt, though you would need to have access to a drill.

1 Like

I’ll see if I can’t take a picture of a lock tomorrow, but we have “cabinet” locks where you insert the key and twist, then the cabinet is unlocked, and you can take the core out at the same time. It’s a good design for our work so we can just insert a new core if we want to change the keys for the cabinets within the market, or if one is so old that that no one has the key, we can drill it out and replace the core without replacing the locking mechanism.

Alternatively you could hook up a means of powering the lock by an external battery if power is lost.

I have a reader on my garage door. The brains are powered via a power point, which goes to a battery which is capable of running for a bit over 24 hours and keeping the system operational in the event of a black out. The battery then connects to the board. I have an additional and different battery backup for the roller door lifter motor.

The reader is hardwired and there is no wireless transmission.

My internal garage door which gives access to the house simply has a connector to power the lock by attaching temporarily a 9v battery whilst keying in the code. This completely avoids a key way and therefore prevents picking.

Finally, in the event of more than 24 hours without power (which hasn’t happened yet), I have the ability to connect a generator to my external electricity box and power certain circuits in the home (basically garage roller door, and fridges).

2 Likes

I like that better than drilling a core!
I’ve 3D printed covers for DeWalt batteries with external wires to power equipment. Would be simple to 3D print a very small cover for a watch battery with contacts as a finally backup to power the system from the outside.

2 Likes

Fortunately with the NFC reader and Home Assistant I have each implant do something different at each reader. My NExT in my right hand plays music on reader5 but reader6 outside will toggle the gate lock. Reader6 which is outside the front gate is used to open/close the garage and unlock/lock the front gate. The gate lock is battery powered, has a keypad, is connected to Home Assistant and can be locked/unlocked with various methods. My house is kinda old so it has be a bit of a struggle to make it “smart” but definitely doable and totally worth it


(reader6 next to my Amcrest doorbell)

EDIT: I have upgraded the NFC module to the v4 and it is awesome! This photo has the knock-off v3. You can easily tell because the little light is yellow not red

2 Likes

The newer board designs are compatible with just about all the readers elechouse provides, so you can use different readers because yeah the v3 is meh, but cheap and easy to get.

1 Like

TBF, I’m somewhat tempted to design a complete board from scratch for the ESP module, NFC chip, antenna, and everything else. Or perhaps a two board design for the smaller cases from Hammond Manufacturing.

But I don’t think that it’s worth the effort? I don’t think that most people here are willing to deal with SMD parts.

That’s why I didn’t. Unless you plan on having them PNP it’s a pain. Even if you wanted to hand do it you’d need a reflow oven or hotplate. You’d have to do batch orders to make it reasonable.

1 Like

I was playing with a Wiegand version of this and wrote this basic ESP Home configuration file, it still needs some work and I’m not sure if I should post it here or create a new thread:

  name: wiegandReader
  friendly_name: ESPHome Wiegand Reader

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
#  encryption:
#    key: 

ota:

# Wiegand reder
wiegand:
  - id: wiegandReader
    d0: GPIO15
    d1: GPIO13
#    on_key:  # TODO: Add keypad support
#      - lambda: ESP_LOGI("KEY", "received key %d", x);
    on_tag:
      - lambda: ESP_LOGI("TAG", "received tag %s", x.c_str());
      - homeassistant.tag_scanned: !lambda 'return x;'

# Adds support for buzzer and LED control. TODO: This is probably a bad way to control the buzzer.
light:
  - platform: binary
    name: "Reader LED"
    output: readerLED
  - platform: binary
    name: "Reader Buzzer"
    output: readerBuzzer

output:
  - id: readerLED
    platform: gpio
    pin: GPIO12
    inverted: true
  - id: readerBuzzer
    platform: gpio
    pin: GPIO14
    inverted: true

# Why not use the built in LED for troubleshooting proposes?
status_led:
  pin: GPIO2

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

#  # Enable fallback hotspot (captive portal) in case wifi connection fails
#  ap:
#    ssid:
#    password:

#captive_portal:
1 Like

Cool, if it’s regarding HA, I think here would be fine. What Wiegand read are you using?

I used one of the readers that I’ve reviewed, and this one worked ok on 5V. I wanted to keep my tests as simple as possible but some readers need 12V.

How did you get the individual readers to use the same tag and do different things? I would love to do this. I have tried to figure out how to do that with home assistant and have failed. I use NFC cards to fire automations (movies to play on the tv for the grandkids). Would like the grandkids to be able to use the same cards to watch movies in what ever room they are in.

1 Like

Thought I would share my docs for the ESPHome Wiegand Reader I made last year. @enginerd 's config is probably better because mine requires a custom component since Wiegand was not integrated in ESPHome at the time I built it.

2 Likes

You will need the tag ID and the reader ID. The reader ID can be found in the browser address bar at the end of the Home Assistant link when you are in the reader device page. After that you will need to make an automation for each tag at each reader. Here is my yaml for an automation that uses a tag to run a script on a specific reader:


Please note that if you add multiple actions to the automation then each one will need to have that value template with the reader ID. I might be slightly wrong but this seems to work for me. Ive seen other people use other methods

1 Like

Thank you very much for this. Works beautifully. Now I get to redo all the grandkids move tags so they can watch their movies in their bedroom or in the living room. No more fighting over the living room tv. Although it really is fun to watch a 2 year old and 4 year old fight over who gets to watch what movie lol.

2 Likes

Im happy to help! :slight_smile:

1 Like