String variable concatenation

In an action I’m trying to set a variable to a string by concatenating a string literal between two system varaiables like $currentEventDevice + " is " + $currentEventValue but the string literal appears to be stored with the spaces trimmed off. Am I missing something?

Try this instead:

"${currentEventDevice} is ${currentEventValue}"

(i.e., Groovy is “script like” and will do variable expansion within strings.).

Otherwise, try single quotes in your original expression.

Thanks, I’ll try that!

I have one like that for ecobee setpoint…notice the space in "Cooling to "

► Set number variable {@coolingSetpointValue} = $currentEventValue
► Set string variable {@thermostatStatusString} = "Cooling to {@coolingSetpointValue} F"
► Send notification 'Thermostat Status String: {@thermostatStatusString}' in notifications page

Hi, do you know if its possible to concat a variable ? Like: $ +“2” but that works like $args.name2 ? It always gives the result of $ and add 2 at the end , so null2 because the arg is name2. Thanks!