What would be the best way to show the icon on the right side for the Person card?
I’m trying to create a profile icon that shows at the far right of the card, but with my code it shows different for each device. Would it be better to use a Template card in this scenario?
Oh wow, thanks! Can’t believe I over complicated it, when it’s just a single line of code.
Edit: @dimitri.landerloos I’ve noticed this flips the avatar as well. Would it be possible to flip it back to the right way? As I’m using a entity picture, it’s quite noticeable.
Hey there, I’ve been really struggling with getting animated state icons working with this chips card and was hoping to get some help. I’d like to make it so the chip for the fan will have a spinning icon only when the fan is on. I was able to get this working with a mushroom template card, but trying to transition to a chips card instead has been difficult.
I have removed the background from the chips card according to your guide, also tried removing box shadow.
I still get a small border showing on the gradient part of my background. Very obvious on my phone, not on my computer:
Hey everyone. Looking to get some help on a the last few items for my setup. I’ve typically been able to get things working through trial and error, but I can’t seem to figure these out. Any help would be appreciated.
The first are these circular buttons in the Frigate card. I’m trying to change the background circle color, as well as the icon color:
For the background circle color, the card-mod helper output is "body>home-assistant$home-assistant-main$ha-drawer>partial-panel-resolver>ha-panel-lovelace$hui-root$#view>hui-view>hui-masonry-view$#columns>div>hui-vertical-stack-card$#root>frigate-card$#ha-card>frigate-card-menu$div.matching>ha-icon-button:nth-child(1)"
with the property to change being background-color within ha-icon-button.button.
The icon color for it is within the same card-mod helper output, and the property is color, but this is not within ha-icon-button.button.
The last thing is the selected icon color within the controls in a tile card:
The card-mod helper output is: "body>home-assistant$home-assistant-main$ha-drawer>partial-panel-resolver>ha-panel-lovelace$hui-root$#view>hui-view>hui-masonry-view$#columns>div>hui-vertical-stack-card$#root>hui-tile-card$ha-card>hui-card-features$hui-fan-speed-card-feature$div>ha-control-select$#option-off"
with the property being color within .option.selected
For all of these, I’m able to get the property I want changed when inspecting, but can’t figure out how to format it properly for card-mod.
I’m struggling to do what feels like it should be a fairly simple task: I want my door contact sensors to be green when closed (‘safe/all good’ color) and red when they are open. I have this working in Mushroom as long as I use a template card. I have been advised that I should be instead using a Theme and globally modifying the behavior that way. However, I have not been able to successfully get the icon color right even with non-theme attempts when using CardMod. The biggest issue has been getting the icon background to be light/partly translucent. When I specify a color in a template this seems to be done automatically. Examples I’ve seen online all seem to also show that this is not something that is handled manually. I’m aiming for the look of the bottom right card.
4th method you dont really need my input, but you can make it a tiny bit easier:
type: custom:mushroom-template-card
entity: binary_sensor.hallway_front_door_contact
primary: Basement Door
secondary: |-
{% if is_state(entity, 'off') %}
Closed
{% else %}
Open
{% endif %}
icon: |-
{% if is_state(entity, 'off') %}
mdi:door-closed
{% else %}
mdi:door-open
{% endif %}
icon_color: |-
{% if is_state(entity, 'off') %}
green
{% else %}
red
{% endif %}
FYI if you want to use this simplified if statement in the card mod section as well you have to use config.entity instead of just entity like i have above.
Thanks! This confirms that it isn’t done automatically for me, and that I have to add the transparency myself. How come we don’t need a .: - between mushroom-shape-icon and ha-state-icon?
Is there a good way to add this to a theme for all door types? I could figure out how to do it for more global things, but not how to narrow it down further. state-binary_sensor-door-off-color: var(--green-color) and state-binary_sensor-door-on-color: var(--red-color) seems to only apply to non-custom entities.
I already have the simplified template as:
- type: custom:mushroom-template-card
primary: Front Door
secondary: |-
{% if is_state(config.entity, 'off') %}
Closed
{% else %}
Open
{% endif %}
icon: |-
{% if is_state(config.entity, 'off') %}
mdi:door-closed
{% else %}
mdi:door-open
{% endif %}
icon_color: |-
{% if is_state(config.entity, 'off') %}
green
{% else %}
red
{% endif %}
Do you have a suggested method between the options? Theme it globally? Or just use the template?
Correct. The transparency is done by mushroom dynamically when you select a color if you override this color with card mod you have to add transparency back yourself.
You only need to use .: | if you have previously entered the shadow-root of an object, using $. If you dont do that you dont have to use .: | at all. Take a look at the section in the top post called
Its not easy to theme for specific entity types, and i am not too experienced with themes honestly.
I think for what you want to do its probably best to look into the Decluttering card. You can define templates and then use them across multiple cards.