Add docs for homeassistant.tag_scanned action (#763)

* Add docs for homeassistant.tag_scanned

* Add pn532 example

* Add example to rdm6300
This commit is contained in:
Jesse Hills 2020-09-21 01:30:37 +12:00 committed by Guillermo Ruffino
parent 0699445417
commit 9ca9fd503e
3 changed files with 42 additions and 0 deletions

View File

@ -208,6 +208,26 @@ Configuration options:
- **variables** (*Optional*, mapping): Optional variables that can be used in the ``data_template``.
Values are :ref:`lambdas <config-lambda>` and will be evaluated before sending the request.
.. _api-homeassistant_tag_scanned_action:
``homeassistant.tag_scanned`` Action
------------------------------------
When using the native API with Home Assistant, you can push tag_scanned to Home Assistant
straight from ESPHome :ref:`Automations <automation>`.
.. code-block:: yaml
# In some trigger
on_...:
# Simple
- homeassistant.tag_scanned: some-tag
Configuration options:
- **tag** (**Required**, :ref:`templatable <config-templatable>`, string): The id of the scanned tag
See Also
--------

View File

@ -86,6 +86,17 @@ The parameter ``x`` this trigger provides is of type ``std::string`` and is the
topic: pn532/tag
payload: !lambda 'return x;'
A tag scanned event can also be sent to the Home Assistant tag component
using :ref:`api-homeassistant_tag_scanned_action`.
.. code-block:: yaml
pn532:
# ...
on_tag:
then:
- homeassistant.tag_scanned: !lambda 'return x;'
.. _pn532-tag:
NFC/RFID Tag

View File

@ -70,6 +70,17 @@ unsigned integer.
topic: rdm6300/tag
payload: !lambda 'return uint32_to_string(x);'
A tag scanned event can also be sent to the Home Assistant tag component
using :ref:`api-homeassistant_tag_scanned_action`.
.. code-block:: yaml
rdm6300:
# ...
on_tag:
then:
- homeassistant.tag_scanned: !lambda 'return uint32_to_string(x);'
.. _rdm6300-tag:
NFC/RFID Tag