Updated Scripting Language (markdown)

gemu 2019-10-20 15:21:47 +02:00
parent 884e20bd88
commit 985fa2d06c
1 changed files with 25 additions and 5 deletions

@ -24,7 +24,7 @@ USE_SCRIPT_SUB_COMMAND | enables invoking named script subroutines via the Conso
USE_SCRIPT_HUE | enable `>H` section (Alexa Hue emulation)
USE_SCRIPT_STATUS | enable `>U` section (receive JSON payloads)
SUPPORT_MQTT_EVENT | enables support for subscribe unsubscribe
USE_SENDMAIL | enables support for sending e-mail
USE_SENDMAIL | enables support for sending e-mail and enables the `>m` section
USE_SCRIPT_WEB_DISPLAY | enable `>W` section (modify web UI)
USE_TOUCH_BUTTONS | enable virtual touch button support with touch displays
USE_WEBSEND_RESPONSE | enable receiving the response of a [`WebSend`](Commands#websend) command (received in section E)
@ -343,7 +343,7 @@ if ((a==b) and ((c==d) or (c==e)) and (s!="x"))
**E-mail**
`#define USE_SENDMAIL`
Requires [Tasmota TLS](TLS) to be enabled and configured.
(this also enables TLS as sendmail uses SSL)
`sendmail [server:port:user:passwd:from:to:subject] msg`
The following parameters can be specified during compilation via `#define` directives in `user_config_override.h`:
@ -356,9 +356,29 @@ The following parameters can be specified during compilation via `#define` direc
To use any of these values, pass an `*` as its corresponding argument placeholder. For example:
`sendmail [*:*:*:*:*:to:subject] msg`
Example:
`sendmail [smtp.gmail.com:465:user:passwd:sender@gmail.com:rec@gmail.com:alarm] %string%`
if msg is a `*` character you may specify the email body in the >m section (must end with an `#` character)
Example:
\>D 25
day1=0
et=0
to="\<mrx@gmail.com\>"
\>T
et=ENERGY#Total
\>S
; send on midnight
day1=day
if chg[day1]>0
then
`=>sendmail [*:*:*:*:*:%to%:energy report]*`
endif
\>b
email report at %tstamp%
your power consumption today was %et% KWh
\#
**Subscribe, Unsubscribe**
`#define SUPPORT_MQTT_EVENT`
@ -392,4 +412,4 @@ Shows a web SD card directory (submenu of scripter) where you can upload and dow
`fmd("fname")` make directory fname
`frd("fname")` remove directory fname
`fx("fname")` check if file fname exists
`fe("fname")` execute script fname (max 2048 bytes, script must start with the '>' character on the first line)
`fe("fname")` execute script fname (max 2048 bytes, script must start with the '>' character on the first line)