Closed Jonny-T-cyber closed 1 month ago
The config-template-card
(CTC) supports JS in templates.
What you posted is a jinja template.
Your alternatives:
Rewrite the template using JS. Discussing a JS code syntax is not supposed to be done in this repo. Suggest to answer all card-related questions in the dedicated CTC thread in HA community (https://community.home-assistant.io/t/100-templatable-lovelace-configurations/105241).
Create a template sensor like this:
template:
- sensor:
- name: my_super_sensor
state: ... your jinja code ...
and then use this sensor inside CTC:
type: custom:config-template-card
variables:
XXX: states['sensor.my_super_sensor'].state
entities:
...
card:
...
Hi! I have this template:
I would like to assign the value of count.counter to a variable and I'm trying the following way but, obviously, it's not the correct way:
So... How do I assign the value of count.counter to the variable COMPONENT_UPDATES? And, also, where/how do I write the template?
Thanks