How I keep track of time with my NFC implant
I recently got an NFC implant in my hand while I was attending Defcon, the famous computer security conference. Originally I did not have any one specific purpose in mind but thought that I could figure something cool to do with it. At the very least I would put my contact info on it or use it as a conversation starter.
A few days after I got the implant I figured out what I was going to use it for! I was going to use it to control a If This Then That (IFTTT) recipe to keep track of my working hours using a google spreadsheet. If you have never heard of IFTTT I would highly recommend looking at their website and seeing if anything peaks your interests, if you have any IoT devices then it is a must use. https://ifttt.com/discover
Lets begin with what you need. The way you trigger the applet recipe on IFTTT can differ but the one constant should be using their webhook interface.
- NFC Implant (any NFC tag will work or any program that can do a post request or get request)
- An IFTTT account with the following applet added to their “My Applets” section (we will use this later) https://ifttt.com/applets/80063853d-press-a-button-to-track-work-hours-in-google-drive
- Some kind of Android smartphone with working NFC
Once you find your NFC tags you will need two programs on your phone.
- NFC Tools Pro ($3.50)
- NFC Tasks (Free)
The NFC Tools will allow us to program our NFC tags and the NFC Tasks will allow us to do more advanced tasks that are not standard within the NFC specifications.
Once both apps are installed let us open NFC Tools Pro and go to the “Tasks” tab. Once there hit “Add a task” and then hit “Network”.
Once we are in the “Network” tab lets scroll all the way down till we see the following. Hit the “HTTP POST” option then put your phone down and go over to a computer.
The next step is to go to https://ifttt.com/create and then type in web and select “Webhooks” for step 1.
For step 2 go ahead and click “Receive a web request” and then type in anything you want for the name.
For step 3 type in “sheet” and then select “Google Sheets” and then click “Add row to spreadsheet” for the action.
When it asks you to edit the details enter in whatever you want for the Spreadsheet name and then for the “Formatted row” enter in the following.
{{OccurredAt}} ||| =IF(ISODD(ROW()), "Started", "Stopped") ||| =IF(ISEVEN(ROW()),ROUND(((DATEVALUE(REGEXEXTRACT(INDIRECT(ADDRESS(ROW(),COLUMN()-2,4)), "\w+ \d{2}, \d{4}")) + TIMEVALUE(REGEXEXTRACT(INDIRECT(ADDRESS(ROW(),COLUMN()-2,4)), "\d{2}:\d{2}[A|P]M$"))) - ( DATEVALUE(REGEXEXTRACT(INDIRECT(ADDRESS(ROW()-1,COLUMN()-2,4)), "\w+ \d{2}, \d{4}")) + TIMEVALUE(REGEXEXTRACT(INDIRECT(ADDRESS(ROW()-1,COLUMN()-2,4)), "\d{2}:\d{2}[A|P]M$")))) * 24, 2),"")
This code came from this applet: https://ifttt.com/applets/80063853d-press-a-button-to-track-work-hours-in-google-drive
Finally click on “Create action” to finish!
The next and near final step is to go to https://ifttt.com/maker_webhooks
Take note of the name of the applet you just created, we will need that in the next step. Click on “Documentation” in the upper right side of the page.
You will be brought to a page like this. I have covered my private API Key. NOTE: This is a secret, do not give out this key to anyone or they will be able to activate your webhook applets.
Take the name of the event and then put it where it says “{event}”.
In my case, my url would be “https://maker.ifttt.com/trigger/nfc_time_sheet/with/key/MY_KEY_HERE”
Go back to NFC Tools Pro, enter in the full URL like the example above. Hit “OK” and then write it to your NFC implant or tag.
Once you write it successfully, exit the app and then read it with your phone. If everything went successful this is what 2 successful reads would look like on our Google sheets.
Row 1 is when I first scanned it: The start
Row 2 is when I scanned it 2 minutes later: The Stop
In column C we see a “0.03” which means the time difference between our start and stop is .03 hours. This can be a little confusing but what I usually do is to add up everything in column C when I am ready to bill my clients and convert it to whatever time method they are using (whether they are using hours, minutes, or quarter hours).
I hoped that this tutorial has helped you or that there was something that you could take away from it. There are near endless possibilities that you can do with NFC tags once you get IFTTT in the mix.