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
Thank you! I can’t take credit for the code. but understanding what your copy, pasting and modifying is important.
3 months ago I knew nothing, I’ve read through every post on mushroom especially the ones from your self helping other people. silently in the background understanding and reading the examples you so kindly provided lol.
my dashboard looks so different now as to when I started.
Hi all, I wondered if I could get some help please.
I’ve recently implemented custom:button-card into a could of my dashboard elements and so far this post along with a few other resources has given me everything I need.
I’m trying to add some logic into a template so that the notification element in custom_fields is only displayed when a variable matches some specific values. I’ve tested the logic and that’s all working but I’m not even sure if it’s possible to do what I want. Here is an example which hopefully shows what I’m getting at.