I’ve read it her somewhere but I’ve not found the actual process, including parts and software, of getting a smart lock like the Danalock to act when a certain NFC card is swiped…
Hope the guys who’ve done it read this post!
I live in Spain and have a mortise for of lock…
So far I’ve only seen the Danalock as compatible… But if you have other options, feel free to write them here too!
Thanks!
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
2
Off the top of my head…
Use an spare “old” Android phone as the NFC reader. Lots of Apps available that can call Tasker upon sensing registered cards and then it uses SmartThings App to open lock.
In the US, most android phones sold in the last two years have an NFC chip and reader built in, that’s how Google Pay works. Nothing to do with bluetooth. So you just pick an app you like.
Now if only @juano2310 would help in pointing out which arduino to get… That would be awesome…
And if he or anyone can then help creating a smartapp that will unlock a given lock if x cards show up…
Ahhh… Wish I knew how to code in groovy…
Any cool tutorials out there?
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
7
I hesitate to recommend any project that requires the ThingShield because those are frequently out of stock for a long time. I guess it would be a very helpful project for someone to create a WiFi (LAN) based library and Device Handler.
Anyhow… You can start learning Groovy for SmartApps and Device Handlers by following the new SmartThings documentation, as they’ve really improved over the past few months. This project won’t require too complicated code.
@juano2310 I was researching for NFC and ST integration and i ran across your post here on this thread.
I am trying to use an NFC reader that when approached by an NFC ring will turn a switch off that controls a magnet lock. I am pretty sure it needs a NFC reader and something in between ST and the reader such as a Raspberry Pi or a ESP8266 or a Photon in your case ( i have personally never used a Photon) but i will be very interested on how to achieve this. Please let me know if you have any pointers for me it is beyond my programming capabilities to write a SmartApp that will store nfc values and match them when scanned from a server of sorts and than react to i.
I did not mention that i have achieved this with my android phone already with Josh’s help and SharpTools where you approach the phone that you carry to a static nfc than the phone through tasker takes care of the rest but i want to do it with the reader being static and other people to use their nfc tags as they get close to it.
let me know if you can help anything is greatly appreciated
Denis
Here is the code I used to capture the ID If I’m correct you should see the ID in particle console. There is an IFTTT and SmartThings integration, I imagine you can open an lock or turn a light on with this
int led = D7;
int TAG = A3;
char* mifare[] = { "1K", "Pro", "UltraLight", "4K", "ProX", "DesFire" };
void setup()
{
// Init serial port to host and I2C interface to SL018/SL030
Serial.begin(19200);
Wire.begin();
// Initialize D0 pin as an output
pinMode(led, OUTPUT);
pinMode(TAG, INPUT);
// Prompt for tag
Serial.println("Show me your tag");
}
void loop()
{
// Wait for tag
//while(digitalRead(TAG));
if (digitalRead(TAG) == LOW) {
// Read tag ID
readID();
}
// Wait until tag is gone
//while(!digitalRead(TAG));
}
int readID()
{
digitalWrite(led, HIGH);
// Send SELECT command
Wire.beginTransmission(0x50);
Wire.write(1);
Wire.write(1);
Wire.endTransmission();
// Wait for response
while(!digitalRead(TAG))
{
// Allow some time to respond
delay(5);
String ID;
// Anticipate maximum packet size
Wire.requestFrom(0x50, 11);
if(Wire.available())
{
// Get length of packet
byte len = Wire.read();
// Wait until whole packet is received
while(Wire.available() < len)
{
// Quit if no response before tag left
if(digitalRead(TAG)) { return 0; digitalWrite(led, LOW);}
}
// Read command code, should be same as request (1)
byte command = Wire.read();
if(command != 1) { return -1; digitalWrite(led, LOW);}
// Read status
byte status = Wire.read();
switch(status)
{
case 0: // Succes, read ID and tag type
{
len -= 2;
// Get tag ID
while(--len)
{
byte data = Wire.read();
if(data < 0x10) {
Serial.print(0);
ID += "0";
}
ID += String(data);
Serial.print(data, HEX);
}
Serial.println(ID);
Spark.publish("update", ID);
// Get tag type
byte type = Wire.read();
if(type > 0 && type < sizeof(mifare))
{
Serial.print(" Mifare ");
Serial.print(mifare[type - 1]);
}
Serial.println();
}
digitalWrite(led, LOW);
delay(700);
return 1;
case 0x0A: // Collision
Serial.println("Collision detected");
break;
case 1: // No tag
Serial.println("No tag found");
break;
default: // Unexpected
Serial.println("Unexpected result");
}
digitalWrite(led, LOW);
return -1;
}
}
// No tag found or no response
digitalWrite(led, LOW);
return 0;
}
@juano2310 Ok so i just received the Photon in the mail and i am fixing to order the reader.
I do have 2 preliminary questions is the reader device in your post capable of NFC or is it RFID only??
My other question is this : I was reading through your Proton code trying to understand it but with my limited coding ability i was unable to fully comprehend it …what i want it to do is this: If one of 5 rfid rings or tags that i have 1 of each of my family members get scanned than send a message to IFTTT to tell SmartThings to open lock X.
Is that something that the code you have written can do and where do i enter those tag values??
I am really excited about getting this going
Denis
Hi! The Stronglink module is a NFC Reader/Writer Module SL060 so I can definitely do anything you need regarding NFC/RFID.
The only consideration is to make sure that both the RFID device and your reader are in the same frequency. For example the reader works at 13.56MHz and support all this tags MIFARE Ultralight®, NTAG203, MIFARE Mini, MIFARE Classic® 1K, MIFARE Classic® 4K, FM11RF08, DESFire®.
After looking at the ring that you shared on the comments it looks like it is compatible.
I think that is the same reader I used and for sure the same communication protocol so yes that reader should work with my code.
Regarding the code modification the easiest way would be to have an array with all the IDs that are allowed and if it match send the command
I would recommend to start the project and we can work on the details later!
Happy holidays!
OK very nice and thank you so to recap … i should order the SL060 NFC/RFID reader/writer and not the SL030 that you mentioned in the first post which i think is only RFID
Thanks again
Merry Christmas and Happy New years
Denis
For the projects I worked on the SL030 was more than enough. The ring should work with both. RFID is NFC but NFC can also mean that you can read other data like an URL or contact information.
That said if there isn’t a significant price difference and you don’t care about being energy efficient the SL060 sound like a good idea.