Closed jrb80 closed 1 year ago
You need to put single-line templates between (double) quotes:
text1: "Cars {{ states('sensor.smart_motion_vehicle') }}"
You need to put single-line templates between (double) quotes:
text1: "Cars {{ states('sensor.smart_motion_vehicle') }}"
That just converts the Jinja template into a static string and doesn't pull in the values (see image)
Thus the error is gone but the template it's processed :-( Strange to see '+' signs instead of spaces anyway.
Honestly I don't now whether a template is accepted for text1
.
Did try that via Developer tools?
But I think the problem is due to the service call in lovelace. See: https://community.home-assistant.io/t/how-to-use-service-template-with-tap-action/192638
But I think the problem is due to the service call in Lovelace. See: https://community.home-assistant.io/t/how-to-use-service-template-with-tap-action/192638
Thank you, that was the problem, the service call doesn't work from the Lovelace card. If I use the same method with an automation it works, weird. Clearly a bug with HA Lovelace cards.
Note, I had to insert underscores _ to get rid of the + that replaced the spaces. I think from Dahua is not accepting spaces.
just a related note, if you want to put in a space character, use %20
dahua.set_text_overlay
service does not allow Jinja2 templates. For example;When the automation/script is committed it nulls the template - example below
The above Jinja2 template works correctly in the developer tools.
dahua.set_text_overlay
service should be able to consume sensor data / templates for it to be useful. Using a static text string works but as mentioned, not very useful.