Expressions are widely used by Big5 plug-in (see Profiles description, as well as Output links here). While the general theory of Regular Expressions is quite complex for the typical HS3 user, the examples below cover most of use cases. Feel free to ask for help at HS3 Big5 Forum if you need something beyond that. Furthermore you will find an Expression SandBox in Big5 Configuration page in HS3. It is highly recommended to test any expression that you create in the SandBox before plugging it into Big5.

IMPORTANT ! Always strip the wrap ${ } from the expression and enter the body only in Big5 profiles. However you keep it in Big5 actions.

IMPORTANT ! Please use straight quotes ” ONLY. Curly quotes exist that are left (beginning) and right (end). Those break Big 5 never use them.

RegEx information for advanced users is available here

Example Input Expression Result
Use device value (device reference id = 123) The temperature is ${ val123 }°F outside The temperature is 71.6°F outside
Use device string (device reference id = 123) The last chat message was ‘${ str123 }’. The last chat message was ‘Hello world’.
Calculations The temp ${ val123 }°F is ${ (val123 – 32)*(9.0/5.0) }°C The temperature 71.6°F is 22°C
Math operations ${ sin(90) + ceiling(100.3) * floor(13.9) + round(14.4) } 1328
Parsing string to number 30.5 The string ${ input } can be interpreted as number to calculate: ${ ParseNumber(input) + 100 } The string 30.5 can be interpreted as number to calculate: 130.5
Length of text Hello world Length is ${ Length(input) } Length is 11
Extract numbers (only) Hello 123 world 56 and 10 ${ Numbers(input)[0] } 123
Extract words (only) Hello 123 world 56 and 10 ${ Words(input)[2] } and
Extract on/off (only) Hello on on world off bye on ${ OnOffs(input)[2] } off
Extract end of string using start-index Pin is: 1234 to enter ${ Substring(input, 8) } 1234 to enter
Extract part of string by splitting using string comma,separated,words,as,example ${ Split(input, “,”)[2] } words
Extract part of string by splitting using regex Find the second three-digit number: 55 9 222 44 888 123 ${ Regex(input, “\b\d{3}\b”)[1] } 888
Extract part of string using start-index and length Pin is: 1234 to enter ${ Substring(input, 8, 4) } 1234
Round numbers7.279876543${ round (ParseNumber(input),2) }7.28
Replace part of string E-mail is hello@example.com ${ Replace(input, “E-mail”, “Username”) } Username is hello@example.com
Conditional statement 39 Water is ${ If( ParseNumber(input) > 32, “liquid” , “ice”) } Water is liquid *
* pls note than the second argument (“ice” in the example) can NOT be omitted. Put “null” as an argument if you don’t want any action.
Conditional based on device valueHS3 device Id 123 has value 0${ If (val123 = 0 , “off” , “on” ) }off
True/false compare strings equalWinter${(input) = “Summer”}False
True/false compare strings not
equal
Winter ${(input) <> “Summer”} True
True/false statement start !00 NAME = 44 ${ StartsWith(input, “!00”) } True
True/false statement end !00 NAME = 44 ${ EndsWith(input, “45”) } False
True/false statement regex !00 NAME = 44 ${ RegexMatch(input, “^!\d\d \w* = \d*$”) } True
Extracting JSON string { users: [{ name: ‘Johan’}] } ${ JSON(input, “users[0].name”) } Johan
Extracting JSON number { temperature: 22 } ${ 33 + JSON_Num(input, “temperature”) } 55

Click here to see more information about RegEx for advanced users.