NFC Binary Sensor¶
The nfc
binary sensor platform provides an easy way for you to determine if an NFC tag is presented to the reader.
The tag may be identified in one of three ways:
By given unique ID (
uid
) – for example74-10-37-94
By a given NDEF tag “name”, or…
By a given string contained in the tag’s NDEF message/data
Note that this platform is currently supported by the PN7150 and PN716x only; one of these components must be present in your device’s configuration in order to use it.
# Example configuration entries
binary_sensor:
- platform: nfc
ndef_contains: pulse
name: "NFC 1 Tag"
- platform: nfc
tag_id: pulsed
name: "NFC 2 Tag"
- platform: nfc
uid: 74-10-37-94
name: "MFC Tag"
Configuration variables:¶
ndef_contains (Optional, string): A (sub)string that must appear in the tag’s NDEF message. May not be used with
tag_id
and/oruid
(below).tag_id (Optional, string): A string that identifies the tag; in effect, its name. Specifically, this looks for the Home Assistant URI encoded into one of the tag’s NDEF records and then looks for this specific string. May not be used with
ndef_contains
and/oruid
.uid (Optional, string): The unique ID of the NFC tag. This is a hyphen-separated list of hexadecimal values. For example:
74-10-37-94
. May not be used withndef_contains
and/ortag_id
(above).All other options from Binary Sensor.