Skip to content

[remote_transmitter] [remote_receiver] Updated NEC docs to follow new implementation #4841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion components/remote_receiver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ Binary Sensor

The ``remote_receiver`` binary sensor lets you track when a button on a remote control is pressed.

Each time the pre-defined signal is received, the binary sensor will briefly go ON and then immediately OFF.
Each time the predefined signal is received, the binary sensor briefly turns ON, then immediately OFF -
unless the protocol supports repeat codes, like ``NEC``.

.. code-block:: yaml

Expand Down Expand Up @@ -380,6 +381,9 @@ Remote code selection (exactly one of these has to be included):

- **address** (**Required**, int): The address to trigger on, see dumper output for more info.
- **command** (**Required**, int): The NEC command to listen for.
- **timeout** (*Optional*, :ref:`config-time`): The delay before publishing the off state.
The default is 130 milliseconds, with a valid range between 90 and 170 milliseconds. The timeout resets upon
receiving a NEC frame or NEC repeat code.

- **nexa**: Trigger on a decoded Nexa RF code with the given data.

Expand Down
36 changes: 33 additions & 3 deletions components/remote_transmitter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ Configuration variables:
If you're looking for the same functionality as is default in the ``rpi_rf`` integration in Home Assistant, you'll want
to set the **times** to 10 and the **wait_time** to 0s.

.. warning::

**Watchdog Timer (WDT) Resets and Transmission Limitations**

Sending many codes in quick succession may trigger a **Watchdog Timer reset**,
as IR transmissions are blocking and do not yield to the watchdog.

.. note::

For the ``NEC`` action, the ``wait_time`` option inside ``repeat`` is **not valid**.
The behavior of the ``times`` option depends on the selected NEC transmission type.
See ``NEC`` action documentation below for more details.

.. _remote_transmitter-transmit_abbwelcome:

``remote_transmitter.transmit_abbwelcome`` **Action**
Expand Down Expand Up @@ -505,20 +518,37 @@ This :ref:`action <config-action>` sends an NEC infrared remote code to a remote
does not automatically generate parity bits or pad values to 2 bytes. For example, to send command ``0x0``, you
need to use ``0xFF00`` (``0x00`` being the command and ``0xFF`` being the logical inverse).

.. note::

The ``command_repeats`` option has been removed in favor of the unified ``repeat`` - ``times`` option.
This option defines how many times the NEC code is transmitted. The default is ``1``, which sends
a single NEC frame (address + command).

If ``times`` is greater than ``1``, behavior depends on the selected NEC code type.
Both NEC1 and NEC2 are fully supported.

The ``wait_time`` option is no longer used. Timing between frames and repeat codes
is handled internally to comply with NEC protocol specifications.

.. code-block:: yaml

on_...:
- remote_transmitter.transmit_nec:
address: 0x1234
command: 0x78AB
command_repeats: 1
type: NEC1
repeat:
times: 1

Configuration variables:

- **address** (**Required**, int): The 16-bit address to send, see dumper output for more details.
- **command** (**Required**, int): The 16-bit NEC command to send.
- **command_repeats** (*Optional*, int): The number of times the command bytes are sent in one transmission.
Defaults to `1`.
- **type** (*Optional*, string): Transmission type. One of:

- ``NEC1``: Sends a frame followed by NEC repeat codes if ``times`` > 1.
- ``NEC2``: Sends the full frame multiple times, no repeat codes.
- Defaults to ``NEC1``. `More info <http://www.hifi-remote.com/wiki/index.php/NEC>`__
- All other options from :ref:`remote_transmitter-transmit_action`.

``remote_transmitter.transmit_nexa`` **Action**
Expand Down