mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-26 17:27:47 +01:00
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:
parent
0699445417
commit
9ca9fd503e
@ -208,6 +208,26 @@ Configuration options:
|
|||||||
- **variables** (*Optional*, mapping): Optional variables that can be used in the ``data_template``.
|
- **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.
|
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
|
See Also
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -86,6 +86,17 @@ The parameter ``x`` this trigger provides is of type ``std::string`` and is the
|
|||||||
topic: pn532/tag
|
topic: pn532/tag
|
||||||
payload: !lambda 'return x;'
|
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:
|
.. _pn532-tag:
|
||||||
|
|
||||||
NFC/RFID Tag
|
NFC/RFID Tag
|
||||||
|
@ -70,6 +70,17 @@ unsigned integer.
|
|||||||
topic: rdm6300/tag
|
topic: rdm6300/tag
|
||||||
payload: !lambda 'return uint32_to_string(x);'
|
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:
|
.. _rdm6300-tag:
|
||||||
|
|
||||||
NFC/RFID Tag
|
NFC/RFID Tag
|
||||||
|
Loading…
Reference in New Issue
Block a user