Documentation for wiegand component (#2424)

Co-authored-by: Samuel Sieb <samuel@sieb.net>
This commit is contained in:
H. Árkosi Róbert 2023-01-18 02:37:57 +01:00 committed by GitHub
parent 52e7be2e97
commit b84eb16038
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 78 additions and 0 deletions

77
components/wiegand.rst Normal file
View File

@ -0,0 +1,77 @@
Wiegand keypad and tag reader
=============================
.. seo::
:description: Wiegand-standard key input and card/tag reader panel
:image: wiegand.jpg
The ``wiegand`` component allows you to integrate Wiegand-standard key
input and card or tag reader panels in Home Assistant.
.. figure:: ../images/wiegand.jpg
:align: center
S20-ID keypad and tag reader
.. note::
Some keypads are preconfigured by the factory to act as Wiegand input
devices. In order to work with this component, they may need to
be reconfigured to act as *Wiegand 26 output* or *Wiegand 34 output*
devices.
Component
---------
.. code-block:: yaml
# Example configuration entry
wiegand:
- id: mykeypad
d0: GPIO5
d1: GPIO4
on_key:
- lambda: ESP_LOGI("KEY", "received key %d", x);
on_tag:
- lambda: ESP_LOGI("TAG", "received tag %s", x.c_str());
on_raw:
- lambda: ESP_LOGI("RAW", "received raw %d bits, value %llx", bits, value);
Configuration variables:
- **id** (*Optional*, :ref:`config-id`): Set the ID of this device for use in lambdas.
- **d0** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The pin where the ``D0`` output
of the Wiegand's interface connects.
- **d1** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The pin where the ``D1`` output
of the Wiegand's interface connects.
Automations:
------------
- **on_key** (*Optional*, :ref:`Automation <automation>`): An automation to perform
when a key has been pressed on the pad. The key is in a variable called ``x``.
- **on_tag** (*Optional*, :ref:`Automation <automation>`): An automation to perform
when a Wiegand-compatible card or a tag has been read by the device. The tag code is
in a variable called ``x``.
- **on_raw** (*Optional*, :ref:`Automation <automation>`): An automation to perform
for any data sent by the device. The value is in a variable called ``value``, the number of
bits is in a variable called ``bits``. Note that this will include parity bits as well and
no parity checking is done.
.. note::
Automatic handling of multiple keys (e.g. PIN code entry) is possible with the
the :ref:`Key Collector <key_collector>` component.
See Also
--------
- :doc:`/components/key_collector`
- :ghedit:`Edit`

BIN
images/wiegand.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -677,6 +677,7 @@ Misc Components
Display Menu Core, components/display_menu/index, folder-open.svg
LCD Menu, components/display_menu/lcd_menu, lcd_menu.png
Matrix Keypad, components/matrix_keypad, matrix_keypad.jpg
Wiegand Reader, components/wiegand, wiegand.jpg
HTTP Request, components/http_request, connection.svg
mDNS, components/mdns, radio-tower.svg