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: docs/Scripting-Language.md
+21-4Lines changed: 21 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -170,7 +170,7 @@ a valid script must start with >D in the first line
170
170
171
171
### >D ssize
172
172
173
-
`ssize` = optional max string size (default=19, max=48 unless increased with `#define SCRIPT_MAXSSIZE`)
173
+
`ssize` = optional max string size (default=19, max=255)
174
174
define and init variables here, must be the first section, no other code allowed
175
175
`p:vname`
176
176
specifies permanent variables. The number of permanent variables is limited by Tasmota rules space (50 bytes) - numeric variables are 4 bytes; string variables are one byte longer than the length of string. p vars are stored sequentially in the order of defintion.
@@ -575,7 +575,7 @@ If a Tasmota `SENSOR` or `STATUS` or `RESULT` message is not generated or a `Var
575
575
`maca` = current MAC Address
576
576
`gtopic` = mqtt group topic
577
577
`lip` = local ip as string
578
-
`luip` = udp ip as string (from updating device when USE_SCRIPT_GLOBVARS defined)
578
+
`luip` = udp ip as string (from updating device when USE_SCRIPT_GLOBVARS defined)
579
579
`prefixn` = prefix n = 1-3
580
580
`frnm` = friendly name
581
581
`dvnm` = device name
@@ -593,6 +593,23 @@ If a Tasmota `SENSOR` or `STATUS` or `RESULT` message is not generated or a `Var
593
593
`gtmp` = global temperature
594
594
`ghum` = global humidity
595
595
`gprs` = global pressure
596
+
597
+
global variables
598
+
now optional binary mode, much faster and more precise, also supports arrays.
599
+
`gvr` = reset global variable handler
600
+
`gvrbs` = get, set global variable udp buffer size
601
+
`gvrm` = get, set global variable udp mode, 0 = string mode (default), 1 = binary mode
602
+
`gvrsa(array)` = send array as global variable in binary mode
603
+
`udp(url port string)` = send a string via UDP
604
+
605
+
deep sleep for ESP32 devices only
606
+
`ds(-1)` = get deep sleep wakeup status
607
+
`ds(x)` = deep sleep for x seconds
608
+
`ds(x pin level)` = deep sleep for time and pin level
609
+
if x > 0 sleep x seconds
610
+
if pin != -1 wake on pin change
611
+
pin level that causes wake up
612
+
596
613
`pow(x y)` = calculates exponential powers x^y (imprecise version only)
597
614
`med(n x)` = calculates a 5 value median filter of x (2 filters possible n=0,1)
598
615
`int(x)` = gets the integer part of x (like floor)
@@ -726,7 +743,7 @@ SEL:
726
743
`rapp` = append this line to MQTT (ResponseAppend)
727
744
`wm` = contains source of web request code e.g. 0 = Sensor display (FUNC_WEB_SENSOR)
728
745
729
-
`acp(dst src)` = copy array, if src is numeric variable or constant array dst is filled with this value
746
+
`acp(dst src)` = copy array, if src is numeric variable or constant array dst is filled with this value, if src = sml SML decoder results are copied.
730
747
731
748
`knx(code value)` = sends a number value to KNX
732
749
@@ -735,7 +752,7 @@ SEL:
735
752
`sml(-m 1 initstr)` = reinits serial port of Meter m, initstr: "baud:mode" e.g. "9600:8E1", currently only baud and N,E,O are evaluated.
736
753
`sml(m 2)` = reads serial data received by Meter m into string (if m<0 reads hex values, else asci values)
737
754
`sml(m 3 hstr)` = inserts SML Hexstring variable hstr as binary to Meter m in Output stream e.g. for special MODBUS cmds, hstr must be a string variable NO string constant
738
-
`sml[n]` = get value of SML energy register n
755
+
`sml[n]` = get value of SML energy register n, if n == 0 then get number of decode lines
739
756
`smls[m]` = get value of SML meter string info of meter m, if m < 0 gets string representation of numeric value of decode line m, this enables double number resolution.
740
757
`smlv[n]` = get SML decode valid status of line n (1..N), returns 1 if line decoded. n=0 resets all status codes to zero
0 commit comments