Remove special characters in response variable

Hi,

I’m trying to remove the special characters from a response variable returned by LLM Vision that I’m sending as a notification to my phone

I can remove the text, but not the “: etc.
message: “{{AIResponse | replace(‘response_text’,‘’”)}}”
Any ideas on what to use to get rid of these extra characters?

Hi ,

This may be what you want.
Templating - Home Assistant.

And me using it to strip some stuff from an MQTT topic…
HA_Blueprints/Automations/Zigbee2MQTT-Aqara-Magic-Cube-T1-Pro-CTP-R01-Xiaomi-Lumi.yaml at d1c15d75a7b5fa3042d60f7eee2d7633ea8a27a3 · SirGoodenough/HA_Blueprints · GitHub.

Didn’t work for me - maybe I’m not understanding.

The response text from the response variable is:

{‘response_text’: ‘A man is here. \n’}

And basically I only want: A man is here.

I’ve tried piping twice, but I get a syntax error.

If you need the period gone remove it from the ^ allowed character list.

Just use a split on the “:” character:-

states('sensor.somesenor').split(':')[1]