Lockie
May 25, 2023, 11:52am
6931
Hey does anyone know if there is a way to display MaterialDesign icons (MDI) within variables like primary?
Iāve the following code:
type: horizontal-stack
cards:
- type: custom:mushroom-template-card
primary: Home
secondary: '{{states(''sensor.load_power'') }}W'
icon: mdi:flash
icon_color: blue
- type: custom:mushroom-template-card
primary: Battery
secondary: >-
{{states('sensor.battery_power') }}W
({{states('sensor.battery') }}%)
icon: mdi:battery-charging
icon_color: green
- type: custom:mushroom-template-card
primary: Grid
secondary: '{{states(''sensor.grid_power'') }}W'
icon: mdi:transmission-tower
icon_color: purple
Within:
({{states('sensor.battery') }}%)
Iād like to add mdi:battery-charging
Vandana
(Vandana Dass)
May 25, 2023, 12:19pm
6932
card_mod:
style:
mushroom-shape-icon$: |
:ha-card {
padding: 5px 0px 0px 0px !important;
}
:host {
--icon-size: 35px !important;
--card-primary-font-size: 9px !important;
--card-secondary-font-size: 9px!important;
}
ha-icon {
--icon-animation: fountain 1.5s ease infinite;
}
@keyframes fountain {
0%, 100 { clip-path: polygon(0 100%, 0 0, 100% 0, 100% 100%); }
50% { clip-path: polygon(0 100%, 0 47%, 100% 47%, 100% 100%); }
60% { clip-path: polygon(0 100%, 100% 100%, 100% 37%, 79% 36%, 71% 21%, 56% 25%, 44% 25%, 31% 20%, 20% 36%, 0 36%); }
70% { clip-path: polygon(0 100%, 100% 100%, 100% 36%, 79% 36%, 71% 22%, 81% 1%, 24% 0, 31% 21%, 20% 36%, 0 36%); }
80% { clip-path: polygon(0 100%, 100% 100%, 100% 36%, 79% 36%, 76% 28%, 100% 0, 0 0, 23% 28%, 20% 36%, 0 36%); }
}
Why is the padding and icon size not working???
Kindly help
dyego.hass
(Dyego Porto Barbosa)
May 25, 2023, 1:42pm
6933
Could you share your code with us?
dyego.hass
(Dyego Porto Barbosa)
May 25, 2023, 1:50pm
6934
Could you share your code with us?
dyego.hass
(Dyego Porto Barbosa)
May 25, 2023, 1:57pm
6935
Could you share your code with us?
buche11
(Sebastian)
May 25, 2023, 2:03pm
6936
Icon width in Mushroom Template Card
Hi, i try to change the width of the Icon in a template card and want widen the grey circle around the lock iconā¦ I know how to change the size with ha-card and āāicon-size: 50px;ā but this changes also the height. I just want to make the icon wider. Tried āāicon-width: 100pxā but this has no effect.
Someone an idea for this solution?
My code ist:
type: custom:mushroom-template-card
entity: lock.nuki_hwr_lock
layout: vertical
icon: mdi:lock
icon_color: black
tap_action:
action: call-service
service: lock.lock
service_data: {}
target:
entity_id: lock.nuki_hwr_lock
fill_container: false
card_mod:
style: |
ha-card {
--icon-border-radius: 12px;
#--icon-size: 50px;`
}
danwooller
(Dan Wooller)
May 25, 2023, 4:04pm
6937
Vandana:
:ha-card {
padding: 5px 0px 0px 0px !important;
}
:host {
--icon-size: 35px !important;
--card-primary-font-size: 9px !important;
--card-secondary-font-size: 9px!important;
}
ha-icon {
--icon-animation: fountain 1.5s ease infinite;
}
@keyframes fountain {
0%, 100 { clip-path: polygon(0 100%, 0 0, 100% 0, 100% 100%); }
50% { clip-path: polygon(0 100%, 0 47%, 100% 47%, 100% 100%); }
60% { clip-path: polygon(0 100%, 100% 100%, 100% 37%, 79% 36%, 71% 21%, 56% 25%, 44% 25%, 31% 20%, 20% 36%, 0 36%); }
70% { clip-path: polygon(0 100%, 100% 100%, 100% 36%, 79% 36%, 71% 22%, 81% 1%, 24% 0, 31% 21%, 20% 36%, 0 36%); }
80% { clip-path: polygon(0 100%, 100% 100%, 100% 36%, 79% 36%, 76% 28%, 100% 0, 0 0, 23% 28%, 20% 36%, 0 36%); }
}
Something like this?
card_mod:
style:
mushroom-shape-icon$: |
ha-icon {
--icon-animation: fountain 1.5s ease infinite;
}
@keyframes fountain {
0%, 100 { clip-path: polygon(0 100%, 0 0, 100% 0, 100% 100%); }
50% { clip-path: polygon(0 100%, 0 47%, 100% 47%, 100% 100%); }
60% { clip-path: polygon(0 100%, 100% 100%, 100% 37%, 79% 36%, 71% 21%, 56% 25%, 44% 25%, 31% 20%, 20% 36%, 0 36%); }
70% { clip-path: polygon(0 100%, 100% 100%, 100% 36%, 79% 36%, 71% 22%, 81% 1%, 24% 0, 31% 21%, 20% 36%, 0 36%); }
80% { clip-path: polygon(0 100%, 100% 100%, 100% 36%, 79% 36%, 76% 28%, 100% 0, 0 0, 23% 28%, 20% 36%, 0 36%); }
}
.: |
ha-card {
padding: 5px 0px 0px 0px !important;
}
:host {
--icon-size: 35px !important;
--card-primary-font-size: 9px !important;
--card-secondary-font-size: 9px!important;
}
danwooller
(Dan Wooller)
May 25, 2023, 4:10pm
6938
Tryā¦
mushroom-shape-icon$: |
.shape {
transform: scale(1.5,1);
}
Vandana
(Vandana Dass)
May 25, 2023, 5:15pm
6939
Yesā¦ this is what I was looking forā¦
Thank you for this.
danwooller
(Dan Wooller)
May 25, 2023, 6:08pm
6940
You can, you can also change the icon when itās off as well, thereās loads of examples of people doing that in this thread.
brpeterso
(Brpeterso)
May 25, 2023, 7:23pm
6941
Try using the grid card and add in more columns than you needā¦so in this case try between 6 to 8 columns, but only have cards for the few that you need in the grid.
1 Like
wgumaa
(Waleed)
May 26, 2023, 6:21am
6943
@Lockie
2 entities for primary? I think the best is to use stack in card and position it to where you want.
Lockie
May 26, 2023, 6:55am
6944
Not sure what you mean. Iām not using two entities for primary or want to. Iām talking about my secondary entry:
secondary: >-
{{states('sensor.battery_power') }}W
({{states('sensor.battery') }}%)
And wanting to add a MDI to the wording of itās display. Hope that clears up what I meant.
wgumaa
(Waleed)
May 26, 2023, 7:01am
6945
@Lockie
The idea behind using stack in card is that you can have 2 cards each with their own mdi and you can control the position of the cards.
Have a look here:
https://github.com/custom-cards/stack-in-card
or here:
https://github.com/ofekashery/vertical-stack-in-card
buche11
(Sebastian)
May 26, 2023, 9:13am
6946
Hi Danwooler, thnak you but this do not change anything:
type: custom:mushroom-template-card
entity: lock.nuki_hwr_lock
layout: vertical
icon: mdi:lock
icon_color: black
tap_action:
action: call-service
service: lock.lock
service_data: {}
target:
entity_id: lock.nuki_hwr_lock
fill_container: false
card_mod:
style: |
mushroom-shape-icon$: |
.shape {
transform: scale(1.5,1);
}
ha-card {
# margin-top: -12px;
--icon-border-radius: 12px;
#--icon-size: 50px;
#margin-top: -12px;
#margin-left: -52px;
}
Any other idea?
Thank you
@rhysb Could you assis me here, animation not working, been tryign for a while
- type: vertical-stack
view_layout:
grid-area: chips
cards:
- type: custom:mushroom-chips-card
chips:
- type: conditional
conditions:
- entity: sensor.dryer_operation_state
state: "Run"
chip:
type: template
icon: mdi:washing-machine
icon_color: |
{% if is_state('sensor.dryer_operation_state', 'Run') %}
blue
{% else %}
disabled
{% endif %}
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: Dryer
content:
type: custom:vertical-stack-in-card
cards:
- type: entities
entities:
- entity: sensor.dryer_runtime
secondary_info: last-updated
show_header_toggle: false
state_color: false
- type: custom:mini-graph-card
entities:
- sensor.dryer_power
card_mod:
style: |
.content {
shake 400ms ease-in-out infinite, drum 1s infinite;
}
@keyframes shake {
0%, 100% { transform: rotate(4deg); }
50% { transform: rotate(-4deg); }
}
@keyframes drum {
50% { clip-path: polygon(0 0, 0 100%, 35% 100%, 36% 74%, 31% 43%, 61% 40%, 71% 69%, 62% 78%, 36% 73%, 35% 100%, 100% 100%, 100% 0); }
}
@rhysb missed the actual animation part in content haha
but i guess i need to edit something more since its a bit messed up.
danwooller
(Dan Wooller)
May 26, 2023, 2:33pm
6949
Yeah, youāre curly bracket closing .shape isnāt indented properly.
danwooller
(Dan Wooller)
May 26, 2023, 2:39pm
6950
Some animations donāt show on chips due to the size.
I think @rhysb is taking a break, not seem him here helping everyone for a few days
Vandana
(Vandana Dass)
May 27, 2023, 6:25am
6951
@rhysb plz guide how can I use mushroom chips to show two values eg ātemperatureā and āprocessor useā one after other after a gap of few seconds.
I.e. it should display ātemperature valueā for few seconds and then āprocessor usedā for few seconds.
Kindly guide