You MUST change the Data field option to JSONata (not JSON) for this to work.
$entities(‘sensor.whatever’) is a function in JSONata (WebSocket nodes only) to return the given entity object. The & operator is the string concatenator. $entities(‘sensor.x’).state will return the state and add this into the string.
JSONata works more reliably than templating when constructing objects for the Action node Data field.