mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-12 01:24:04 +00:00
52 lines
1.1 KiB
Plaintext
52 lines
1.1 KiB
Plaintext
.. csv-table::
|
|
:header: "Event", "Example"
|
|
:widths: 30, 20
|
|
|
|
"
|
|
``MQTTimport#Value1``
|
|
Will trigger when the value is set from MQTT topic 1 payload.
|
|
","
|
|
|
|
.. code-block:: none
|
|
|
|
on MQTTimport#Value1 do
|
|
GPIO,2,%eventvalue% // Turn on based on an MQTT message
|
|
endon
|
|
|
|
When option **Generate events for accepted topics** is enabled:
|
|
|
|
.. code-block:: none
|
|
|
|
on MQTTimport#Value1=on do
|
|
event,switchToggle // See next example
|
|
endon
|
|
|
|
"
|
|
"
|
|
``{mqtttopic}#{json_attribute}={attribute_value}``
|
|
Will trigger when the JSON option is available and enabled, and a JSON message is received, for each JSON attribute, or the Attribute specified.
|
|
|
|
Should best be used combined with the Filtering option.
|
|
","
|
|
|
|
.. code-block:: none
|
|
|
|
on domoticz/in#svalue do
|
|
TaskValueSet,2,1,%eventvalue%
|
|
endon
|
|
|
|
.. code-block:: none
|
|
|
|
on zigbee2mqtt/eria_dimswitch_1#action=on do
|
|
event,switchToggle
|
|
endon
|
|
on switchToggle do // Sonoff switch here
|
|
if [Relay#State]=1
|
|
gpio,12,0 // Relay off
|
|
else
|
|
gpio,12,1 // Relay on
|
|
endif
|
|
endon
|
|
|
|
"
|