Hello everyone,
I would like to create a simple array of buttons to control the different radiatiors in our home. Essentially there are two settings: 18 °C and 20 °C.
I created a double stack (vertical in horizontal) but I would really like the respective button to change color when the temperature is set. Just like for a light switch where the button has a different color depending on state.
The theromstat reports the temperature, so the system should be able to recognize it. But I am stuck at how to make this button change color accordingly.
My card:
type: horizontal-stack
cards:
- type: vertical-stack
cards:
- type: button
tap_action:
action: call-service
service: climate.set_temperature
service_data: &ref_0
temperature: 18
target:
entity_id: climate.eq_3_master_bedroom
name: 18 °C Master Bedroom
show_state: true
icon: mdi:fire-off
icon_height: 66px
- type: button
tap_action:
action: call-service
service: climate.set_temperature
service_data: *ref_0
target:
entity_id: climate.eq_3_living_room
name: 18 °C Living Room
show_state: true
icon: mdi:fire-off
icon_height: 66px
- type: button
tap_action:
action: call-service
service: climate.set_temperature
service_data:
temperature: 18
target:
entity_id: climate.eq_3_dining_room
name: 18 °C Dining Room
show_state: true
icon: mdi:fire-off
icon_height: 66px
- type: vertical-stack
cards:
- type: button
tap_action:
action: call-service
service: climate.set_temperature
service_data:
temperature: 20
target:
entity_id: climate.eq_3_master_bedroom
name: 20 °C Master Bedroom
show_state: true
icon: mdi:fire
icon_height: 66px
- type: button
tap_action:
action: call-service
service: climate.set_temperature
service_data: &ref_1
temperature: 20
target:
entity_id: climate.eq_3_living_room
name: 20 °C Living Room
show_state: true
icon: mdi:fire
icon_height: 66px
- type: button
tap_action:
action: call-service
service: climate.set_temperature
service_data: *ref_1
target:
entity_id: climate.eq_3_dining_room
name: 20 °C Dining Room
show_state: true
icon: mdi:fire
icon_height: 66px
Could someone help me out?
Thank you
Alex