## Introduction to Xiaomi Home Assistant
The Xiaomi Home Assistant is a smart home system that integrates various devices to provide a seamless and automated living experience. One of its key features is the ability to play text using templates, which allows for dynamic and personalized messages.
## The Problem with Templates
However, there have been issues with using templates in the Xiaomi Home Assistant. Specifically, the `now()` template function is not rendering correctly, and attempting to use a template with a calculation, such as `{{ '[{}]' .format(1+1) }}`, results in an error.
## Reproducing the Issue
To reproduce this issue, follow these steps:
1. Play the text using the template `['{{ 现在是: now() }}']`. The `now()` template function should render the current time, but it does not.
2. Play the text using the template `{{ '[{}]' .format(1+1) }}`. This should play the result of the calculation, but instead, it reports an error.
## Error Message
The error message received is:
```
cannot execute action “text/set_value” . action exec failed, smart speaker play text (text.xiaomi_cn_867474828_l05c_play_text_a_5_3), invalid action params format, {{ '[{}]' .format(1+1) }}
```
## Expected Behavior
The expected behavior is for the template to render the calculation result. In the case of the `now()` function, it should play the current time. For the calculation template, it should play the result of the calculation.
## Home Assistant Logs
Unfortunately, there are no logs available for this issue.
## Home Assistant Core Version
The Home Assistant Core version is 2024.12.5.
## Home Assistant Operation System Version
The Home Assistant Operation System version is also 2024.12.5.
## Xiaomi Home Integration Version
The Xiaomi Home Integration version is v0.1.2.
## Conclusion
In conclusion, the issue with using templates in the Xiaomi Home Assistant needs to be resolved. The `now()` template function should render correctly, and calculations within templates should be evaluated and played correctly. This will enhance the overall user experience and provide more flexibility in customizing messages and automations.