Someone who can help?
Got a real simple card, it controls a entity who has a controlling entity and a state entity as _sensor.
So tapping it says toggle the unit, and the card only changes its color as soon as it got confirmation from the _sensor unit.
Now that can take a few seconds before it changes its color, so i want a step in between showing that i accually tapped the card, and that its waiting for a respons.
So like, starts gray, i tap, it turns dark yellow until the _sensor says its on, then it turns bright yellow (them beeing the variable colors).
Is this possible? it doesn’t seem so hard right?
Its either that or simply make it a 5 second animation
gray - tap; dark yellow for 5 seconds - see if its on turns yellow, or if its not on yet turn gray.
Even a flashing animation would do… just when pressed, the card flashes slowly for 2-3 seconds…
this is the cart now…
I just need something indicating that i accually tapped the card.
I’m having an issue with Custom Button Card that is caused by embedding it within a Conditional card. Any ideas? The code below is MVP to reproduce, but is part of a much larger card already using a specific structure with power buttons. What I’m trying to achieve is that when the conditions mean I’m showing a power off button, it spans the whole width… but as you can see the code works with custom:button-card on its own, but not when it’s showing within a conditional card.
Apologies for being new to this. I’ve spent a couple of hours reading through the first 2 years of responses in this thread but couldn’t find an answer. I don’t think I can read another 2 years at this point and hopefully I can just ask what might be obvious.
Almost every response in here has to do with defined entities - ‘sensor.this.that’. I am hoping to use a small bit of the original poster’s template on an unknown amount of sensors. There are up to ~100 different ones. I only want to display a sensor if it’s got a “off” state. My code for just one sensor is this:
(note the asterisk). I would place this in a conditional card so that it’s only displayed if the entity value is ‘off’.
I’ve tried using auto-entities, but this doesn’t work with templates. What happens is that it sends all 100 entity names to the template, which of course doesn’t expect more than one. The thread discussing auto-entities recommends using the lovelace-layout-card, making note of the section titled ‘Use with entity filters’ in the readme. However, this doesn’t work either - there’s no way to tell lovelace-layout-card to use this custom:button-card. Or perhaps there is and I’m getting it wrong. I’ve tried for several hours but just get messed up.
I’ve read a bit on the ‘decluttering-card’ but I don’t think that’s what I want to do either.
At this point I think I’ve gone WAAAAY too far down the rabbit hole for what I want to do, which is a really simple thing:
display the button using the ‘alerter-dual’ template in the OP’s original post from 2020, for any sensor with a certain value, where the sensor names all fall within the pattern ‘sensor.docker_*_state’.
There could be any number of these sensors and they’ll change over time, so I don’t want to hard code in the sensor names.
Is there a simple way to do this that doesn’t require several more hours of learning?
I can change the buttons in the Mushroom Alarm Panel, but not the color of the icons. What am I doing wrong - type: custom:mushroom-alarm-control-panel-card
entity: alarm_control_panel.lupusec_alarm
states:
- armed_home
- armed_away
card_mod:
style:
mushroom-button:nth-child(1):
$: |
.button {
–bg-color: orange;
}
ha-icon {
–card-mod-icon-color: black;
}
mushroom-button:nth-child(2):
$: |
.button {
–bg-color: green;
}
I’m looking for ideas/ways to improve my custom card for my bin collections. I want to improve how it works and how it looks on both desktop and mobile.
Below is my code;
type: custom:button-card
label: Black Bin <br> will be collected on
entity: sensor.black_bin_collection
show_name: false
show_icon: false
show_label: true
show_state: false
tap_action: none
styles:
grid:
- grid-template-areas: '"l item1" "l blank"'
- grid-template-columns: 50% 40%
- column-gap: 0%
- row-gap: 3px
card:
- height: 100%
- border-radius: var(--border-radius)
- overflow: visible
- box-shadow: 0px 0px 10px -9px black
- border-radius: 25px
- background-color: grey
- justify-items: center
- justify-content: center
label:
- text-align: left
- font-size: 15px
- font-family: Montserrat
- font-weight: 800
- align-self: end
- color: var(--contrast-100)
custom_fields:
item1:
card:
type: custom:button-card
tap_action:
action: none
label: |
[[[
var state = states['sensor.black_bin_collection'].state;
if (state === 'unknown') {
return 'Coming Soon';
} else {
return state;
}
]]]
show_label: true
styles:
grid:
- grid-template-areas: '"state"'
- grid-template-columns: min-content
- grid-template-rows: min-content
label:
- margin-top: 1px
- justify-items: center
- justify-content: center
- font-size: 15px
- font-family: Montserrat
- font-weight: 500
card:
- background-color: grey