Scan NFC tag with phone to start a flow. How to?

Hi all, I’ve read all NFC related posts out there (at least those in English) and there are some basic things I do not understand.

I have an android phone/Google Pixel 6
I have “Use NFC” enabled on the phone
I have NFC stickers (NTAG 213)
I have Homey Pro 2019 and 2023

When I scan a tag with my phone it says:
“New tag collected. Empty tag”

I assume the following:

  1. I need an app to WRITE a unique number to NFC tags*
  2. I need an app that starts and is passed whatever’s in the tag
  3. I instruct the app to do something when that unique tag/number is scanned
  4. Ultimately I want to trigger a flow in Homey when a tag is scanned. I read webhook is the way. Are there other ways just as clever?

Are these assumptions correct? Which app will just pop up a small notification when I scan a tag and either perform the task I’ve already associated with the tag or optionally askes me if I want it to do that…?
(I believe this is what happens when you scan tags associated with Shortcuts app on iPhone)

What do I need and what do I need to do? I know how to use webhooks.

*: I can probably write a lot of stuff to the tag, but a number is what I could use here and is safest.

Not shure about the tags. Adding an identification number or phrase first, sounds logical.
With f.e. MacroDroid, or Tasker, you can let it monitor for NFC events when you scan a tag with your phone, and let it send the webhook you entered for a matching NFC ID.
MacroDroid can also write to tags.

1 Like

Ok, but I will have to write something to the tag first so that it stands out as unique when scanned, right?

Yes, it has to be unique in your set of NFC tags.
But, depends on the situation. When you want, say, all doors to get unlocked at the same time, from any door tag, they should have the same ID, so the same webhook gets send.

I’ve read about someone who tagged a bunch of paper pictures of movies, so when the choice was made, they only needed to swipe the phone over it, and the corresponding movie got started.

1 Like

Most tags (certainly the ones you’re showing) already have a fixed unique UID that can be used.

1 Like

I thought so too, but my scan yields “Empty tag” at least from the native handling on the phone.

If I can skip writing, that’s super, but in case I have too, best tool for that would be?

And what would be the best tool for reading the tag and sending the message to Homey?

Thanks Peter. I’ll fiddle with these for starters…

1 Like

So it’s possible, but sounds limiting. I’ll keep on searching :slight_smile:

My tests with NFC Tools reveals all sorts of things about the tag, among others that it’s empty (!!!) and rewriteable. I’m able to write text to he tag and the tag has a limit of 137bytes which should be plenty for my use.

It looks like I cannot do a http REST request unless I pay money :slight_smile: so search continues for the perfect reader.

I thought I might be able to use the serial number, but it’s the same on all the tags I have, so I have to write a record.

You can see my “beautiful” random text string I’ve written to this tag at the bottom of the screenshot above.

WARNING: I’m repeating a warning I’ve read other places on this forum that you should not have any information about the source in the tag unless you are doing this for commercial purposes (pointing to addresses, phone numbers, web sites and the likes). So for instance do not save “open_main_door” as the ID, cause it can be read by any device, and no, with this kind of implementation, a random reader wouldn’t be able to open the door, but you’ve given away the purpose of the tag, and that could be exploited. I do not know how, but recommendation is to keep it a little bit more convoluted :-).

For personal use, it’s recommended that you write unique strings of numbers and/or letters. These IDs could then be linked to something useful in the NFC reader/automater (that resides on your phone under your protection) such as firing off a request to a webhook that could end up in your Homey. I’ll post more details here as I find out how to do this.

I believe this is the approach. Isn’t it?

Which means your tags are fake (or rather, “not genuine NXP”), because they should have a unique serial number (the UID I was talking about).

1 Like

You are probably right, but now the native reader on my phone returns the record I’ve written to the tag, so I should be able to use them, as long as I can find a reader that a) can read the record and b) send the webhook request, right? That’s what I’m envisioning…

Remember, the native NFC reader on the phone never returned anything when the tag was untouched…

When you can write them, you should be able to use Macrodroid like I wrote.

I have lots of macro’s which send local or cloud webhooks.

I’ve circled back to MacroDroid and have written a string to the tag “bath_music”, test read it, and am making a macro to send of the webhook internally. You can see the macro below:

I can test the macro via the the “…” menu and “Test macro”. It works fine: The flow receives it, load and clear!

Scanning the NFC sticker gives some heptic feedback, but not much more is happening. I get the same result (no result) if I go over internet as internally.

THE BIG QUESTION: How do I configure the GET request?
(This is running on my HP2019)

Latest news! Suddenly it worked! Yippi!!!

1 Like

Depending on what the flow triggered by the scan of the NFC tag does, this implementation can be looked upon as a big drawback as none else than the one with the connection between the tag and the flow will be able to use the automation (typically me who set this up). This is great for instance if this was for opening my front door from the outside of the house: Safety was contained on my phone behind my authentication on the device (as the tag isn’t scanned unless the phone has been ‘opened’).

If I want the tag to replace a button that turns on/off music in a room/zone, I would have to do the steps above on everyone’s phone. Could I have the URL on the tag and everyone who scanned the tag fired it off triggering the flow?

If possible, how to do this and in which app?