Skip to content

Commit 06a2bc5

Browse files
authored
deep sleep ds(), global vars gvxxx, binary mode
1 parent 0267865 commit 06a2bc5

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

docs/Scripting-Language.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ a valid script must start with >D in the first line
170170

171171
### >D ssize
172172

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)
174174
define and init variables here, must be the first section, no other code allowed
175175
`p:vname`
176176
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
575575
`maca` = current MAC Address
576576
`gtopic` = mqtt group topic
577577
`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)
579579
`prefixn` = prefix n = 1-3
580580
`frnm` = friendly name
581581
`dvnm` = device name
@@ -593,6 +593,23 @@ If a Tasmota `SENSOR` or `STATUS` or `RESULT` message is not generated or a `Var
593593
`gtmp` = global temperature
594594
`ghum` = global humidity
595595
`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+
596613
`pow(x y)` = calculates exponential powers x^y (imprecise version only)
597614
`med(n x)` = calculates a 5 value median filter of x (2 filters possible n=0,1)
598615
`int(x)` = gets the integer part of x (like floor)
@@ -726,7 +743,7 @@ SEL:
726743
`rapp` = append this line to MQTT (ResponseAppend)
727744
`wm` = contains source of web request code e.g. 0 = Sensor display (FUNC_WEB_SENSOR)
728745

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.
730747

731748
`knx(code value)` = sends a number value to KNX
732749

@@ -735,7 +752,7 @@ SEL:
735752
`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.
736753
`sml(m 2)` = reads serial data received by Meter m into string (if m<0 reads hex values, else asci values)
737754
`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
739756
`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.
740757
`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
741758
`smld(m)` = call decoder of meter m

0 commit comments

Comments
 (0)