Nfc2mqtt - simple python service able to read nfc tags and push them to mqtt

Hey,
For some time i was thinking how to disarm HA alarm by my guests. Not all of them are able to use tablets, not all of them have access to my wifi, not all of them …

First idea was to use just simple zigbee button (1 click - disarm, 2 clicks - arm), but its not very intuitive. And its not very secure (everybody can use button, not only guests).

So best idea was to use some kind of keyboard to enter passcode or rfid/nfc cards.
I didnt find any nice keyboard, so i start looking into NFC.

NFC advantage:

  • every guest can get his own tag
  • even if tag is lost its cheap
  • with some dev knowledge it can be pretty secure (at least more than just zigbee button)
  • its very intuitive (people are already using nfc/rfid access cards in offices, buses, parks, …)
  • can store some additional data

But how to integrate NFC into homeassistant? And this is role of nfc2mqtt (https://github.com/bkupidura/nfc2mqtt).
It is not designed HA specific, it just takes valid NFC tags and push content to mqtt. How this content is consumed it is up to you.

What nfc2mqtt is not:

  • its not simple nfc -> mqtt bridge
  • it dosen’t store ‘valid’ tags in DB, memory, file
  • it dosen’t use nfc tag id

What nfc2mqtt is:

  • each tag written by nfc2mqtt stores encrypted content
  • inside encrypted container you can store any custom data (if it will fit tag capacity)
  • tags can have time-to-live (how long token is valid)

For more details about payload please check project readme.

Any suggestions, tests, MR are welcome :slight_smile:

Code is 2 days old, so please don’t assume that its rock solid and ready for bank offices :slight_smile:

PS. If you decided to buy bunch of NFC cards and NFC reader after reading that - think twice.
nfc2mqtt have specific approach to NFC, not necessary this will fit your needs (but it should).
ITS NOT NFC->MQTT BRIDGE(!!!)

2 Likes

Welcome to the community. I am intrigued and will take a look for sure.

Hi, its a good idea because all of this things can be copied or duplicated.
Mi idea is to use an access control in my house. Now I have a marelab rfid working with esp8266 with mifare tags. The lectors are validated in the same esp8266, but exist other solution that make the validation in node red or Hassio.
How can I change your project to use a rfid lector not usb?
Something like that https://github.com/nygma2004/RFID_Wiegand_MQTT
Regards

I can add dedicated listener, which will consume scanned tags from MQTT and not from usb reader. But this will require that esp code will send scanned NDEF over MQTT. As i see, current RFIC_Wiegand is not doing that.
Moreover you will loss posibility to create tags from nfc2mqtt, and you will need to write tags manually.