Creative NFC Tag Ideas

@snell :- great ideas...
I have a quetion on this one...Lets take your first example.
"Leave the light on in the evening until the remote is put back in an acceptable place."
In this case, there could be an NFC tag on the TV table which is an acceptable place for the remote. But when we place the remote on that place, how do we read the tag and trigger ? I can only think of reading an NFC tag with a mobile. How can we trigger an action/automation in Hubitat by placing the remote in the designated area ? Please advice.

It would definitely need additional NFC readers OR the reader being the mobile part (which requires bigger batteries for it). For something like the "remote is put back" I would think a reader on that surface would be best. Remote's tag is read by it, then done. Of course it would be easy to move it away then and put something else at the reader. So it is not a perfect solution (unless you use one reader per object that needs to remain in place).

The reader could be interfaced with Hubitat using Maker API or a custom driver I would think. I have made my microcontroller projects have simple HTML or JSON pages they output that my Hubitat can read for information (using a custom driver).

I'm thinking of using an NFC tag at the door to trigger presence using an Endpoint Trigger in RM. Since NFC tags are so cheap I was planning to use one for present and one for away that could be scanned with a cell phone. I really wanted to use just one tag and I came up with this logic.
Screenshot (2)
I tested it and it seems to work to toggle the state of the sensor.

Is there any way to imbed a name in the endpoint so the same tag could set presence for different people based on their phone?

Wife present. Me away.
I'm just wondering if there is a way to send that info via endpoints or could it be done with Maker API [secondary value]

If you use Android, Tasker can do this. You send a "get" to a different cloud end point. I do this with our family at the front door. It allows me to see who unlocks the door etc.

Actually, it's a local end point, as I only want them to be able to unlock the door at home.

Thanks Mike. So I would need a rule for each person with their own Endpoint?

I use an app called HTTP Shortcuts to send the endpoints. Free :wink: but I havent tried triggering it with a tag yet

I was thinking of doing something like that but from what I gathered and tried, any cell phone could read the tag and unlock the door. How do you guys manage to secure the tag?

I would not embed any data into the NFC tag itself. I would just use the NFC Tag as a trigger within the Phone to have it run some sort of local automation on the Phone. ON iOS this can be done using iOS Shortcuts, while on Android Tasker can be used. Then, simply embed within that automation the correct cloud endpoint URL to Maker API to make the appropriate changes on the Hubitat hub. Each phone could call a different Maker API URL, specific to that user's phone. This would allow easy per-user integration.

I have done the same using Locative on iOS for geopresence for our two iPhones. Works very well.

So, my plan should be
set up a endpoint triggered rule for each user (Wife rule, my rule, daughter rule ect.)
program a NFC tag to fire a shortcut on the phone that sends the user's endpoint
When the tag is scanned each phone would send a user specific endpoint to a rule that toggles presence for each of their devices.

Yep, that sounds reasonable to me. I would personally use MakerAPI for this, as you can easily expose three virtual presence devices to it. Then, simply change the device ID in the URL for each user's phone. Each phone would use two URLs, one to set the user-specific virtual device to 'present' (arrived command), and the other to set it to 'not present' (departed command).

Not sure if having 2 URLs per phone would work for what I want. I'd like to have a NFC tag at the door to scan that would toggle presence for each person.

I think there is a bit of confusion around what you are doing (using a local/cloud endpoint to trigger a rule) vs what you want to do (control a specific device). To control devices, it would probably be better to use the HE app called Maker API. With that you can send commands to devices directly, without having to use a rule. It gives you a list of local and cloud urls that you can use the exact same way you did to trigger your rule using tasker.

What he is saying is that if you expose the presence sensors to Maker API and get the url of the commands you want to send (set you present, set SO present, etc.), you can use your phone itself (using tasker or iOS shortcuts) to send the command. So on your phone you have a tasker profile that calls the url to set your device present or not present, and on your SO device you have it call the url that sets hers present/not present.

Thank you for this! I have battled presence detection since day 1 and just bought 20 nfc213 tags. I've been trying to wrap my head around how to use a single tag for multiple people to set presence and am going to use this approach. Beats having a bunch of tags lined up next to each other.

Edit: hey, quick it possible to toggle presence based on a command given through Maker API? Like could a single tag set both present and not present, or would you need to use a rule? I'm thinking a rule would be needed.

1 Like

I finally go the toggle idea to work. This is android specific.
I wrote a single NFC tag to run a task through the app NFC Tasks. It triggers a macro that I wrote in the app Macrodroid that simply sends a http request. I named the macro the same on multiple phones but each phone has the appropriate endpoint for the person specific rule in their macro.
Toggle presence macro sends endpoint to wife rule when triggered on her phone, Toggle presence macro sends endpoint to my rule when triggered on my phone. etc
I don't use Tasker, but I assume the same method would work. Name the task the same on each phone but have it point to the correct endpoint.
The only caveat so far is when my wife or daughter leaves the house and forgets to tap the tag and "log out" I'll probably have to mount a chocolate dispenser next to the tag so they remember :smiley:

1 Like


Ah yes, tasker should be able to do that as well, good thinking!

I also got it working using a different local endpoint for each device using tasker on Android and NFC for iphone for my 8+ (let's you trigger a shortcut with a scan). It looks like it's possible to pass a parameter with it as well.

I'm going to try to get it working the way you are describing. Thanks for the idea and explanation!

NFC tasks also allows you to store a variable on your phone. You can then write a URL to the nfc chip with a reference to the variable inside the URL.

When your phone scans the chip the full URL is requested. Any other phone requests an invalid URL as the variable isnt present. Ive had success with this triggering webhooks in IFTTT using the api key as the secret variable. I assume the Hubitat Maker API would also work this way.

Anyone triggered an event in Tasker or other when set on the tag and another if no longer on it?

? Huh? Didnt quite understand this.

I assume we are talking about have a tag on some kind of cradle, so picking up when the phone is set down on a charger or something like that? Can't claim any experience with NFC tags though, sorry...

I tried to do this awhile back and as far as I can tell, it's not possible. Everything I read said that devices don't know when you remove them from a tag.

1 Like