TapHome

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

FunctionWhat it does
ABSReturns a number’s absolute value.
ADDERRORShows a device error message.
ADDINFOShows a device info message.
ADDWARNINGShows a device warning message.
APPENDAppends to text or a collection.
AVGAverages values, skipping unknown ones.
AVGSTRICTAverages values; a NaN input gives NaN.
BOOLCOLLECTIONCreates a FALSE-filled bool collection.
BYTECOLLECTIONCreates bytes from hex text or a count.
CEILRounds up, optionally to a multiple.
COMPARECompares strings: negative, 0 or positive.
COMPLETESERVICEACTIONCompletes a service action asynchronously.
COMPLETESERVICEATTRIBUTECompletes a service attribute asynchronously.
COPYCopies a substring or sub-collection.
DATETIMECreates a date and time.
DATETIMEADDAdds time to a date.
DEBOUNCEIgnores device reads for a while.
DECODEDecodes XML entities or Base64.
DEWPOINTCalculates the dew point; humidity is 0–1.
ENCODEEncodes text as XML or Base64.
EQUALSCompares numbers with a tolerance.
FLOORRounds down, optionally to a multiple.
FROMBCDConverts packed BCD to a number.
FTPDOWNLOADDownloads an FTP file as bytes.
FTPUPLOADUploads data to an FTP file.
GETATReads one element or character.
GETBITReads one bit of a number.
GETBITSReads a bit field of a number.
GETBYTEReads one byte of a number.
HSVTORGBConverts an HSV colour to RGB.
HTTPREQUESTBuilds an HTTP request object.
HYSTERESISSwitches between two states with hysteresis.
IFChooses a value by a condition.
INDEXOFReturns the first index, or -1.
INSERTInserts into text or a collection.
ISNANTests whether a value is NaN.
ISNULLTests whether a value is Null.
LENGTHReturns the length or element count.
LINEARMaps a value between two ranges.
LNReturns the natural logarithm.
LOCALTIMEZONEReturns the Core’s UTC offset.
LOGReturns a base-10 or custom logarithm.
MAXReturns the largest known value.
MAXSTRICTReturns the largest value or first unknown.
MINReturns the smallest known value.
MINSTRICTReturns the smallest value or first unknown.
MODReturns a division remainder.
MODBUSRReads one value from Modbus registers.
MODBUSRBLOCKReads a register block in one transaction.
MODBUSWWrites values to Modbus registers.
MODBUSWBLOCKWrites a register block in one transaction.
MODBUSWBLOCKNEWrites a block only when changed.
MODBUSWNEWrites a value only when changed.
MQTTPUBLISHPublishes an MQTT message.
NOWReturns the current date and time.
ORDERSorts ascending, dropping unknown values.
ORDERDESCSorts descending, dropping unknown values.
ORDERDESCSTRICTSorts descending, keeping unknown values.
ORDERINDEXReturns indices sorted by ascending value.
ORDERINDEXDESCReturns indices sorted by descending value.
ORDERINDEXDESCSTRICTReturns descending indices, keeping unknown values.
ORDERINDEXSTRICTReturns ascending indices, keeping unknown values.
ORDERSTRICTSorts ascending, keeping unknown values.
PACKVALUEWrites a typed value into a collection.
PARSEJSONReads JSON by JSONPath.
PARSETEXTExtracts text between two patterns.
PARSEXMLReads XML by XPath.
POWERRaises a number to a power.
RANDReturns a random number below 1.
RANDINTReturns a random whole number in a range.
REMOVEATRemoves items at an index.
REPLACEReplaces every match in text or a collection.
RETURNEnds the script with a value.
RGBTOHSVConverts an RGB colour to HSV.
ROUNDRounds to the nearest integer.
SENDDATASends raw TCP or UDP data.
SENDHTTPREQUESTSends an HTTP request, returns the response.
SETATReplaces the element at an index.
SETBITSets one bit of a number.
SETBITSReplaces a bit field of a number.
SETBYTEReplaces one byte of a number.
SIGNReturns the sign: -1, 0 or 1.
SLEEPPauses the script for milliseconds.
SPLITSplits text into a string collection.
SQRTReturns the square root.
SWITCHReturns the first matching case’s result.
TIMESPANCreates a time interval.
TOBCDConverts a number to packed BCD.
TOBYTESEncodes text as bytes.
TODOUBLEParses a number from text.
TOSTRINGConverts a value to text.
UINT16COLLECTIONCreates a zero-filled register collection.
UNPACKVALUEReads a typed value from a collection.