You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/espnow.rst
+26-5Lines changed: 26 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,7 @@ Configuration variables:
33
33
Automations:
34
34
35
35
- **on_receive** (*Optional*, :ref:`Automation <automation>`): An automation to perform when data is received. See :ref:`espnow-on_receive`.
36
-
- **on_unknown_peer** (*Optional*, :ref:`Automation <automation>`): An automation to perform when data is received from an unknown peer.
37
-
Cannot be used when ``auto_add_peer`` is set to ``true``. See :ref:`espnow-on_unknown_peer`.
36
+
- **on_unknown_peer** (*Optional*, :ref:`Automation <automation>`): An automation to perform when data is received from an unknown peer. See :ref:`espnow-on_unknown_peer`.
38
37
- **on_broadcast** (*Optional*, :ref:`Automation <automation>`): An automation to perform when a broadcast packet is received.
39
38
See :ref:`espnow-on_broadcast`.
40
39
@@ -76,7 +75,7 @@ Configuration variables:
76
75
``on_unknown_peer``
77
76
*******************
78
77
79
-
This automation will be triggered when data is received from a peer that is not in the list of known peers.
78
+
This automation will be triggered when data is received from a peer that is not in the list of known peers. This trigger gives you one possibility to decide if the unknown peer can be added or not.
80
79
81
80
.. _espnow-on_broadcast:
82
81
@@ -118,14 +117,17 @@ Configuration variables:
118
117
119
118
- **address** (**Required**, :ref:`templatable <config-templatable>`, MAC Address): The MAC address of the receiving device to send to.
120
119
- **data** (**Required**, :ref:`templatable <config-templatable>`, string or list of bytes): The data to be sent.
121
-
- **on_sent** (*Optional*, :ref:`Automation <automation>`): An automation to perform when the data is sent successfully.
122
120
- **wait_for_sent** (*Optional*, boolean): The automation will wait for the data to be sent and for the ``on_sent`` or ``on_error``
123
121
actions to be finished before continuing with the next action.
124
122
Defaults to ``true``.
125
-
- **on_error** (*Optional*, :ref:`Automation <automation>`): An automation to perform when the data could not be sent.
126
123
- **continue_on_error** (*Optional*, boolean): If set to ``false``, the next action will not be triggered if the data could not be sent.
127
124
Defaults to ``true``.
128
125
126
+
Automations:
127
+
128
+
- **on_sent** (*Optional*, :ref:`Automation <automation>`): An automation to perform when the data is sent successfully.
129
+
- **on_error** (*Optional*, :ref:`Automation <automation>`): An automation to perform when the data could not be sent.
130
+
129
131
130
132
.. _espnow-broadcast-action:
131
133
@@ -189,6 +191,24 @@ Configuration variables:
189
191
190
192
- **address** (**Required**, MAC Address): The Peer address that needs to be removed from the list of allowed peers.
191
193
194
+
.. _espnow-set_channel-action:
195
+
196
+
``espnow.set_channel`` Action
197
+
*****************************
198
+
199
+
This is an :ref:`Action <config-action>` to change the channel that espnow is sending and receiving on.
200
+
201
+
.. code-block:: yaml
202
+
203
+
on_...:
204
+
- espnow.set_channel:
205
+
channel: 1
206
+
- espnow.set_channel: 1
207
+
208
+
Configuration variables:
209
+
210
+
- **channel** (**Required**, int): This can be a value between ``0`` and ``15``. The maximum channel number depends on the country or region where you are using the device (for example, channels 1-11 are allowed in the US and most of Europe, 1-13 in many other countries, and 1-14 in Japan). For details, see the `Wi-Fi channel regulations by country <https://en.wikipedia.org/wiki/List_of_WLAN_channels>`__ or consult the `Espressif ESP-NOW documentation <https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/network/esp_now.html>`__. ``0`` means that espnow will set the channel number itself (most of the time it would be ``1``).
211
+
192
212
193
213
.. _espnow-peers:
194
214
@@ -204,6 +224,7 @@ will be an error when trying to send data to a peer.
204
224
Setting ``auto_add_peer`` to ``true`` will allow the component to automatically add any incoming device as a peer, and will
0 commit comments