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