Hi,
I’m using bubble cards with some modules, like rmn_conditional_background_color and want to adjust the background color dynamically, based on 2 numbers.
I have this button to open a popup for my room’s settings.
If the temperature in this room is lower than the target temperature, the background color should change.
This way I can see directly when a room will be heated.
Unfortunately, my TRVs only have the off and heating modes; when the valve is closed because the target temperature has been reached, they are still set to heating.
type: custom:bubble-card
card_type: button
button_type: name
name: Test
button_action:
tap_action:
action: navigate
navigation_path: "#pop-up-rooms-test"
modules:
- rmn_conditional_background_color
rmn_conditional_background_color:
conditional_background_1:
card_background:
color_preset: deep-orange
color_mode: preset
opacity: 100
conditions:
- condition: numeric_state
entity_id: climate.tado_smart_radiator_thermostat_va01561115
attribute: temperature
above: sensor.tado_smart_radiator_thermostat_va01561115_current_temperature
This is not working, or even If I use a simple condition like this
conditions:
- condition: numeric_state
entity_id: climate.tado_smart_radiator_thermostat_va01561115
attribute: current_temperature
above: 1
I have also tried other modules or withour
styles:
"--bubble-main-background-color": |
[[[
const climate = states['climate.tado_smart_radiator_thermostat_va01561115'];
if (climate && climate.attributes) {
const targetTemp = parseFloat(climate.attributes.temperature);
const currentTemp = parseFloat(climate.attributes.current_temperature);
return targetTemp > currentTemp ? 'orange' : 'transparent';
}
return 'transparent';
]]]
How can I achieve this?
Thanks for your help,
Regards