Home Assistant Tags

Got my tag reader up and running finally! I ran power out to a main entry gate where I already had a key pad controlling a latch. This keypad also has a dry contact which allows me to use a button or relay to open the latch. I wired the pn532 into an esp8266 that’s mounted in a box on the secure side of the gate, along with a motion sensor on each side and a buzzer.

I gave everyone in the family NFC stickers for the inside of our phone cases, and then set each one up in node red. Right now, I assigned a Boolean to tech that let’s me disable a tag on the fly or set up automations to limit access as I see fit.

I now have it set up where tagging in will disarm the alarm and unlock the back door, assuming a bunch of conditions are met that attempt to prevent bad stuff from happening. This is so cool.

4 Likes

Anyone else using an NFC tag on their phone? I stuck a little NTAG215 on the back of my iPhone SE case, and while it does get picked up by the PN532, the phone does bug out every time. The reader seems to appear as a tap and pay point and causes the phone to pull up Apple wallet.

Its enough to cause my non-techie wife to avoid using the tag reader and instead key in a passcode to gain entry.

Heu wolfer would you mind giving me your order n°.
Sorry i am not that active in the community forum

Yep, I get that. But in my case my phone is the only thing I always carry with me, so it makes sense for it to be the device that I stick a tag to. I could carry a card around, but chances are I won’t.

Hey Andrea,
This Steven. We have already discussed my order and all is good. Thanks for the follow up.

You said you have an SE, if that is the 2020 version then you do not need to use this reader at all as you can background scan NFC tags using that phone. If you have HomeKit working on HA then it is very easy to control them using the built in shortcuts app.

@andynbaker what Bertrum is suggesting MIGHT actually be a good idea, stick a sticker on the door ad whenever you read it with the phone ha will open the lock .

I started out with that method in mind, but using tags for access only got interesting for me if I could use it to grant access to anyone, no matter what kind of phone they have, and without needing to install anything on their phones.

My next thought was to use cards like I do at work, but I constantly forget my work badge, so I’m assuming the same will happen at home. So I give everyone key cards, but then they never carry them.

So I thought what is a thing that we all carry all the time and would never leave at home: the phone! Sticking a 215 tag inside the phone case is as easy as it gets. But alas now I’m having the issue of the Apple wallet popup.

In an ideal world, I could add a tag to Apple wallet and then use it like tap and pay to gain entry, but it doesn’t seem like that’s an option right now.

the stick the sticker on the lowest part of the phone, the NFC sensor is on the upper part and add a target on the door

That’s what I ended up doing, but if you’re used to tapping your phone on a card reader for Apple pay, the experience is odd. I ended up sticking it on the outside of the case up high and adding a buzzer to provide feedback when there’s a scan. Now you’re hit with a success tone so fast there’s no time to reflect on why Apple wallet is popping up… But I bet there’s a better way in here somewhere?

unfortunately there is not, since that is a restriction from the phones . Every powered “nfc device” will activate wallet (even my notebook activates it when i lay the phone on it)

Maybe I just give everyone NFC rings or something lol

One ring to rule them all…

1 Like

Implant a chip while they sleep :joy::rofl:

1 Like

HI! I have problem getting the jukebox up and running. I was wondering if anyone could help me out? I have everything up and running with the rfid-reader and the tagging is working fine. I have Spotify integration up and running. But what I dont get is some rows in the yaml-script. For example: What in the example am I supposed the alter? So if someone could post the script, and put “change this” or “xxxxxxx” where I need to have my own data would be very helpful.
Thanks in advance.

I’m not sure what your problem is but this is my NFC jukebox yaml which is the same as in the article.

The spotify url’s are just (working) examples. You can add NFC tags and Spotify url’s to the end (under “variables”).

alias: 'NFC jukebox'
description: Build our own NFC jukebox
trigger:
  - platform: event
    event_type: tag_scanned
condition:
  - condition: template
    value_template: '{{ trigger.event.data.tag_id in tags }}'
  - condition: template
    value_template: '{{ trigger.event.data.device_id in media_players }}'
action:
  - variables:
      media_player_entity_id: '{{ media_players[trigger.event.data.device_id] }}'
      media_content_id: '{{ tags[trigger.event.data.tag_id].media_content_id }}'
      media_content_type: '{{ tags[trigger.event.data.tag_id].media_content_type }}'
  - service: media_player.play_media
    data:
      entity_id: '{{ media_player_entity_id }}'
      media_content_id: '{{ media_content_id }}'
      media_content_type: '{{ media_content_type }}'
  - delay: '2'
mode: single
max_exceeded: silent
variables:
  media_players:
    a8951b26089711eba8615f80f42541eb: media_player.spotify_my_account
  tags:
    4C-04-1E-23:
      media_content_id: 'spotify:track:5ESGW72VURk7fyX3cXrZcd'
      media_content_type: track
    27-BC-D3-C7:
      media_content_id: 'spotify:playlist:37i9dQZF1DWV0gynK7G6pD'
      media_content_type: playlist
    077f2a8a-f6e1-4b40-9a68-9e5b3e147bd2:
      media_content_id: 'spotify:album:6YxxmZYhalM0hX6XN8dR2o'
      media_content_type: album

So you only have to write (or use the written) nfc tags of labels or cards (short or long ones) and combine them to your favorite spotify music using spotify url’s. Hope this helps.

For those interested, I am going to try to setup an automation that stores the jukebox data on the tags itself, instead of in the automation

The tag would store something like:

action: play_media
data:
  media_player: spotify
  media_content_type: playlist
  media_content_id: 'spotify:playlist:37i9dQZF1DWV0gynK7G6pD'

or

action: play_media
data:
  media_player: kodi
  media_content_type: video
  media_content_id: 'smb://server/video/tags/some_video.mkv'

Then the automation would use the tag data and reader location to determine what to do, like play something on whole home audio, or just on a specific tv

Dojf: Thank you for your help. I am not up and running just yet. The thing that I dont get is 2 things: Under “media_players:” you have a device ID of the scanner. Where do I find that ID? And second, where/how do the jukebox choose witch speakers the music should play from?
Found the ID trough Developer Tools. But still wondering how to choose speakers. Now it plays on my phone, but i need to be able to play it on my Sonos-devices. Any tips?

Ok, you found the device id of the tag reader in developer tools. It can be found also in the /config/.storage/core.device_registry file and there search for “tagreader” (or whateven you named the tagreader) and see the “id” field.

The speaker choice in the Spotify environment (selection of the “source”) is a different problem, as Spotify treats that as dynamic items and HA uses the Spotify API and so cannot do much about it. See the long discussions here.
A sort of solution can be found in the HA custom component Spotcast but I have no experience there.

My Spotify default “Source” is (perhaps by accident :wink: ok, but this is the part where I’m also still wrestling as I want to use two more (media) tagreaders in the house.

Dojf: Thanks. Yeah, it would be great if we could choose Source for Spotify to be anything we like(Sonos for me). I found this thread were it seems to be possible to play Spotify URI on Sonos. So maybe some smart person could mix this technic with RFID Jukebox somehow.