Yes, I also noticed z-index issues with browser_mod if you have sticky cards. The browser_mod popup now renders behind the sticky card, which breaks the entire popup since you can’t access parts of the UI.
Too many frontend changes forced me to revert back to 2023.4 for now. I hope they’re done with frontend changes like this for a long time. Ever since 2023.1 I’ve been faced with breaking changes after each update
Have searched everywhere, but couldn’t find a solution for wrapping long text in the card by using card_mod, as it’s possible in other custom cards. Maybe one of the card_mod gurus can help?
Hi Everyone,
For months I’ve been playing with the Button card towards a goal to have a card change color based on the temperature of a sensor with a gradient from one color to the next.
What I’ve come up with so far successfully changes the label, but the color of the card never changes away from white.
type: custom:button-card
entity: sensor.3fe_temp_humid_sensor_1bed_temperature
show_state: true
color_type: card
show_icon: false
show_label: true
aspect_ratio: 1/1
label: |
[[[
var temp = states['sensor.3fe_temp_humid_sensor_1bed_temperature'].state;
var low = 2;
var high = 112;
var hue = Math.trunc( (temp - low) * 240 / (high - low) );
return ` hsl(${hue}, 100%, 50%)`;
]]]
style:
card:
- color: |
[[[
var temp = states['sensor.3fe_temp_humid_sensor_1bed_temperature'].state;
var low = 2;
var high = 112;
var hue = Math.trunc( (temp - low) * 240 / (high - low) );
return `hsl(${hue}, 100%, 50%)`;
]]]
Hi @Mariusthvdb Thanks for the example for a timer countdown. This seems to be one of the few solutions that updates the countdown every second. Just another question though: I don´t really like the way where the state is showing as ‘00:04 (paused)’. It just doesn’t fit in my custom button card layout. I would like to just see the remaining time, even when the timer is paused.
Hi! I’m working on something similar for my dashboard but it seems that this only works on a page refresh. My first guess is that the event listener is not working. Is there something I could have missed?
After days of searching, this was my closest solution. With Home Assistant, it’s so hard to have a custom style that does not change on all devices
But maybe there is another approach?
Thanks in advance for your help!
Edit: I have this error in the console but I’m not sure that this is related:
[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
I would like to create a button card showing the countdown of a timer. But I can´t get it to my liking. Can anyone help with formatting this? This is what I would like to accomplish:
So no ‘4 (paused)’, but the time in this format in all states (active, paused). And of course it should update every second, which makes it a little more challenging. Displaying the time in this desired format is where the challenge lies, the name & state I can manage.
This yaml will display the time as either ‘4’ (when in active state) or ‘4 (paused)’. I would like to format that. I have tried a dozen different ways of using a state_display, trying to replace using a regex. But I can´t figure it out