2019-02-27 10:10:09 +01:00
|
|
|
RDM6300 NFC/RFID
|
|
|
|
================
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2018-11-14 22:12:27 +01:00
|
|
|
.. seo::
|
2019-02-27 10:10:09 +01:00
|
|
|
:description: Instructions for setting up RDM6300 NFC/RFID tag readers and tags in ESPHome.
|
2018-11-14 22:12:27 +01:00
|
|
|
:image: rdm6300.jpg
|
2019-02-27 10:10:09 +01:00
|
|
|
:keywords: RDM6300, NFC, RFID
|
2018-11-14 22:12:27 +01:00
|
|
|
|
2019-02-27 10:10:09 +01:00
|
|
|
.. _rdm6300-component:
|
|
|
|
|
|
|
|
Component/Hub
|
|
|
|
-------------
|
|
|
|
|
|
|
|
The ``rdm6300`` component allows you to use RDM6300 NFC/RFID controllers
|
|
|
|
(`datasheet <https://elty.pl/upload/download/RFID/RDM630-Spec.pdf>`__, `iTead <https://www.itead.cc/rdm6300.html>`__)
|
|
|
|
with ESPHome. This component is a global hub that establishes the connection to the RDM6300 via :ref:`UART <uart>` and
|
|
|
|
translates the received data. Using the :ref:`RDM6300 binary sensors <rdm6300-tag>` you can then
|
|
|
|
create individual binary sensors that track if an NFC/RFID tag is currently detected by the RDM6300.
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
.. figure:: images/rdm6300-full.jpg
|
|
|
|
:align: center
|
|
|
|
:width: 60.0%
|
|
|
|
|
2019-02-27 10:10:09 +01:00
|
|
|
See :ref:`rdm6300-setting_up_tags` for information on how to setup individual binary sensors for this component.
|
|
|
|
|
|
|
|
As the communication with the RDM6300 is done using UART, you need
|
|
|
|
to have an :ref:`UART bus <uart>` in your configuration with the ``rx_pin`` connected to the data pin of the RDM6300 and
|
|
|
|
with the baud rate set to 9600
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
# Example configuration entry
|
|
|
|
uart:
|
|
|
|
rx_pin: D0
|
|
|
|
baud_rate: 9600
|
|
|
|
|
|
|
|
rdm6300:
|
|
|
|
|
|
|
|
binary_sensor:
|
|
|
|
- platform: rdm6300
|
|
|
|
uid: 7616525
|
|
|
|
name: "RDM6300 NFC Tag"
|
|
|
|
|
|
|
|
Configuration variables:
|
|
|
|
************************
|
|
|
|
|
|
|
|
- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`UART Component <uart>` if you want
|
|
|
|
to use multiple UART buses.
|
2019-05-12 22:44:59 +02:00
|
|
|
- **on_tag** (*Optional*, :ref:`Automation <automation>`): An automation to perform
|
|
|
|
when a tag is read. See :ref:`rdm6300-on_tag`.
|
2019-02-27 10:10:09 +01:00
|
|
|
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID for this component.
|
|
|
|
|
2019-05-12 22:44:59 +02:00
|
|
|
.. _rdm6300-on_tag:
|
|
|
|
|
|
|
|
``on_tag``
|
|
|
|
----------
|
|
|
|
|
|
|
|
This automation will be triggered when the RDM6300 module responds with a tag.
|
|
|
|
|
|
|
|
The parameter ``x`` this trigger provides is of type ``uint32_t`` and is the tag UID as a 32-bit
|
|
|
|
unsigned integer.
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
rdm6300:
|
|
|
|
# ...
|
|
|
|
on_tag:
|
|
|
|
then:
|
|
|
|
- mqtt.publish:
|
|
|
|
topic: rdm6300/tag
|
|
|
|
payload: !lambda 'return x;'
|
|
|
|
|
2019-02-27 10:10:09 +01:00
|
|
|
.. _rdm6300-tag:
|
|
|
|
|
|
|
|
NFC/RFID Tag
|
|
|
|
------------
|
|
|
|
|
|
|
|
The ``rdm6300`` binary sensor platform lets you track if an NFC/RFID tag with a given
|
|
|
|
unique id (``uid``) is currently being detected by the RDM6300 or not.
|
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
|
|
|
|
uart:
|
|
|
|
rx_pin: D0
|
|
|
|
baud_rate: 9600
|
|
|
|
|
|
|
|
rdm6300:
|
|
|
|
|
|
|
|
binary_sensor:
|
|
|
|
- platform: rdm6300
|
|
|
|
uid: 7616525
|
|
|
|
name: "RDM6300 NFC Tag"
|
|
|
|
|
|
|
|
Configuration variables:
|
2019-02-27 10:10:09 +01:00
|
|
|
************************
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
- **uid** (**Required**, integer): The unique ID of the NFC/RFID tag.
|
|
|
|
- **name** (**Required**, string): The name of the binary sensor.
|
|
|
|
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
2019-02-17 12:28:17 +01:00
|
|
|
- All other options from :ref:`Binary Sensor <config-binary_sensor>`.
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
.. _rdm6300-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 RDM6300 configuration without any binary sensors like above.
|
|
|
|
|
|
|
|
When your code is running and you approach the RDM6300 with an NFC Tag, you should see a message like this:
|
|
|
|
|
|
|
|
.. code::
|
|
|
|
|
|
|
|
Found new tag with ID '7616525'
|
|
|
|
|
|
|
|
Then copy this id and create a ``binary_sensor`` entry as in the configuration example. Repeat this process for
|
|
|
|
each tag.
|
|
|
|
|
|
|
|
.. figure:: images/rdm6300-ui.png
|
|
|
|
:align: center
|
|
|
|
:width: 80.0%
|
|
|
|
|
|
|
|
See Also
|
2018-08-24 22:44:01 +02:00
|
|
|
--------
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2019-02-27 10:10:09 +01:00
|
|
|
- :doc:`pn532`
|
2019-02-07 13:54:45 +01:00
|
|
|
- :doc:`/components/binary_sensor/index`
|
2019-05-12 22:44:59 +02:00
|
|
|
- :apiref:`rdm6300/rdm6300.h`
|
2019-02-07 13:54:45 +01:00
|
|
|
- :ghedit:`Edit`
|