Hi,
I’m trying this little code in the developer tools, and I get a result:
{{ states('sensor.p2000_brandweer_amsterdam') |regex_replace(find='\d{6}', replace='', ignorecase=False) }}
However, when I put this in an action, it won’t save. When I delete the pipe including the regex_replace sentence, it works, but without the intended outcome of course.
service: tts.google_translate_say
data:
entity_id: media_player.google_nest_audio_woonkamer
language: nl
message: "{{ states('sensor.p2000_brandweer_amsterdam') |regex_replace(find='\d{6}', replace='', ignorecase=False) }}"
In this topic I see a similar solution which seems to work, but that’s not a dynamic state: Regex in automation action not working