The pn532 binary sensor platform lets you track if an NFC/RFID tag with a given unique id (uid) is currently being detected by the PN532 or not.

See PN532 NFC/RFID Controller Hub for instructions for setting up the connection to the PN532.

# Example configuration entry
  clk_pin: D0
  miso_pin: D1
  mosi_pin: D2

  cs_pin: D3
  update_interval: 1s

  - platform: pn532
    uid: 74-10-37-94
    name: "PN532 NFC Tag"

Configuration variables:

  • uid (Required, string): The unique ID of the NFC/RFID tag. This is a hyphen-separated list of hexadecimal values. For example 74-10-37-94.
  • name (Required, string): The name of the binary sensor.
  • id (Optional, ID): Manually specify the ID used for code generation.
  • All other options from Binary Sensor and MQTT Component.

Setting Up Tags

To set up binary sensors for specific NFC tags you first have to know their unique IDs. To obtain this id, first set up a simple pn532 configuration without any binary sensors like above.

When your code is running and you approach the PN532 with an NFC Tag, you should see a message like this:

Found new tag '74-10-37-94'

Then copy this id and create a binary_sensor entry as in the configuration example. Repeat this process for each tag.