mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-12 01:24:04 +00:00
[docs] Replace code-block:: html with code-block:: none
The HTML parser does not parse our own rules which is where it is used. So until we have a rules highlighter, we use the ``none`` highlighter.
This commit is contained in:
@@ -79,7 +79,7 @@ Setup
|
||||
- ``homie/%sysname%/$nodes`` enumerating all devices will be sent as final message of the auto-discover header.
|
||||
- The final event log should look like this:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
5584 : EVENT: MQTT#Connected
|
||||
5754 : C014 : autodiscover information of 4 Devices and 6 Nodes sent with no errors! (26 messages)
|
||||
|
||||
@@ -22,7 +22,7 @@ RTTTL (Ring Tone [Text] Transfer Language) was developed by Nokia to play more "
|
||||
|
||||
After that the actual tune is then created using standard notes (a, b, c, d, e, f, and g), before the note the duration is set, after the note the octave is set:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
<duration><note><octave>
|
||||
|
||||
@@ -35,7 +35,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP Buzzer
|
||||
GPIO <--> I/O
|
||||
@@ -55,7 +55,7 @@ Rules examples
|
||||
|
||||
From ESP Easy v2.0.0 its possible to play melodies via `RTTTL <https://en.wikipedia.org/wiki/Ring_Tone_Transfer_Language#Technical_specification>`_ (don't forget to remove the spaces and replace # with -, this might be fixed in future releases):
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
http://<ESP IP address>/control?cmd=rtttl,14:d=4,o=5,b=112:8a,8a,a,8a,8a,a,8a,8c6,8f.,16g,2a,8a-,8a-,8a-.,16a-,8a-,8a,8a.,16a,8a,8g,8g,8a,g,c6
|
||||
|
||||
@@ -65,7 +65,7 @@ You can also use these from rules. We use it to let our alarm system give feedba
|
||||
|
||||
To make a boot-sound on startup, create a rule like this:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On System#Boot do
|
||||
rtttl,14:d=10,o=6,b=180,c,e,g
|
||||
@@ -75,7 +75,7 @@ To make a boot-sound on startup, create a rule like this:
|
||||
|
||||
Besides RTTTL it's also possible to play a single tone on a pin, via a buzzer, speaker or piezo element:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
http://<ESP IP address>/control?cmd=tone,14,1300,200
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P000_Level_converter_page:
|
||||
|
||||
Level converter
|
||||
@@ -43,7 +43,7 @@ Wiring
|
||||
A direct connection by mistake from 5V to a GPIO may fry your ESP! Handle level-shifters with some care.
|
||||
The used FET transistors are somewhat sensible against electrostatic discharge. Use a anti-static mat.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP Level converter Connected hardware
|
||||
GPIO (X) <--> 3A, LV1, A1 etc. <--> 5A, HV1, B2 etc.
|
||||
|
||||
@@ -22,7 +22,7 @@ RTTTL (Ring Tone [Text] Transfer Language) was developed by Nokia to play more "
|
||||
|
||||
After that the actual tune is then created using standard notes (a, b, c, d, e, f, and g), before the note the duration is set, after the note the octave is set:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
<duration><note><octave>
|
||||
|
||||
@@ -35,7 +35,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP Piezo
|
||||
GPIO <--> Positive (red)
|
||||
@@ -52,7 +52,7 @@ Rules examples
|
||||
|
||||
From ESP Easy v2.0.0 its possible to play melodies via `RTTTL <https://en.wikipedia.org/wiki/Ring_Tone_Transfer_Language#Technical_specification>`_ (don't forget to remove the spaces and replace # with -, this might be fixed in future releases):
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
http://<ESP IP address>/control?cmd=rtttl,14:d=4,o=5,b=112:8a,8a,a,8a,8a,a,8a,8c6,8f.,16g,2a,8a-,8a-,8a-.,16a-,8a-,8a,8a.,16a,8a,8g,8g,8a,g,c6
|
||||
|
||||
@@ -62,7 +62,7 @@ You can also use these from rules. We use it to let our alarm system give feedba
|
||||
|
||||
To make a boot-sound on startup, create a rule like this:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On System#Boot do
|
||||
rtttl,14:d=10,o=6,b=180,c,e,g
|
||||
@@ -72,7 +72,7 @@ To make a boot-sound on startup, create a rule like this:
|
||||
|
||||
Besides RTTTL it's also possible to play a single tone on a pin, via a buzzer, speaker or piezo element:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
http://<ESP IP address>/control?cmd=tone,14,1300,200
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ have to be figured into your project. It is also possible to use a small SSR to
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP Relay (board)
|
||||
GPIO (X) <--> IN1
|
||||
@@ -204,7 +204,7 @@ find more information on how to do this.
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On Switch#State Do
|
||||
if [Switch#State]=1
|
||||
|
||||
@@ -29,7 +29,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP Servo
|
||||
GPIO (X) <--> S (signal)
|
||||
@@ -48,7 +48,7 @@ find more information on how to do this.
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On Switch#State Do
|
||||
if [Switch#State]=1
|
||||
|
||||
@@ -22,7 +22,7 @@ RTTTL (Ring Tone [Text] Transfer Language) was developed by Nokia to play more "
|
||||
|
||||
After that the actual tune is then created using standard notes (a, b, c, d, e, f, and g), before the note the duration is set, after the note the octave is set:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
<duration><note><octave>
|
||||
|
||||
@@ -35,7 +35,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP Speaker
|
||||
GPIO <--> Positive (red)
|
||||
@@ -52,7 +52,7 @@ Rules examples
|
||||
|
||||
From ESP Easy v2.0.0 its possible to play melodies via `RTTTL <https://en.wikipedia.org/wiki/Ring_Tone_Transfer_Language#Technical_specification>`_ (don't forget to remove the spaces and replace # with -, this might be fixed in future releases):
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
http://<ESP IP address>/control?cmd=rtttl,14:d=4,o=5,b=112:8a,8a,a,8a,8a,a,8a,8c6,8f.,16g,2a,8a-,8a-,8a-.,16a-,8a-,8a,8a.,16a,8a,8g,8g,8a,g,c6
|
||||
|
||||
@@ -62,7 +62,7 @@ You can also use these from rules. We use it to let our alarm system give feedba
|
||||
|
||||
To make a boot-sound on startup, create a rule like this:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On System#Boot do
|
||||
rtttl,14:d=10,o=6,b=180,c,e,g
|
||||
@@ -72,7 +72,7 @@ To make a boot-sound on startup, create a rule like this:
|
||||
|
||||
Besides RTTTL it's also possible to play a single tone on a pin, via a buzzer, speaker or piezo element:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
http://<ESP IP address>/control?cmd=tone,14,1300,200
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
|
||||
Example output:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
4500043 : Info : Command: i2cscanner
|
||||
I2C : Found 0x3c
|
||||
@@ -221,7 +221,7 @@
|
||||
|
||||
Example output:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
4306250 : Info : Command: meminfo
|
||||
SecurityStruct | 593
|
||||
@@ -531,7 +531,7 @@ Try to use AsyncEvents where possible, to keep rules processing times low.
|
||||
|
||||
**Rules example**
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on SingleEvent do
|
||||
Publish,%sysname%/Info,A single event has been triggered!
|
||||
@@ -544,7 +544,7 @@ Try to use AsyncEvents where possible, to keep rules processing times low.
|
||||
|
||||
**Rules example**
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on SingleValue do
|
||||
Publish,%sysname%/Info,An event has been sent (%eventvalue%)!
|
||||
@@ -558,7 +558,7 @@ Try to use AsyncEvents where possible, to keep rules processing times low.
|
||||
|
||||
**Rules example**
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Multi do
|
||||
if %eventvalue4%=99
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
As described already, each task can produced one or more events, one for each measured value. You should not name your devices and value names so that the combination equals to any of the below listed system events!
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on DHT11Outside#Temperature>20 do
|
||||
GPIO,2,1
|
||||
@@ -19,7 +19,7 @@
|
||||
Triggered after power on.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on System#Wake do
|
||||
GPIO,15,1
|
||||
@@ -31,7 +31,7 @@
|
||||
Triggered at boot time.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on System#Boot do
|
||||
GPIO,2,1
|
||||
@@ -44,7 +44,7 @@
|
||||
Triggered just before the ESP goes to deep sleep.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on System#Sleep do
|
||||
GPIO,2,0
|
||||
@@ -56,7 +56,7 @@
|
||||
Triggered when the ESP has connected to broker.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on MQTT#Connected do
|
||||
Publish,%sysname%/status,First message!
|
||||
@@ -68,7 +68,7 @@
|
||||
Triggered when the ESP has disconnected from the broker.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on MQTT#Disconnected do
|
||||
Reboot
|
||||
@@ -80,7 +80,7 @@
|
||||
Triggered when the ESP has connected to broker (the MQTT Import plugin uses a separate connection than the generic one).
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on MQTTimport#Connected do
|
||||
Publish,%sysname%/status,MQTT Import is now operational
|
||||
@@ -92,7 +92,7 @@
|
||||
Triggered when the ESP has disconnected from the broker (the MQTT Import plugin uses a separate connection than the generic one).
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on MQTTimport#Disconnected do
|
||||
Reboot
|
||||
@@ -104,7 +104,7 @@
|
||||
Triggered when the ESP has connected to Wi-Fi.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on WiFi#Connected do
|
||||
SendToHTTP,url.com,80,/report.php?hash=123abc456&t=[temp2#out]
|
||||
@@ -116,7 +116,7 @@
|
||||
Triggered when the ESP has changed to access point, will also trigger first time the unit connects to the Wi-Fi.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on WiFi#ChangedAccesspoint do
|
||||
Publish,%sysname%/status,AP changed
|
||||
@@ -129,7 +129,7 @@
|
||||
This has been added in build mega-20190910
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on WiFi#ChangedWiFichannel do
|
||||
Publish,%sysname%/status,channel changed
|
||||
@@ -143,7 +143,7 @@
|
||||
N.B. Sending a publish command may not be very useful on this event, since this will mainly happen when there is no WiFi connection.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on WiFi#APmodeEnabled do
|
||||
... // Some command
|
||||
@@ -156,7 +156,7 @@
|
||||
This can happen some time (default 60 seconds) after a WiFi connection has been made. Or disabled using some command.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on WiFi#APmodeDisabled do
|
||||
Publish,%sysname%/status,AP disabled
|
||||
@@ -168,7 +168,7 @@
|
||||
Triggered when (someone) has tried to login to a ESP unit with admin password enabled, but have failed to enter correct password.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Login#Failed do
|
||||
Publish,%sysname%/warning,Intruder alert!
|
||||
@@ -180,7 +180,7 @@
|
||||
Triggered the first time (after boot) NTP is updating the unit.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Time#Initialized do
|
||||
Publish,%sysname%/Time,%systime%
|
||||
@@ -192,7 +192,7 @@
|
||||
Triggered when the time is set by an update from NTP.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Time#Set do
|
||||
Publish,%sysname%/Time,%systime%
|
||||
@@ -205,7 +205,7 @@
|
||||
As described already, triggered when a rules timer ends (setting a timer to 0 will disable the timer).
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Rules#Timer=1 do
|
||||
GPIO,2,1
|
||||
@@ -217,7 +217,7 @@
|
||||
Triggered every minute with day and time like: Mon,12:30 or Tue,14:45. You can define triggers on specific days or all days using 'All' for days indicator. You can also use wildcards in the time setting like All,**:00 to run every hour.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Clock#Time=All,12:00 do //will run once a day at noon
|
||||
GPIO,2,1
|
||||
@@ -237,7 +237,7 @@
|
||||
If the command 'Monitor' is used to monitor a given pin you will receive an event for that GPIO as soon as it's state changes. As seen in the example you can always use the square brackets together with the task/value name of ``Plugin#GPIO#Pinstate#N`` to get the state, but to trigger events you need to add the monitor command (preferably at boot).
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on System#Boot do
|
||||
Monitor GPIO,15
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P001_Door_switch_page:
|
||||
|
||||
Door switch
|
||||
@@ -25,7 +25,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP Door switch
|
||||
GPIO (X) <--> Signal
|
||||
@@ -111,7 +111,7 @@ Indicators/values (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Door#State=1 do
|
||||
timerSet,1,1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P001_PIR_sensor_page:
|
||||
|
||||
PIR sensor
|
||||
@@ -31,7 +31,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP PIR
|
||||
GPIO (X) <--> I/O or OUT
|
||||
@@ -117,7 +117,7 @@ Indicators/values (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Motion#Detection=1 do
|
||||
timerSet,1,1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P001_Switch_page:
|
||||
|
||||
Switch
|
||||
@@ -24,7 +24,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP Switch/button
|
||||
GPIO (X) <--> Signal
|
||||
@@ -128,7 +128,7 @@ Indicators/values (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Switch#State do
|
||||
if [Switch#State]=3
|
||||
|
||||
@@ -21,7 +21,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -41,7 +41,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P002_PCF8591_page:
|
||||
|
||||
PCF8591
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P002_Photosensitive_resistor_page:
|
||||
|
||||
Photosensitive resistor
|
||||
@@ -21,7 +21,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -41,7 +41,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP LJ12A3
|
||||
GPIO (14) <--> Signal (black)
|
||||
@@ -125,7 +125,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On WaterMeter#mL Do
|
||||
If [WaterMeter#mL]=0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P003_TCR5000_page:
|
||||
|
||||
TCR5000
|
||||
@@ -25,7 +25,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP TCR5000
|
||||
GPIO (14) <--> S
|
||||
@@ -97,7 +97,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On PowerMeter#W Do
|
||||
If [PowerMeter#W]>1500
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P003_YFS401_page:
|
||||
|
||||
YFS401
|
||||
@@ -27,7 +27,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP YFS401
|
||||
GPIO (14) <--> Signal (yellow)
|
||||
@@ -104,7 +104,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On WaterMeter#mL Do
|
||||
If [WaterMeter#mL]=0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P004_DS18b20_page:
|
||||
|
||||
DS18b20
|
||||
@@ -32,7 +32,7 @@ Wiring
|
||||
|
||||
.. image:: P004_DS18b20_5.jpg
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP DS18b20
|
||||
GPIO (14) <--> 1-wire/D (yellow)
|
||||
@@ -106,7 +106,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On Temp1#Celsius Do
|
||||
If [Temp1#Celsius]>37
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P005_DHT11_DHT22_page:
|
||||
|
||||
DHT11/DHT22
|
||||
@@ -35,7 +35,7 @@ DHT11 (blue)
|
||||
|
||||
DHT22 (white)
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP DHT11/DHT22
|
||||
GPIO (X) <--> Data (2nd pin)
|
||||
@@ -89,7 +89,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On DHT#Celsius Do
|
||||
If [DHT#Celsius]>-15
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P006_BMP085_page:
|
||||
|
||||
BMP085
|
||||
@@ -20,7 +20,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP BMP085
|
||||
GPIO (4) <--> DA (SDA)
|
||||
@@ -73,7 +73,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on BMP#hPa do
|
||||
if BMP#hPa>999
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P006_BMP180_page:
|
||||
|
||||
BMP180
|
||||
@@ -20,7 +20,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP BMP180
|
||||
GPIO (4) <--> DA (SDA)
|
||||
@@ -73,7 +73,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on BMP#hPa do
|
||||
if BMP#hPa>999
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P008_Wiegand-26_page:
|
||||
|
||||
Wiegand-26
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p00x.repl
|
||||
.. _P009_MCP23017_page:
|
||||
|
||||
MCP23017
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. _P010_BH1750_page:
|
||||
|
||||
BH1750
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. _P012_LCD_page:
|
||||
|
||||
LCD
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. _P013_HC-SR04_page:
|
||||
|
||||
HC-SR04
|
||||
@@ -26,15 +26,15 @@ Wiring
|
||||
|
||||
The HC-SR04 must be run on 5V. Running it with 3.3V will show very weak results or nothing at all.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP HC-SR04
|
||||
GPIO (X) <--> Trigger
|
||||
GPIO (X) <--> Echo (voltage divider!)
|
||||
|
||||
Power
|
||||
5.0V <--> VCC
|
||||
GND <--> GND
|
||||
ESP HC-SR04
|
||||
GPIO (X) <--> Trigger
|
||||
GPIO (X) <--> Echo (voltage divider!)
|
||||
|
||||
Power
|
||||
5.0V <--> VCC
|
||||
GND <--> GND
|
||||
|
||||
.. warning:: Do not connect 5V directly to the ESP! Read more about :ref:`P000_Level_converter_page`.
|
||||
|
||||
@@ -89,14 +89,14 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block::
|
||||
|
||||
on HCSR04#distance do
|
||||
if [HCSR04#distance]<50 and [HCSR04#distance]>45
|
||||
GPIO,14,1 //light up LED to show that you're at the correct position
|
||||
else
|
||||
GPIO,14,0
|
||||
endif
|
||||
if [HCSR04#distance]<50 and [HCSR04#distance]>45
|
||||
GPIO,14,1 //light up LED to show that you're at the correct position
|
||||
else
|
||||
GPIO,14,0
|
||||
endif
|
||||
endon
|
||||
|
||||
.. Commands available
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. _P013_RCW-0001_page:
|
||||
|
||||
RCW-0001
|
||||
@@ -26,7 +26,7 @@ Wiring
|
||||
|
||||
The RCW-0001 must be run on 5V. Running it with 3.3V will show very weak results or nothing at all.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP RCW-0001
|
||||
GPIO (X) <--> Trigger
|
||||
@@ -89,7 +89,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block::
|
||||
|
||||
on RCW0001#distance do
|
||||
if [RCW0001#distance]<50 and [RCW0001#distance]>45
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. _P013_US-100_page:
|
||||
|
||||
US-100
|
||||
@@ -26,7 +26,7 @@ Wiring
|
||||
|
||||
The US-100 must be run on 5V. Running it with 3.3V will show very weak results or nothing at all.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP US-100
|
||||
GPIO (X) <--> Trigger
|
||||
@@ -89,7 +89,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block::
|
||||
|
||||
on US100#distance do
|
||||
if [US100#distance]<50 and [US100#distance]>45
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. _P014_SI7021_HTU21D_page:
|
||||
|
||||
SI7021/HTU21D
|
||||
@@ -21,7 +21,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -41,7 +41,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. _P015_TSL2561_page:
|
||||
|
||||
TSL2561
|
||||
@@ -31,7 +31,7 @@ Wiring
|
||||
|
||||
.. image:: P015_TSL2561_2.jpg
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP TSL2561
|
||||
GPIO (5) <--> SCL
|
||||
@@ -94,7 +94,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Light#VI_Lux do
|
||||
if Light#VI_Lux>100
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. _P017_PN532_page:
|
||||
|
||||
PN532
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. _P018_GP2Y10_page:
|
||||
|
||||
GP2Y10
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p01x.repl
|
||||
.. _P019_PCF8574_page:
|
||||
|
||||
PCF8574
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p02x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p02x.repl
|
||||
.. _P022_PCA9685_page:
|
||||
|
||||
PCA9685
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p02x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p02x.repl
|
||||
.. _P023_OLED_page:
|
||||
|
||||
OLED
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p02x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p02x.repl
|
||||
.. _P024_MLX90614_page:
|
||||
|
||||
MLX90614
|
||||
@@ -21,7 +21,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP MLX90614
|
||||
GPIO (4) <--> SDA
|
||||
@@ -71,7 +71,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Temp#C do
|
||||
if [Temp#C]>300
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p02x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p02x.repl
|
||||
.. _P025_ADS1115_page:
|
||||
|
||||
ADS1115
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p02x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p02x.repl
|
||||
.. _P027_INA219_page:
|
||||
|
||||
INA219
|
||||
@@ -21,7 +21,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -41,7 +41,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p02x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p02x.repl
|
||||
.. _P028_BME280_page:
|
||||
|
||||
BME280
|
||||
@@ -24,7 +24,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP BME280
|
||||
GPIO (4) <--> SDA
|
||||
@@ -75,7 +75,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on BME#hPa do
|
||||
if BME#hPa>999
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p03x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p03x.repl
|
||||
.. _P030_BMP280_page:
|
||||
|
||||
BMP280
|
||||
@@ -23,7 +23,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP BMP280
|
||||
GPIO (4) <--> SDI (SDA)
|
||||
@@ -77,7 +77,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on BMP#hPa do
|
||||
if BMP#hPa>999
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p03x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p03x.repl
|
||||
.. _P031_SHT1X_page:
|
||||
|
||||
SHT1X
|
||||
@@ -21,7 +21,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -52,7 +52,7 @@ With a delay of 10, on the same node, the clock signal is about 40 kHz.
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p03x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p03x.repl
|
||||
.. _P032_MS5611_page:
|
||||
|
||||
MS5611
|
||||
@@ -21,7 +21,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -41,7 +41,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p03x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p03x.repl
|
||||
.. _P034_DHT12_page:
|
||||
|
||||
DHT12
|
||||
@@ -21,7 +21,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -41,7 +41,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p03x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p03x.repl
|
||||
.. _P035_IR_transmitter_page:
|
||||
|
||||
IR transmitter
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p04x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p04x.repl
|
||||
.. _P045_MPU6050_page:
|
||||
|
||||
MPU6050
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p04x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p04x.repl
|
||||
.. _P046_Ventus_W266_page:
|
||||
|
||||
Ventus W266
|
||||
@@ -42,7 +42,7 @@ Specifications (indoor unit):
|
||||
of the normal builds. If you want to compile ESP Easy with this plugin enabled you
|
||||
can set the following line in your platformio.ini:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
[platformio]
|
||||
env_default = hard_Ventus_W266
|
||||
@@ -70,7 +70,7 @@ Wiring
|
||||
|
||||
.. image:: P046_Ventus_W266_2.jpg
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP Ventus
|
||||
GPIO (4) <--> MOSI
|
||||
@@ -169,7 +169,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on VentusW266#UV do
|
||||
if [VentusW266#UV]>9
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p04x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p04x.repl
|
||||
.. _P047_Soil_moisture_sensor_page:
|
||||
|
||||
Soil moisture sensor
|
||||
@@ -22,7 +22,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -42,7 +42,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p04x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p04x.repl
|
||||
.. _P048_Adafruit_Motor_Shield_v2_page:
|
||||
|
||||
Adafruit Motor Shield v2
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p04x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p04x.repl
|
||||
.. _P049_MH-Z19_page:
|
||||
|
||||
MH-Z19
|
||||
@@ -22,7 +22,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -42,7 +42,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
|
||||
.. _P050_TCS34725_page:
|
||||
|
||||
TCS34725
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
|
||||
.. _P051_AM2320_page:
|
||||
|
||||
AM2320
|
||||
@@ -21,7 +21,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -41,7 +41,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ Wiring
|
||||
|
||||
Circuit wiring (S11 seen from top, with the 5 holes left and the 4 holes right):
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S11 (UART)
|
||||
GPIO (14) <--> TX (5th hole of the 5 holes)
|
||||
@@ -106,7 +106,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on CO2#Level do
|
||||
if [CO2#Level]>2000
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
|
||||
.. _P052_S8_page:
|
||||
|
||||
S8
|
||||
@@ -28,7 +28,7 @@ Wiring
|
||||
|
||||
Circuit wiring (S8 seen from PCB side, with the 5 vias down and the 4 vias up):
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (7) <--> TX (3rd via [middle] of the 5 vias)
|
||||
@@ -95,7 +95,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on CO2#Level do
|
||||
if [CO2#Level]>2000
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
|
||||
.. _P052_tSense_K70_page:
|
||||
|
||||
tSense (K70)
|
||||
@@ -36,7 +36,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP tSense
|
||||
GPIO (7) <--> TX (see pictures further down)
|
||||
@@ -140,7 +140,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on CO2#Level do
|
||||
if [CO2#Level]>2000
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
|
||||
.. _P053_PMSx003_page:
|
||||
|
||||
PMSx003
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p05x.repl
|
||||
.. _P059_Rotary_Encoder_page:
|
||||
|
||||
Rotary Encoder
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p06x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p06x.repl
|
||||
.. _P063_TTP229-B_page:
|
||||
|
||||
TTP229-B
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p06x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p06x.repl
|
||||
.. _P065_DFPlayer_Mini_page:
|
||||
|
||||
DFPlayer Mini
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p06x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p06x.repl
|
||||
.. _P065_YX5300_page:
|
||||
|
||||
YX5300
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p07x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p07x.repl
|
||||
.. _P073_7_Segment_page:
|
||||
|
||||
7 Segment
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. include:: ../Plugin/_plugin_substitutions_p07x.repl
|
||||
.. include:: ../Plugin/_plugin_substitutions_p07x.repl
|
||||
.. _P075_Nextion_page:
|
||||
|
||||
Nextion
|
||||
@@ -20,7 +20,7 @@ Wiring
|
||||
------
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP S8
|
||||
GPIO (X) <--> TX
|
||||
@@ -40,7 +40,7 @@ Setup
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//Code below...
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ The extra argument handles seconds.
|
||||
|
||||
See also `Wikipedia - Cron <https://en.wikipedia.org/wiki/Cron>`_ for more detailed information.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
┌───────────── seconds (0 - 59)
|
||||
│ ┌───────────── minute (0 - 59)
|
||||
@@ -76,7 +76,7 @@ Examples of supported expressions
|
||||
|
||||
Expression, input date, next date:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
"*/15 * 1-4 * * *", "2012-07-01_09:53:50", "2012-07-02_01:00:00"
|
||||
"0 */2 1-4 * * *", "2012-07-01_09:00:00", "2012-07-02_01:00:00"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Will trigger when the cron expression of task named ``foo`` matches the current time.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Cron#foo do
|
||||
GPIO,2,1 //LED on
|
||||
|
||||
@@ -27,7 +27,7 @@ The TX channel from the ESP to the GPS is not needed for this plugin.
|
||||
|
||||
The used baudrate is 9600 bps.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP Neo-6M (HW Serial0)
|
||||
GPIO (3/RX/RX0/D9) <--> TXD
|
||||
@@ -102,7 +102,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on GeoPos#Speed do
|
||||
if [GeoPos#Speed]>50
|
||||
|
||||
@@ -28,7 +28,7 @@ The TX channel from the ESP to the GPS is not needed for this plugin.
|
||||
|
||||
The used baudrate is 9600 bps.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP Neo-7M (HW Serial0)
|
||||
GPIO (3/RX/RX0/D9) <--> TXD
|
||||
@@ -103,7 +103,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on GeoPos#Speed do
|
||||
if [GeoPos#Speed]>50
|
||||
|
||||
@@ -30,7 +30,7 @@ The TX channel from the ESP to the GPS is not needed for this plugin.
|
||||
|
||||
The used baudrate is 9600 bps.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP Neo-M8n (HW Serial0)
|
||||
GPIO (3/RX/RX0/D9) <--> TXD
|
||||
@@ -105,7 +105,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on GeoPos#Speed do
|
||||
if [GeoPos#Speed]>50
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Will trigger when the GPS unit got a good position from the satellites.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on GPS#GotFix do
|
||||
GPIO,2,1 //LED on
|
||||
@@ -19,7 +19,7 @@
|
||||
Will trigger when the GPS unit is not having a good position from the satellites.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on GPS#LostFix do
|
||||
GPIO,2,0 //LED off
|
||||
@@ -32,7 +32,7 @@
|
||||
This means the total travel distance can be more if the GPS does not move in a straight line.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on GPS#travelled do
|
||||
LogEntry,'Travelled %eventvalue% meter'
|
||||
|
||||
@@ -41,7 +41,7 @@ For some controllers or dataset types it is not necessary to acknowledge the new
|
||||
Example Rules for every value / event type
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
// The "homie controller" schedules the event defined in the plug-in.
|
||||
// Does NOT store string values or arrays in the "homie receiver" plug-in.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
The regular events like in every other task. Only difference here is that you may have an event either when the touch pad is touched, released or both.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on touch#Touch do
|
||||
GPIO,2,1 //LED on
|
||||
@@ -21,7 +21,7 @@
|
||||
When enabled, this event will be sent on release of the touch pad. The event variable is the time in msec the pad had been touched.
|
||||
","
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on touch#Duration do
|
||||
LogEntry,'Touch Duration %eventvalue% ms'
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
Example in the log:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
6553261 : Info : Touch : ADC2 ch5 (T5): 10
|
||||
6553338 : Info : EVENT: touch#Touch=10.00
|
||||
|
||||
@@ -20,7 +20,7 @@ Specifications:
|
||||
Wiring
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
ESP UNIT
|
||||
GPIO (X) <--> A
|
||||
@@ -73,7 +73,7 @@ Indicators (recommended settings)
|
||||
Rules examples
|
||||
--------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on TASK#VALUE do
|
||||
if [TASK#VALUE]>999
|
||||
|
||||
+148
-148
@@ -51,79 +51,79 @@ Syntax
|
||||
|
||||
The syntax of a rule can be single line:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on <trigger> do <action> endon
|
||||
on <trigger> do <action> endon
|
||||
|
||||
or multi-line (need to be closed with an "endon"):
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on <trigger> do
|
||||
<action>
|
||||
<action>
|
||||
<action>
|
||||
endon
|
||||
on <trigger> do
|
||||
<action>
|
||||
<action>
|
||||
<action>
|
||||
endon
|
||||
|
||||
IF/ELSE - IF/ELSEIF/ELSE
|
||||
------------------------
|
||||
|
||||
Also simple if ... else ... statements are possible:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on <trigger> do
|
||||
if <test>
|
||||
<action>
|
||||
<action>
|
||||
else
|
||||
<action>
|
||||
endif
|
||||
endon
|
||||
on <trigger> do
|
||||
if <test>
|
||||
<action>
|
||||
<action>
|
||||
else
|
||||
<action>
|
||||
endif
|
||||
endon
|
||||
|
||||
If the "else" part is not needed it can be removed:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on <trigger> do
|
||||
if <test>
|
||||
<action>
|
||||
<action>
|
||||
endif
|
||||
endon
|
||||
on <trigger> do
|
||||
if <test>
|
||||
<action>
|
||||
<action>
|
||||
endif
|
||||
endon
|
||||
|
||||
Also more complex if ... elseif ... else statements are possible (multiple elseif's can be used)
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on <trigger> do
|
||||
if <test1>
|
||||
<action>
|
||||
<action>
|
||||
elseif <test2>
|
||||
<action>
|
||||
<action>
|
||||
else
|
||||
<action>
|
||||
endif
|
||||
endon
|
||||
on <trigger> do
|
||||
if <test1>
|
||||
<action>
|
||||
<action>
|
||||
elseif <test2>
|
||||
<action>
|
||||
<action>
|
||||
else
|
||||
<action>
|
||||
endif
|
||||
endon
|
||||
|
||||
Again, if the "else" part is not needed it can be removed:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on <trigger> do
|
||||
if <test1>
|
||||
<action>
|
||||
<action>
|
||||
elseif <test2>
|
||||
<action>
|
||||
<action>
|
||||
elseif <test3>
|
||||
<action>
|
||||
<action>
|
||||
endif
|
||||
endon
|
||||
on <trigger> do
|
||||
if <test1>
|
||||
<action>
|
||||
<action>
|
||||
elseif <test2>
|
||||
<action>
|
||||
<action>
|
||||
elseif <test3>
|
||||
<action>
|
||||
<action>
|
||||
endif
|
||||
endon
|
||||
|
||||
AND/OR
|
||||
------
|
||||
@@ -135,55 +135,55 @@ consumption of stack space (IRAM). Depending on plug-ins in use this might
|
||||
lead to unpredictable, unreliable behavior, advice is not to exceed 3 levels
|
||||
of nesting.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on <trigger> do
|
||||
if <test1>
|
||||
event,<EventName1>
|
||||
endif
|
||||
endon
|
||||
|
||||
on <EventName1> do
|
||||
if <test2>
|
||||
<action>
|
||||
endif
|
||||
endon
|
||||
on <trigger> do
|
||||
if <test1>
|
||||
event,<EventName1>
|
||||
endif
|
||||
endon
|
||||
|
||||
on <EventName1> do
|
||||
if <test2>
|
||||
<action>
|
||||
endif
|
||||
endon
|
||||
|
||||
As of mega-201803.. we have the possibility to use AND/OR:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on test do
|
||||
if [test#a]=0 or [test#b]=0 or [test#c]=0
|
||||
event,ok
|
||||
else
|
||||
event,not_ok
|
||||
endif
|
||||
endon
|
||||
|
||||
on test2 do
|
||||
if [test#a]=1 and [test#b]=1 and [test#c]=1
|
||||
event,ok
|
||||
else
|
||||
event,not_ok
|
||||
endif
|
||||
endon
|
||||
|
||||
on test3 do
|
||||
if [test#a]=1 and [test#b]=1 or [test#c]=0
|
||||
event,ok
|
||||
else
|
||||
event,not_ok
|
||||
endif
|
||||
endon
|
||||
|
||||
on test4 do
|
||||
if [test#a]=0
|
||||
event,ok
|
||||
else
|
||||
event,not_ok
|
||||
endif
|
||||
endon
|
||||
on test do
|
||||
if [test#a]=0 or [test#b]=0 or [test#c]=0
|
||||
event,ok
|
||||
else
|
||||
event,not_ok
|
||||
endif
|
||||
endon
|
||||
|
||||
on test2 do
|
||||
if [test#a]=1 and [test#b]=1 and [test#c]=1
|
||||
event,ok
|
||||
else
|
||||
event,not_ok
|
||||
endif
|
||||
endon
|
||||
|
||||
on test3 do
|
||||
if [test#a]=1 and [test#b]=1 or [test#c]=0
|
||||
event,ok
|
||||
else
|
||||
event,not_ok
|
||||
endif
|
||||
endon
|
||||
|
||||
on test4 do
|
||||
if [test#a]=0
|
||||
event,ok
|
||||
else
|
||||
event,not_ok
|
||||
endif
|
||||
endon
|
||||
|
||||
Up to two AND/OR can be used per if statement, that means that you can test
|
||||
three float values and if the statement is true/false corresponding action will take place.
|
||||
@@ -191,13 +191,13 @@ three float values and if the statement is true/false corresponding action will
|
||||
Trigger
|
||||
-------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
<trigger>
|
||||
|
||||
The trigger can be an device value being changed:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
DeviceName#ValueName
|
||||
|
||||
@@ -206,13 +206,13 @@ Operator (inequality function)
|
||||
|
||||
Or a inequality function:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
DeviceName#ValueName<inequality function><value>
|
||||
|
||||
Where the "inequality function" is a simple check:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
equal (=) to
|
||||
less (<) than
|
||||
@@ -240,14 +240,14 @@ boot/reboot/time/sleep etc. of the unit:
|
||||
Test
|
||||
----
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
<test>
|
||||
|
||||
As described in the trigger section the test is a check done by checking
|
||||
if the DeviceName#ValueName is meeting a criteria:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
[DeviceName#ValueName]<inequality function><value>
|
||||
|
||||
@@ -257,7 +257,7 @@ DeviceName#ValueName is closed by (square) brackets "[" and "]".
|
||||
Action
|
||||
------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
<action>
|
||||
|
||||
@@ -272,7 +272,7 @@ Comment
|
||||
If you want you can add comments to any row in your rules code. Just
|
||||
remember to add them after the code and always begin with "//":
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on <trigger> do //If this happens then do that...
|
||||
if <test>
|
||||
@@ -356,13 +356,13 @@ In order to allow the comma or space in a parameter, you can wrap the parameter
|
||||
There are multiple quotes available for this, to be able to use "the other quote" in your parameter.
|
||||
For example in JSON, you need the double quote for string like values or keys.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
Publish domoticz/in,{"idx":26,"nvalue":0,"svalue":"[AQ#TVOC]"}
|
||||
|
||||
This can be fixed by wrapping the last parameter with single quotes like this:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
Publish domoticz/in,'{"idx":26,"nvalue":0,"svalue":"[AQ#TVOC]"}'
|
||||
|
||||
@@ -459,7 +459,7 @@ The position arguments are the same as in Arduino ``String::substring`` , meanin
|
||||
|
||||
For example:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on DS-1#Temperature do
|
||||
logentry,{substring:0:1:%eventvalue%}
|
||||
@@ -470,7 +470,7 @@ For example:
|
||||
The ``%eventvalue%`` may contain the value "23.06"
|
||||
The output in the log will then be:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
1512372 : Info : EVENT: DS-1#Temperature=23.06
|
||||
1512404 : Info : ACT : logentry,2
|
||||
@@ -488,13 +488,13 @@ N.B. it is also possible to concatenate these and refer to ``{taskname#varname}`
|
||||
|
||||
For example (bit useless example, just for illustrative purposes):
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on DS-1#Temperature do
|
||||
logentry,{substring:0:2:{strtol:16:{substring:0:2:[DS-1#Temperature]}{substring:3:5:[DS-1#Temperature]}}}
|
||||
endon
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
221313 : Info : EVENT: DS-1#Temperature=22.13
|
||||
221346 : Info : parse_string_commands cmd: substring:0:2:22.13 -> 22
|
||||
@@ -515,14 +515,14 @@ Usage: ``{strtol:16:<string>}`` to convert HEX (base 16) into an integer value.
|
||||
|
||||
Example of extracting sub strings from a value and interpreting as if they were HEX values:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on DS-1#Temperature do
|
||||
logentry,{strtol:16:%eventvalue%}
|
||||
logentry,{strtol:16:{substring:3:5:%eventvalue%}}
|
||||
endon
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
1987550 : Info : EVENT: DS-1#Temperature=24.12
|
||||
1987586 : Info : ACT : logentry,36
|
||||
@@ -566,7 +566,7 @@ Last but not least the fraction is not correct, it needs to be divided by 256 (a
|
||||
|
||||
Complete rule used to parse this and set a variable in a dummy device:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
// Room temperature
|
||||
on !Serial#T1018* do
|
||||
@@ -583,7 +583,7 @@ Usage: ``{ord:<string>}``
|
||||
|
||||
For example:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on DS-1#Temperature do
|
||||
logentry,{ord:A} // ASCII value of 'A'
|
||||
@@ -591,7 +591,7 @@ For example:
|
||||
endon
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
2982455 : Info : EVENT: DS-1#Temperature=23.12
|
||||
2982487 : Info : ACT : logentry,65
|
||||
@@ -626,7 +626,7 @@ Regarding spaces in names it is recommended to NOT use them as it makes bug
|
||||
testing rules a lot harder. Spaces between chunks of code is possible to make
|
||||
the code more readable:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
[DeviceName#ValueName]<<value> //These work...
|
||||
[DeviceName#ValueName] < <value> //the same...
|
||||
@@ -647,14 +647,14 @@ TaskValueSet
|
||||
Dummy Device is a single way to store and read value on variable.
|
||||
Just create Generic - Dummy Device and variables inside it.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
TaskValueSet,TASKnr,VARnr,Value
|
||||
|
||||
This example for two switches that toggle one device (LED and Relay on GPIO 13 and 16).
|
||||
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on sw1#state do
|
||||
if [dummy#var1]=0
|
||||
@@ -688,7 +688,7 @@ For the Unix time there are now 2 variables included:
|
||||
Here some example used to store the Unix time in the dummy plugin to keep track of actions.
|
||||
The values stored in the Dummy variables will be kept and restored on a crash/reboot as long as the ESP remains powered.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
if [DT#YMD]=0 and %unixday%>0
|
||||
taskvalueset,7,1,%unixday%-1
|
||||
@@ -715,7 +715,7 @@ the '=' sign, up to four values are possible).
|
||||
|
||||
Sample rules section:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on remoteTimerControl do
|
||||
timerSet,1,%eventvalue%
|
||||
@@ -723,7 +723,7 @@ Sample rules section:
|
||||
|
||||
Now send this command to the ESP:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
http://<espeasyip>/control?cmd=event,remoteTimerControl=5
|
||||
|
||||
@@ -740,7 +740,7 @@ the value of the Dummy device as condition in if-statement within rules.
|
||||
|
||||
Multiple event values:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on ToggleGPIO do
|
||||
GPIO,%eventvalue1%,%eventvalue2%
|
||||
@@ -748,7 +748,7 @@ Multiple event values:
|
||||
|
||||
You could then use the command "ToggleGPIO" with dynamic GPIO numbers and state.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
http://<espeasyip>/control?cmd=event,ToggleGPIO=12,1
|
||||
|
||||
@@ -757,7 +757,7 @@ Internal variables
|
||||
|
||||
A really great feature to use is the 16 internal variables. You set them like this:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
Let,<n>,<value>
|
||||
|
||||
@@ -774,7 +774,7 @@ remove the jumpiness with hardware you might want to add a filter in the softwar
|
||||
|
||||
A **10 value average**:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On Temp#Value Do
|
||||
Let,10,[VAR#9]
|
||||
@@ -798,7 +798,7 @@ value instead of the sensor value.
|
||||
|
||||
Another filter could be to just use the previous value and **dilute** the new value with that one:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On Temp#Value Do
|
||||
Let,2,[VAR#1]
|
||||
@@ -809,7 +809,7 @@ Another filter could be to just use the previous value and **dilute** the new va
|
||||
|
||||
Yet another filter could be to add the new value to a **summarized average**:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On Temp#Value Do
|
||||
Let,1,[Temp#Value]
|
||||
@@ -823,7 +823,7 @@ one suits your actual scenario the best.
|
||||
PIR and LDR
|
||||
-----------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On PIR#State do
|
||||
if [LDR#Light]<500
|
||||
@@ -836,7 +836,7 @@ PIR and LDR
|
||||
In other words: If the PIR switch is set (to either 1 or 0) and if
|
||||
the light value < 500, then set GPIO port 16 of the ESP.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on PIR#State=1 do
|
||||
if [LDR#Light]<500
|
||||
@@ -849,7 +849,7 @@ Now the event is only triggered when the PIR switches on.
|
||||
SR04 and LDR
|
||||
------------
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on SR04#range<100 do
|
||||
if [ldr#lux]<500
|
||||
@@ -867,7 +867,7 @@ Timer
|
||||
|
||||
There are 8 timers (1-8) you can use:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On System#Boot do //When the ESP boots, do
|
||||
servo,1,12,0
|
||||
@@ -891,7 +891,7 @@ Starting/stopping repeating timers with events
|
||||
To disable an existing timer, set it to 0. This is useful to make repeating
|
||||
timers for things like alarms or warnings:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
//start the warning signal when we receive a start_warning event:
|
||||
On start_warning do
|
||||
@@ -915,7 +915,7 @@ timers for things like alarms or warnings:
|
||||
|
||||
To start or stop the warning signal use http:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
http://<espeasyip>/control?cmd=event,start_warning
|
||||
http://<espeasyip>/control?cmd=event,stop_warning
|
||||
@@ -925,14 +925,14 @@ HTTP call
|
||||
|
||||
When you enter this first command with the correct IP address in the URL of your browser:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
http://<espeasyip>/control?cmd=event,startwatering
|
||||
http://<espeasyip>/control?cmd=event,stopwatering
|
||||
|
||||
And have this rule in the addressed ESP:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On startwatering do
|
||||
gpio,12,1 //start watering (open valve)
|
||||
@@ -966,7 +966,7 @@ SendTo: SendTo <unit>,<command>
|
||||
Imagine you have two ESP Easy modules, ESP#1 and ESP#2
|
||||
In the Rules section of ESP#1 you have this:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on demoEvent do
|
||||
sendTo,2,event,startwatering //(to use the previous example.)
|
||||
@@ -976,7 +976,7 @@ And ESP#2 has the rules according to the previous example (givemesomewater)
|
||||
|
||||
If you then enter this with the correct IP address in the URL of your browser:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
http://<ESP#1-ip >/control?cmd=event,demoEvent
|
||||
|
||||
@@ -984,7 +984,7 @@ Then ESP#1 shall send the event 'startwatering ' to ESP#2.
|
||||
|
||||
It is also possible to directly order GPIO changes, like:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on demoEvent do
|
||||
sendTo,2,GPIO,2,1
|
||||
@@ -993,7 +993,7 @@ It is also possible to directly order GPIO changes, like:
|
||||
|
||||
Publish
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
Publish,<topic>,<value>
|
||||
|
||||
@@ -1004,7 +1004,7 @@ Time
|
||||
|
||||
With Rules you can also start or stop actions on a given day and time, or even on every day.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On Clock#Time=All,18:25 do // every day at 18:25 hours do ...
|
||||
gpio,14,0
|
||||
@@ -1012,7 +1012,7 @@ With Rules you can also start or stop actions on a given day and time, or even o
|
||||
|
||||
Or for a specific day:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On Clock#Time=Sun,18:25 do // for Sunday, but All, Sun, Mon, Tue, Wed, Thu, Fri, Sat will do.
|
||||
gpio,14,0
|
||||
@@ -1021,7 +1021,7 @@ Or for a specific day:
|
||||
It is also possible to use the system value %systime% in rules conditions
|
||||
to make things happen during certain hours of the day:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On Pir#State=1 do
|
||||
If %systime% < 07:00:00
|
||||
@@ -1041,7 +1041,7 @@ SendToHTTP
|
||||
|
||||
To send a message to another device, like a command to switch on a light to Domoticz
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On System#Boot do //When the ESP boots, do
|
||||
timerSet,1,10 //Set Timer 1 for the next event in 10 seconds
|
||||
@@ -1055,7 +1055,7 @@ Many users have reported problems with commands being truncated, particularly
|
||||
when trying to send commands to Domoticz. It seems to be a parsing error.
|
||||
There is the following workaround:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
SendToHTTP 192.168.0.243,8080,/json.htm?type=param=switchlight&command&idx=174&switchcmd=On
|
||||
|
||||
@@ -1071,7 +1071,7 @@ different i2c addresses.
|
||||
|
||||
For dew point on the 'outside':
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on TempHumidityPressure_OUTSIDE#%RH do
|
||||
TaskValueSet,7,1,[TempHumidityPressure_OUTSIDE#°C]-(100-[TempHumidityPressure_OUTSIDE#%RH])/5 // "7" is the number of the task that the dummy device is on, "1" is its first value where we dump our result
|
||||
@@ -1084,7 +1084,7 @@ For dew point on the 'outside':
|
||||
|
||||
For dew point on the 'inside':
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on TempHumidityPressure_INSIDE#%RH do
|
||||
TaskValueSet,7,2,[TempHumidityPressure_INSIDE#°C]-(100-[TempHumidityPressure_INSIDE#%RH])/5 // "7" is the number of the task that the dummy device is on, "2" is its second value where we dump our result
|
||||
@@ -1102,7 +1102,7 @@ Report IP every 30 seconds using MQTT
|
||||
This rule also work as a ping or heart beat of the unit. If it has not
|
||||
published a IP number for 30+ seconds the unit is experiencing problems.
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On System#Boot do //When the ESP boots, do
|
||||
Publish,%sysname%/IP,%ip%
|
||||
@@ -1125,7 +1125,7 @@ just as an example we want to publish these as custom messages with a unique IDX
|
||||
|
||||
*MQTT*
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on INA219#Amps do
|
||||
Publish domoticz/in,{"idx":123456,"nvalue":0,"svalue":"[INA219#Amps]"} //Own made up IDX 123456
|
||||
@@ -1138,7 +1138,7 @@ just as an example we want to publish these as custom messages with a unique IDX
|
||||
|
||||
*HTTP*
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on INA219#Amps do
|
||||
SendToHTTP 192.168.1.2,8080,/json.htm?type=command¶m=udevice&idx=123456&nvalue=0&svalue=[INA219#Amps] //Own made up IDX 123456
|
||||
@@ -1159,7 +1159,7 @@ Using a "normal switch" device which is in this example normally set to low
|
||||
(0) you can make one of two actions when pressed. If you either release the
|
||||
button in less than a second or press it for more than a second:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
on Button#State=1 do
|
||||
timerSet,1,1
|
||||
@@ -1178,7 +1178,7 @@ Calculating water consumption
|
||||
|
||||
Using the pulse counter you can calculate and act on waterflow and changes like this:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: none
|
||||
|
||||
On System#Boot do // When the ESP boots, do
|
||||
TaskValueSet,3,1,0 // TaskValueSet TASKnr,VARnr,Value, Reset the Liters counter to 0
|
||||
|
||||
Reference in New Issue
Block a user