2018-08-22 22:05:28 +02:00
|
|
|
PN532 NFC/RFID Tag
|
|
|
|
==================
|
|
|
|
|
2018-11-14 22:12:27 +01:00
|
|
|
.. seo::
|
|
|
|
:description: Instructions for setting up NFC tags for the PN532 integration.
|
|
|
|
:image: pn532.jpg
|
|
|
|
|
2018-08-22 22:05:28 +02:00
|
|
|
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.
|
|
|
|
|
|
|
|
.. figure:: images/pn532-full.jpg
|
|
|
|
:align: center
|
|
|
|
:width: 60.0%
|
|
|
|
|
2019-02-07 13:54:45 +01:00
|
|
|
See :doc:`/components/pn532` for instructions for setting up the connection to the PN532.
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2018-11-19 18:32:16 +01:00
|
|
|
.. code-block:: yaml
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
# Example configuration entry
|
|
|
|
spi:
|
|
|
|
clk_pin: D0
|
|
|
|
miso_pin: D1
|
|
|
|
mosi_pin: D2
|
|
|
|
|
|
|
|
pn532:
|
|
|
|
cs_pin: D3
|
|
|
|
update_interval: 1s
|
|
|
|
|
|
|
|
binary_sensor:
|
|
|
|
- platform: pn532
|
|
|
|
uid: 74-10-37-94
|
|
|
|
name: "PN532 NFC Tag"
|
|
|
|
|
|
|
|
Configuration variables:
|
2018-08-24 22:44:01 +02:00
|
|
|
------------------------
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2018-10-20 15:10:26 +02:00
|
|
|
- **uid** (**Required**, string): The unique ID of the NFC/RFID tag. This is a hyphen-separated list
|
2018-08-22 22:05:28 +02:00
|
|
|
of hexadecimal values. For example ``74-10-37-94``.
|
|
|
|
- **name** (**Required**, string): The name of the binary sensor.
|
|
|
|
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
|
|
|
- All other options from :ref:`Binary Sensor <config-binary_sensor>` and :ref:`MQTT Component <config-mqtt-component>`.
|
|
|
|
|
|
|
|
.. _pn532-setting_up_tags:
|
|
|
|
|
|
|
|
Setting Up Tags
|
2018-08-24 22:44:01 +02:00
|
|
|
---------------
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
.. code::
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
See Also
|
2018-08-24 22:44:01 +02:00
|
|
|
--------
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2019-02-07 13:54:45 +01:00
|
|
|
- :doc:`/components/pn532`
|
2018-08-22 22:05:28 +02:00
|
|
|
- :doc:`index`
|
2019-02-07 13:54:45 +01:00
|
|
|
- :apiref:`binary_sensor/pn532_component.h`
|
|
|
|
- :ghedit:`Edit`
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2018-10-12 16:33:22 +02:00
|
|
|
.. disqus::
|