What is service_template, data_template and split?

Hi guys! I stumbled across these terms but couldn’t find any source explaining it exactly.
Could you help me out?
Just want to improve my knowledge about HA


You are reading out of date posts. Neither data_template nor service_template are used since version 0.115.

Split is a function that can manipulate strings into smaller parts.

Thank you! Where can I read more about it? I bet there are a lot of things like split that are not explained on the main website!


Interestingly it is not in the Jinja documentation. It works similar to the Python method that you can read about here:


Interesting! Thanks.
Could you maybe explain a use case to me?
Cause how I see it from the solution here there’s no split necessary.
So I wonder about some use cases. First I thought splitting a string like from the link you postet {{ light.bathroom.split (‘.’) [1] }} would give me bathroom, but it didn’t. With quotes was the same.


Later in the other thread it was made clear that the attribute is already a list and not a string.

The following is working for me:

{{ 'light.bathroom'.split (".") [1]  }}

Also make sure that you are using the correct quotation marks.

I’m a fool. .split was also within the quotation…
Thanks guys!