NFC tags and Home Automation (requires an Android based phone with NFC support)

etc6849

Senior Member
Not trying to double post, but I posted the stuff below in the Premise forum, but I'm not sure how many using Premise also use NFC tags... Please feel free to comment on how you are using NFC tags...

So, I came across an Android app called NFC Task Launcher. The free app may be a neat way to launch tasks in Premise using my new phone (Galaxy S3)! This is entire project is less than $6 depending on which tags you order...

To get it to work, all that is be required is to program an NFC tag with a URL. The URL is formatted for minibrowser as shown under 123's minibrowser module.

Some ideas so far (still waiting for the NFC tags to come in the mail so I haven't tried any of this):
1. Have Premise announce when I'm heading home from work provided: I put my phone in my car near enough to the NFC tag and the time is between 3-5 pm on a weekday.

This may require an Android app called Tasker along with NFC Task Launcher. Tasker would limit the event to between 3-5pm on a weekday and then NFC Task Launcher would attempt to launch the Tasker activity. The announcement would be triggered by Premise using a hidden panel button. The hidden panel button would be accessed in this manner:

Code:
http://ipaddr/sys/%7B8408B069-1D56-4AE1-9585-AC850BC266BB%7D?d??mbFireMacro

Where 8408B069-1D56-4AE1-9585-AC850BC266BB is the object id for the hidden panel button and ipaddr the Premise servers address. The scripting required would be inside a script macro under the hidden panel button.

A text message could also be sent automatically (using Tasker, NFC Task Launcher or Premise) along with the announcement over my Elk M1G's speakers... Since memory space may be a limitation on the stickers, it may be better to have Premise do the extra stuff like send text messages.

2. Put some NFC stickers on light switches to toggle them on/off.

3. Have NFC stickers to trigger scenes throughout the home.

4. Since I have Tasker installed on my phone to automatically turn on wifi when I'm near my home (using the cell network, not GPS as it uses more battery), it could be "safe" to use a NFC sticker to open a garage door.

My reasoning is the web address required would be a local ip address, so the phone would have to be connected to the wifi network at home to perform the task. A thief could hack a wireless network, but would they?!? Also, I plan to use mac address filtering if I go this route so the thief would have to also spoof a valid mac address.
 
I ordered a bunch of those NFC stickers months ago, and I gave up due to range issues. Unless my phone (Galaxy Nexus) physically touched the tag, it wouldn't acknowledge the tag. Major disappoint for me, as I had big plans.
 
Will the NFC tags work at all through nylon switch plates?

I ordered a bunch of those NFC stickers months ago, and I gave up due to range issues. Unless my phone (Galaxy Nexus) physically touched the tag, it wouldn't acknowledge the tag. Major disappoint for me, as I had big plans.
 
Mine works with the popular diztronic case, but like I said, range is 0, I need to physically touch the tag. Also, the tags act as toggles, I was hoping I could trigger events based on 'entering/leave tag range'. I bought all kinds of tags, including ones which you can supposedly sew into clothing and are washable (wanted to detect when my phone was in my pocket, etc.), but even the range on those are really bad.

Maybe it's the phone design, of the NFC antenna design, I don't know, but very disappointed for sure.
 
I guess I can leave the tag out in the open... It may look kind of ugly though!

Hopefully the S3 performs better. The one NFC tag I have is my work id. I hear a bing when I touch the phone to it (maybe 1/4" minimum distance away). However, nothing happens unless the phone is unlocked. How useless is that? I was hoping I could just hop in my car and touch a sticker... Now I have to unlock my phone too?!? It's easier to just hit a light switch manually!

Ok, I found a hack to keep the NFC on, I'll have to try it tomorrow.
 
I've tested everything, except the NFC part (still waiting for my tags)...

The steps to get this working (steps 0 and 1 are optional):
0. Root your phone and perform an nandroid backup using CWM. Be sure to install a superuser app (I use SuperSU).

1. Search xda developers for a hack to keep your NFC turned on when your screen is off.

2. Install Tasker from google play.

3. Setup a task for each thing you want Premise to do.

3.1. In Tasker, navigate to "Tasks", click green plus, then give the Task a name.

3.2. Now click your task, and then click the blue plus. Navigate to Net->HTTP GET.

3.3. Fill out the Server:port section using this format: [background=rgb(249,249,249)]
Code:
http://username:[email protected]:8042
[/background]

Where 8042 is the port you're using, example.com is your hostname or ip address and username:password is your log in information for Premise or whatever HA program you're using. Leave the : and your port number off if you are using port 80 (default) or use ":80"

3.4. Fill out the path to whatever will trigger the automation task in your HA software:
[background=rgb(249,249,249)]
Code:
/sys/%7B8408B069-1D56-4AE1-9585-AC850BC266BB%7D?d??mbFireMacro
[/background]

[background=rgb(249,249,249)]You change the [/background]
Code:
8408B069-1D56-4AE1-9585-AC850BC266BB
to whatever GUID the object in question uses. In this case, the object is a script, so I'm using the GUID of the script. The mbFireMacro part is for scripts with a trigger property. As another example lights would use mbToggle, mbUp and mbDown. The easiest way to figure this out is to open MiniBrowser in a browser window and perform tasks while examining the link structure.


3.5. Now click the green check mark, then click the green check mark in the Task Edit window too.

EDIT: 3.6. In Tasker, go to Preferences->Misc->Allow External Access (this will allow NFC Tasker to launch the Tasker task).

4. Launch NFC Task Launcher go to New Tag ->New Task->Add action->Tasker->Tasker Task

4.1 Select the Task you created, then click Next and place the phone on the tag to program it.

UPDATE: Everything works well. I only have to have the Samsung S3 within 1/2" of the NFC sticker.
 
I love using Tasker to automate things on my phone, but have not yet extended that to the rest of the home. There is a preview build of the AutHomation Android app available (which works with the Mi Casa Verde Vera series) which includes Tasker integration to kick off scenes. I was thinking it would be really cool if my phone could automatically lock my front door when I leave for a run and automatically unlock it when I get within range. Since I already have my GPS on for the run-tracking app, I could even use a pretty precise location (within a few meters) to trigger the unlock event.
 
I thought about doing that too with my door locks. However, if you wanted to do that for more than one person, the logic may be complicated to setup in Tasker (not saying couldn't be done as I haven't sat down to try it).

You raise a great point though: Tasker profiles can automatically trigger arrival and departure tasks; it's a very handy feature!

If you didn't want to use the AutHomation app, you could always study the URL structure Vera uses and do the same thing using the method I detailed above. I don't have a Vera, but I can't think of why this wouldn't be possible as Vera can work in very simple browsers just fine.
 
I ordered a bunch of those NFC stickers months ago, and I gave up due to range issues. Unless my phone (Galaxy Nexus) physically touched the tag, it wouldn't acknowledge the tag. Major disappoint for me, as I had big plans.

That is actually their purpose. A "touch" range sensor. it's super low power because of that.

I do not notice ANY loss of power leaving that on, on my Galaxy S2.

--Dan
 
I actually use this to control "sleep" mode, and car mode for my phone. When I put the phone in the cradle in my car, NFC turns on Bluetooth, then tasker does the rest. Sleep mode is when I put my phone down on my night stand. It basically mutes everything, unless I get a text from my Homeseer server. Then, depending on the message it will either wake me (the house is flooding!!), or do nothing (restarted Zoneminder Zomodo video streams).

I intend to get a cradle at work as well, so I can just drop my phone in the cradle and it'll charge me...so I do not have to keep plugging/unplugging the charge cable...then the phone will also know, at work to connect to the wifi.

--Dan
 
I haven't come up with anything NFC can do that I don't already do with Tasker. Including everything in this thread.
Why would you need to use NFC to announce when you are heading home, just use Tasker.
I know the "because it's new and I want to" answers but c'mon man! Common sense sometimes does win.
 
I don't have a car dock, so I can't use that to trigger when I'm in my car. I could use the car charger to trigger things, but sometimes I charge my phone in the office. Also, I don't always charge the phone in my car when I leave work. Using the tower nearest to work is an option to trigger the message, but every time I go into the plant I have spotty signal, so my wife would be falsely alerted.

Even using GPS location would not work as tasker does not constantly know the GPS location, but only polls it at some interval. If I use a point on the route home, I would have to pass through the point exactly the same time tasker is polling the GPS. GPS also has issues as Tasker cannot turn it on or off, and yes I tried the add-in, it doesn't work on my phone as I use a stock ROM (for now).

Right now, I just tap the NFC sticker in my car when I'm headed home. This seemed like the surest and simplest method. If you think of a good method, please share and I'll try it!

As far as other uses for NFC, the door lock example is a good one. For things like unlocking a door, I would rather rely on touching a tag than a cell tower (too wide of a radius) or GPS (I turn off GPS to save battery life) location.

PS: I am using Tasker to send the message. The NFC tag actually triggers a task in Tasker.
 
You could use a combo of charging and in motion of a certain mph. I use cell tower on my way home. The only time it doesn't work is if I Go a different way but the only time I would do that is for her so she would already know about that.
Do you have bluetooth in your car? I have mine set to turn on bt when charging. Then if it connects to my car bt it turns on car mode and does other car related 'stuff'.
Other things, go into night mode. Timed trigger. Turns sounds off. If I get a sms, it replies saying I'm sleeping but if it's an emergency call me within 10 minutes. The received sms turns the ringer on for 10 minutes. Same as a call, sends sms, 'call back within 10 if emergency.
Take and email an picture if lock screen wrong twice.
Read sms's when driving. Also sends a reply saying I'm driving.
A widget that turns on 'do not disturb' mode which silent all sounds and replies to texts and calls saying I'll call back soon, Btw, all these replies only respond to my contacts. Don't want to reply to a junk text, then they know it's a valid number and will never stop!
Plenty more with Tasker.
As for unlocking a door, I use the HAI access but NFC would work there also I guess.
 
Thanks man! Keep the ideas coming ;) I'll give the tower on the way home idea a try for sending the alert. Sounds simple and doesn't use the GPS either.

If I wanted to set up an in car profile, the speed + charging idea would work, but I don't always charge my phone in the car as it get 14 hours + of battery life (not kidding). The NFC tag in my car was also meant to turn on my GPS, however, this currently doesn't work with Tasker and the "Secure Settings" plugin.

PS: no bluetooth in my car either. At some point, I'll move into the 90's ;)
 
Back
Top