I recreated your first 3 cards and changed the main card to a custom:stack-in-card
Try and let me know
type: custom:stack-in-card
cards:
- type: custom:mushroom-title-card
title: Pannello Automazioni
title_tap_action:
action: call-service
service: input_boolean.toggle
target:
entity_id: input_boolean.menu_automazioni
alignment: center
card_mod:
style: |
ha-card {
border: 2.5px outset blue !important;
padding-right: 150px !important;
padding-left: 150px !important;
padding-bottom: 30px !important;
padding-top: 30px !important;
border-radius: 0px;
background-color: #002f7a !important;
animation: ping 2s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-blue), 0.7);}
70% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
- type: conditional
conditions:
- condition: state
entity: input_boolean.menu_automazioni
state: 'on'
card:
type: custom:stack-in-card
keep:
margin: false
box_shadow: false
background: false
cards:
- type: custom:mushroom-template-card
entity: automation.notifica_connessione_internet
icon: |
{% if is_state(config.entity, 'on') %}
mdi:robot
{% else %}
mdi:robot-off
{% endif %}
icon_color: |
{% if is_state(config.entity, 'on') %}
green
{% else %}
red
{% endif %}
primary: Notifica Connessione Internet Ripristinata
secondary: |
{{ states('automation.notifica_connessione_internet') }}
layout: horizontal
- type: custom:mushroom-template-card
entity: automation.notifica_connessione_internet_caduta
icon: |
{% if is_state(config.entity, 'on') %}
mdi:robot
{% else %}
mdi:robot-off
{% endif %}
icon_color: |
{% if is_state(config.entity, 'on') %}
green
{% else %}
red
{% endif %}
primary: Notifica Connessione Internet Caduta
secondary: |
{{ states('automation.notifica_connessione_internet_caduta') }}
layout: horizontal
- type: custom:mushroom-template-card
entity: automation.ferie_apertura
icon: |
{% if is_state(config.entity, 'on') %}
mdi:robot
{% else %}
mdi:robot-off
{% endif %}
icon_color: |
{% if is_state(config.entity, 'on') %}
green
{% else %}
red
{% endif %}
primary: Ferie Inizio Scena
secondary: |
{{ states('automation.ferie_apertura') }}
layout: horizontal
It was successful for me.
I would also recommend
secondary: |
{{ states('automation.notifica_connessione_internet') }}
or this if you want to capitalize the active state.
secondary: |
{% if is_state(config.entity, 'on') %}
On
{% else %}
Off
{% endif %}
vs
secondary: '{{ states.automation.notifica_connessione_internet.state }}'
Faecon
(Jo)
January 23, 2024, 5:48am
9759
- type: horizontal-stack
cards:
- type: custom:mushroom-template-card
primary: Vaatwasblokjes
entity: counter.keuken_vaatwas_vaatwasblokjes
icon_color: >
{{ [200, 62, 77] if states("counter.keuken_vaatwas_vaatwasblokjes")| round(0) | int(0) <20 else [86,86,86] }}
icon: mdi:counter
fill_container: true
layout: horizontal
multiline_secondary: false
- type: custom:mushroom-template-card
primary: "{{ states('counter.keuken_vaatwas_vaatwasblokjes') | float(0) }} blokjes"
icon:
entity: counter.keuken_vaatwas_vaatwasblokjes
fill_container: true
layout: horizontal
multiline_secondary: false
alignment: end
- type: horizontal-stack
cards:
- type: custom:mushroom-template-card
primary: Verbruik vaatwas
icon: mdi:dishwasher
entity: sensor.vaatwas_verbruik
fill_container: true
layout: horizontal
multiline_secondary: false
- type: custom:mushroom-template-card
primary: "{{ states('sensor.keuken_vaatwas_verbruik') | float(0) }} kWh"
icon:
entity: sensor.keuken_vaatwas_verbruik
fill_container: true
layout: horizontal
multiline_secondary: false
alignment: end
The 2 columns are even. I want the first a little bigger so I can put a little more text
The second column I want aligned on the right, but I donāt manage itā¦
Iād recommend using a grid card or type: custom:layout-card
You can control the column widths grid-template-columns: 80% 20%
and margins
type: custom:stack-in-card
cards:
- type: custom:layout-card
layout_type: custom:grid-layout
layout:
grid-template-columns: 80% 20%
margin: 0px 0px 0px 0px
cards:
- type: custom:mushroom-template-card
primary: Vaatwasblokjes
entity: counter.keuken_vaatwas_vaatwasblokjes
icon_color: >
{{ [200, 62, 77] if states("counter.keuken_vaatwas_vaatwasblokjes")|
round(0) | int(0) <20 else [86,86,86] }}
icon: mdi:counter
fill_container: true
layout: horizontal
multiline_secondary: false
- type: custom:mushroom-template-card
primary: >-
{{ states('counter.keuken_vaatwas_vaatwasblokjes') | float(0) }}
blokjes
icon: null
entity: counter.keuken_vaatwas_vaatwasblokjes
fill_container: true
layout: horizontal
multiline_secondary: false
- type: custom:layout-card
layout_type: custom:grid-layout
layout:
grid-template-columns: 80% 20%
margin: 0px 0px 0px 0px
cards:
- type: custom:mushroom-template-card
primary: Verbruik vaatwas
icon: mdi:dishwasher
entity: sensor.vaatwas_verbruik
fill_container: true
layout: horizontal
multiline_secondary: false
- type: custom:mushroom-template-card
primary: '{{ states(''sensor.keuken_vaatwas_verbruik'') | float(0) }} kWh'
icon: null
entity: sensor.keuken_vaatwas_verbruik
fill_container: true
layout: horizontal
multiline_secondary: false
1 Like
Faecon
(Jo)
January 23, 2024, 7:40am
9761
- type: custom:mushroom-template-card
primary: "{{ states('counter.keuken_vaatwas_vaatwasblokjes') | round(0) | float(0) }} blokjes"
the state is 100
why do I get 100.0 and not 100 ?
try this
primary: |
{{ states('counter.keuken_vaatwas_vaatwasblokjes') | round(0) }} blokjes
or
primary: "{{ states('counter.keuken_vaatwas_vaatwasblokjes') | round(0) }} blokjes"
1 Like
Diegocampy
(Diegocampy)
January 23, 2024, 11:09am
9764
really interesting, but my skills are so limited that I still donāt understand things and I canāt finish my cards. For the light having to choose between only two icons and two colors all solved. But now for the temperature on the card next to it, I wanted 3 icons and three colors, so I donāt understand how to write it. I tried but I donāt think entering the second option is correct.
I posted all the code because there are actually two problems:
just explained that I would like three icons and three colors, but something isnāt working
the second thermometer icon next to it does not show me the temperature
Thank you very much if you can give me some help this time too
type: custom:mushroom-chips-card
chips:
- type: template
entity: binary_sensor.porta_ingresso_contact
icon: >-
{% if is_state('binary_sensor.porta_ingresso_contact', 'off') %}
mdi:door-closed {%- else -%} mdi:door-open {% endif %}
icon_color: >-
{% if is_state('binary_sensor.porta_ingresso_contact', 'off') %} grey {%
else %} red {% endif %}
tap_action:
action: more-info
- type: template
entity: sensore_ingresso_device_temperature
content: '{{stastes.sensore_ingresso_device_temperature.state}} Ā°C'
icon: >-
{% if states('sensor.sensore_ingresso_device_temperature') | int <= 17 %}
mdi:thermometer-minus {% else %} mdi:thermometer-check {% endif %}
icon_color: |-
{% if states('sensor.sensore_ingresso_device_temperature') | int <= 17 %}
blue | int >= 20 %} red {% else %} green {% endif %}
tap_action:
action: more-info
- type: template
entity: sensore_ingresso_illuminance_lux
content: '{{states.sensor.sensore_ingresso_illuminance_lux.state}} lux'
icon: >-
{% if states('sensor.sensore_ingresso_illuminance_lux') | int >= 20 %}
mdi:brightness-5 {% else %} mdi:brightness-4 {% endif %}
icon_color: |-
{% if states('sensor.sensore_ingresso_illuminance_lux') | int >= 20 %}
yellow {% else %} grey {% endif %}
tap_action:
action: more-info
use_entity_picture: true
- type: template
entity: binary_sensor.sensore_ingresso_occupancy
icon: >-
{% if is_state('binary_sensor.sensore_ingresso_occupancy', 'on') %}
mdi:motion-sensor {%- else -%} mdi:motion-sensor-off {% endif %}
icon_color: >-
{% if is_state('binary_sensor.porta_ingresso_contact', 'on') %} grey {%
else %} yellow {% endif %}
tap_action:
action: more-info
Template outputs (so entity states) are strings until you tell it otherwise.
So use | int
, | float
, | round(0)
whatever you want, that tells jinja that its a number. Otherwise default assumption is that it is a string.
1 Like
Lewis_gio
(Lewis)
January 23, 2024, 1:04pm
9766
I have a problem with conditional chips, both with light.tavolo on and off it always shows me the icon. I emptied the cash, uninstalled and installed mushroom but nothing seems to be the conditions are not working
type: vertical-stack
cards:
- type: custom:mushroom-chips-card
chips:
- type: conditional
conditions:
- condition: state
entity: light.tavolo
state: 'on'
chip:
type: template
icon: mdi:car-lifted-pickup
icon_color: red
card_mod:
style: |
ha-card
{
--chip-font-size: 0.25em;
--chip-height: 45px
}
Diegocampy
(Diegocampy)
January 23, 2024, 2:48pm
9767
I solved a problem 2 myself, and Iām writing it in case it might be useful to someone:
I got the logic wrong write correct āstatesā and āsensorā
wrong: ā{{stastes.sensore_ingresso_device_temperature.state}} Ā°Cā
correct:ā{{states.sensor.sensore_ingresso_device_temperature.state}} Ā°Cā
the first problem remains and I have to figure out how to solve it: How can I set three different colors?
FedeL16
(Federico)
January 23, 2024, 5:26pm
9768
thank you it works for me now. Iāve found another solution with local conditional card too, but your its better.
states(āsensor.temperatureā) does not work and now I donāt understand to avoid states.sensor_xxxx.state
raub21
(Raub21)
January 23, 2024, 7:04pm
9769
I am facing a challenge showing the icon of an entity that depends on its state. When it is closed, it works on a pc but not on the iPhone HA app. It does not work when it is open on both PC and iPhone. Here are the screen shots:
iPhone:
Here is the code:
type: custom:mushroom-entity-card
entity: binary_sensor.garagedoor_sensor_iaszone
tap_action:
action: more-info
name: Garage
card_mod:
style: |
ha-card {
padding: 0px !important;
padding-bottom: 3px !important;
text-align: left !important;
ha-state-icon {
{% if is_state(config.entity, 'off') %}
--card-mod-icon: mdi:garage-lock;
--card-mod-icon-color: green;
{% else %}
--card-mod-icon: mdi:garage-open;
--card-mod-icon-color: red;
{% endif %};
}
border: 0px outset #02CCFF;
font-style: italic;
font-variant: small-caps;
box-shadow: none !important;
--secondary-text-color: orange;
}
cob94440
(chris)
January 23, 2024, 9:35pm
9770
Hello. Thanks for sharing.
But my picture and localized address are not centered
If I put them in grid then it works fine for me
square: false
type: grid
cards:
Zenia
(Yevgeniy)
January 23, 2024, 11:17pm
9772
Thank you for sharing your person card, great job. Mine, for some reason not showing for some reason address where I am located right now. Here is a template, which I put in my templates file:
#####Full Address for Person Card#######
- name: My Address
unique_id: 692d4852-2d29-4c24-80bc-0d35ecc245ef
state: >
{% set full_address = state_attr('sensor.sm_s918u_geocoded_location', 'Name') %}
{% if full_address %}
{% set address_parts = full_address.split(' ') %}
{% set street_address = address_parts[:2] %}
{{ street_address | join(' ') }}
{% else %}
'Unknown'
{% endif %}
Thank you
chrs
January 24, 2024, 12:05am
9773
Look for āmargin-left:ā in the code and change after your needs.
chrs
January 24, 2024, 12:12am
9774
Do you see your adress if you look at the sensor state of āsensor.sm_s918u_geocoded_locationā?
Is it āyour street adressā, āzip code cityā?
Zenia
(Yevgeniy)
January 24, 2024, 12:37am
9775
Yes, I can see address on my phone geolocation sensor
Can you post the exact format you are using?
I use it like this:
secondary: |
{{ states('automation.living_room_motion') }}
try to change the attribute to ānameāā¦ in my case the attributes are lower case
1 Like