This is an ESPHome topic, not sure why @Fallingaway24 thought it wasn’t? I’ve moved it back.
@AndyP129 — please format your code correctly. There could be all sorts of indentation issues hiding.
I think you need to move the quotes:
message: !lambda 'return mess;'
If that doesn’t fix it, please post some code with a real string shown, and the response received.