Dear all,
I’m using the following service:
service: input_text.set_value
data:
value: >-
{{ area_id(trigger.entity_id) | capitalize | replace("_", " ") |
replace("og", "Obergeschoss") | replace("Kuche", "Küche") | replace("eg",
"Erdgeschoss") }}
target:
entity_id: input_text.alarmtrigger_area
to set the value of an input text helper with the area of the trigger ID.
The value itself can e.g. be “gallery_livingroom” whicht should be transformed to Gallery Livingroom.
With the code above it translates to “Gallery livingroom”. Due to the “_”, the title
instead of capitalize
likewise doens’t work since in the beginning it was considered a single word.
Any idea how to automatically capitalize both Gallery" and “Livingroom” (as an example, without hardcoding exactly these words).
Thank you a lot in advamce for your help!