I’m trying to find a way to write a smartthings scene to an NFC tag. All the tutorials I’ve seen so far say you need to get the deep link URL to that scene but I can’t find any way to do that. Is anyone able to help me figure this one out?
(In case it means anything I’m using a Samsung galaxys 22+ and do not have a smartthings physical hub)
Thanks in advance!
I use macrodroid with Alexa webhooks.
So if i scan the nfc tag, macrodroid uses a alexa webhook url that activates a basic virtual contact switch in smartthings, could easily set a smartthings routine to run a scene.
Sounds like the Bixby approach could be a great fit for someone with a Samsung phone. Since @jkp tagged me, I figured I would share a solution that could work for others. For both platforms, the main concept is to react to the NFC tag being scanned and then make a web request to run a SharpTools rule (where the rule has a Web Request / HTTP Trigger).
There’s a variety of automation apps available on Android, including some purpose-built for NFC tags, so you could use any of those apps to react to your scanning the NFC tag and then use a Webhook / HTTP action to trigger a SharpTools rule.
Some of the more popular automation apps on Android include:
Automagic (deprecated, but still available on their site)
You can use the native Shortcuts app built into iOS devices to create an automation that reacts to your NFC tag being scanned and then makes a web request to run a SharpTools rule.
So my next question of the back do this…If you are using the web hook does that theoretically mean that anyone with a phone that has internet connection can scan NFC cards and run this service?
As an example, if I had an NFC card that ran a scene that turned off all the lights in my house, and stuck that next to the front door, could anyone leaving the house scan that to run that scene? Basically I’m now trying to figure out if I can extend this to create an NFC tags that can be used by anyone to run a specified automation
No, you wouldn’t normally store the URL on the NFC tag for this type of use case. Instead, when the tag is scanned, your phone uses the ID of the NFC tag to know what action (stored on your phone) to run.
You could store a URL to an HTTP rule trigger on the NFC tag directly, but then anyone could scan it and would have that URL which they could then use even if they weren’t in your home.
You’re absolutely right that you can store the URL directly on the tag. I’ve amended my answer to make it more clear that most people don’t do it for the security reasons you alluded to, but it is possible.
If you store the URL directly on the tag, once someone scans the tag and it opens the URL in their browser, they could then use that URL whenever they wanted even when they weren’t at your house.
That’s why most people just use the ID on the tag to trigger the action stored on their phone so it remains secure.
To paraphrase JD “my use case isn’t your use case”, but it’s perfectly valid if that openness of security meets your needs!