Hi, i have a problem with variables in button card.
So, i want to take the temperature of climate entity (passed with variables) and increase by 0.5 degrees.
This is for button minus and plus in a thermostat card.
But, i receive this error: undefined is not an object (evaluating variables.entity.attributes.temperature)
I want to create a template to which I pass variables. It works well except for this kind of code.
The call of the template
type: 'custom:button-card'
template: tuiles-pieces
variables:
var_icone: 'ios:sofa#fullcolor'
var_nom_piece: 'Salon'
var_path: 'sous-vue-piece-salon'
var_etat_thermostat: 'sensor.ajout_etat_thermostat_salon'
var_temperature: 'sensor.ajout_sensor_temperature_salon'
var_humidite: 'sensor.ajout_sensor_humidite_salon'
var_lumiere_lampes: 'light.salon'
var_lumiere_lampes_icone: 'mdi:lamps'
In the template
ent01: |
[[[
return `<ha-icon
icon="[[[ variables.var_lumiere_lampes_icone ]]]"
</ha-icon>`
]]]
Ne fonctionne pas????
Can you tell me how to do it?