Documentation
Script functions A–Z
Every TapHome script function in alphabetical order with a one-line summary and a link to its full reference entry.
Every function of the TapHome script language in alphabetical order, with a one-line summary and a link to its full entry. Function names are case insensitive. Keywords such as VAR, WHILE and BREAK are in Syntax and control flow.
All functions
| Function | What it does |
|---|---|
ABS | Returns a number’s absolute value. |
ADDERROR | Shows a device error message. |
ADDINFO | Shows a device info message. |
ADDWARNING | Shows a device warning message. |
APPEND | Appends to text or a collection. |
AVG | Averages values, skipping unknown ones. |
AVGSTRICT | Averages values; a NaN input gives NaN. |
BOOLCOLLECTION | Creates a FALSE-filled bool collection. |
BYTECOLLECTION | Creates bytes from hex text or a count. |
CEIL | Rounds up, optionally to a multiple. |
COMPARE | Compares strings: negative, 0 or positive. |
COMPLETESERVICEACTION | Completes a service action asynchronously. |
COMPLETESERVICEATTRIBUTE | Completes a service attribute asynchronously. |
COPY | Copies a substring or sub-collection. |
DATETIME | Creates a date and time. |
DATETIMEADD | Adds time to a date. |
DEBOUNCE | Ignores device reads for a while. |
DECODE | Decodes XML entities or Base64. |
DEWPOINT | Calculates the dew point; humidity is 0–1. |
ENCODE | Encodes text as XML or Base64. |
EQUALS | Compares numbers with a tolerance. |
FLOOR | Rounds down, optionally to a multiple. |
FROMBCD | Converts packed BCD to a number. |
FTPDOWNLOAD | Downloads an FTP file as bytes. |
FTPUPLOAD | Uploads data to an FTP file. |
GETAT | Reads one element or character. |
GETBIT | Reads one bit of a number. |
GETBITS | Reads a bit field of a number. |
GETBYTE | Reads one byte of a number. |
HSVTORGB | Converts an HSV colour to RGB. |
HTTPREQUEST | Builds an HTTP request object. |
HYSTERESIS | Switches between two states with hysteresis. |
IF | Chooses a value by a condition. |
INDEXOF | Returns the first index, or -1. |
INSERT | Inserts into text or a collection. |
ISNAN | Tests whether a value is NaN. |
ISNULL | Tests whether a value is Null. |
LENGTH | Returns the length or element count. |
LINEAR | Maps a value between two ranges. |
LN | Returns the natural logarithm. |
LOCALTIMEZONE | Returns the Core’s UTC offset. |
LOG | Returns a base-10 or custom logarithm. |
MAX | Returns the largest known value. |
MAXSTRICT | Returns the largest value or first unknown. |
MIN | Returns the smallest known value. |
MINSTRICT | Returns the smallest value or first unknown. |
MOD | Returns a division remainder. |
MODBUSR | Reads one value from Modbus registers. |
MODBUSRBLOCK | Reads a register block in one transaction. |
MODBUSW | Writes values to Modbus registers. |
MODBUSWBLOCK | Writes a register block in one transaction. |
MODBUSWBLOCKNE | Writes a block only when changed. |
MODBUSWNE | Writes a value only when changed. |
MQTTPUBLISH | Publishes an MQTT message. |
NOW | Returns the current date and time. |
ORDER | Sorts ascending, dropping unknown values. |
ORDERDESC | Sorts descending, dropping unknown values. |
ORDERDESCSTRICT | Sorts descending, keeping unknown values. |
ORDERINDEX | Returns indices sorted by ascending value. |
ORDERINDEXDESC | Returns indices sorted by descending value. |
ORDERINDEXDESCSTRICT | Returns descending indices, keeping unknown values. |
ORDERINDEXSTRICT | Returns ascending indices, keeping unknown values. |
ORDERSTRICT | Sorts ascending, keeping unknown values. |
PACKVALUE | Writes a typed value into a collection. |
PARSEJSON | Reads JSON by JSONPath. |
PARSETEXT | Extracts text between two patterns. |
PARSEXML | Reads XML by XPath. |
POWER | Raises a number to a power. |
RAND | Returns a random number below 1. |
RANDINT | Returns a random whole number in a range. |
REMOVEAT | Removes items at an index. |
REPLACE | Replaces every match in text or a collection. |
RETURN | Ends the script with a value. |
RGBTOHSV | Converts an RGB colour to HSV. |
ROUND | Rounds to the nearest integer. |
SENDDATA | Sends raw TCP or UDP data. |
SENDHTTPREQUEST | Sends an HTTP request, returns the response. |
SETAT | Replaces the element at an index. |
SETBIT | Sets one bit of a number. |
SETBITS | Replaces a bit field of a number. |
SETBYTE | Replaces one byte of a number. |
SIGN | Returns the sign: -1, 0 or 1. |
SLEEP | Pauses the script for milliseconds. |
SPLIT | Splits text into a string collection. |
SQRT | Returns the square root. |
SWITCH | Returns the first matching case’s result. |
TIMESPAN | Creates a time interval. |
TOBCD | Converts a number to packed BCD. |
TOBYTES | Encodes text as bytes. |
TODOUBLE | Parses a number from text. |
TOSTRING | Converts a value to text. |
UINT16COLLECTION | Creates a zero-filled register collection. |
UNPACKVALUE | Reads a typed value from a collection. |