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:
I need an app to WRITE a unique number to NFC tags*
I need an app that starts and is passed whatever’s in the tag
I instruct the app to do something when that unique tag/number is scanned
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.
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.
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 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.
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…
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:
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)
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?
I have never used NFC with Homey and I don’t have a lot of knowledge, but I did see a video on Youtube where he used the Flic app, added a Flic button in Homey, but used a NFC tag instead.
This generated a webhook that could be used with Homey by using the “Flic button” (the NFC) as a trigger in flows.
I might have missed something, since Danish isn’t my native language and I have never used Flic, NFC or webhooks in Homey.