Generating Custom Text in Templates: Seeking Guidance

Hello everyone, :wave:

I’m thrilled to join this vibrant community and dive into the world of smart home automation! As a newcomer, I’m already amazed by the possibilities this platform offers. However, I’ve hit a bit of a snag while working on a project, and I’d love to hear your thoughts and experiences.

Here’s the situation: I’m trying to output the time in words within a template. For example, 10:15 should read as ‘quarter past ten’. I’ve spent quite a bit of time researching different methods, but I haven’t found a straightforward way to achieve this. From what I gather, it seems that creating custom template functions isn’t possible, which is a bit frustrating.

I’d really appreciate it if someone could shed some light on the best approach to generate this custom text. Is there a workaround or a clever way to format the time without diving too deep into the code? I’d love to hear about any techniques or tools that have worked for you.

In the meantime, here’s the intent script I’m currently using as a starting point:

intent_script
GetTime:
speech:
text: It’s {{ strftime(states(‘sensor.time’), ‘%H %M’) }}

I’m hoping to enhance this by adding the time-in-words feature. If anyone has successfully implemented something similar or has a tip to share, I’d be eternally grateful!

Thank you in advance for your insights and support. Let’s keep the creativity flowing! :rocket: