From 1329f67a24443d44a621729dc55aeca08f46b90d Mon Sep 17 00:00:00 2001 From: Andrea Donno Date: Sun, 13 Dec 2020 16:46:22 +0100 Subject: [PATCH] add another example without MQTT (#573) * add another example without MQTT this has been requested on Twitter so I thought it might be helpful for further users * Minor changes * Remove second anchor Co-authored-by: Fabian Affolter --- components/binary_sensor/pn532.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/components/binary_sensor/pn532.rst b/components/binary_sensor/pn532.rst index 51e9667c7..8ef11787b 100644 --- a/components/binary_sensor/pn532.rst +++ b/components/binary_sensor/pn532.rst @@ -97,6 +97,24 @@ using :ref:`api-homeassistant_tag_scanned_action`. then: - homeassistant.tag_scanned: !lambda 'return x;' +Alternatively you could also send the value directly to Home Assistant via a +:doc:`template sensor `. + +.. code-block:: yaml + + pn532: + # ... + on_tag: + then: + - text_sensor.template.publish: + id: rfid_tag + state: !lambda 'return x;' + + text_sensor: + - platform: template + name: "RFID Tag" + id: rfid_tag + .. _pn532-tag: NFC/RFID Tag