Mushroom Cards - Build a beautiful dashboard easily 🍄 (Part 1)

Hello

Why doesn’t change the color of letters when it reaches 100%?

ha-card {
                --primary-text-color:
                  {% set nivelbateria = states('sensor.quinquelhas_battery_level')%}
                  {% if nivelbateria > '0'  and nivelbateria < '20' %} red
                  {% elif nivelbateria > '21' and nivelbateria  < '80' %} orange
                  {% else %} green
                  {% endif %}
                }

it works red and orange, also green but when it reaches 100, doesn’t work…

I cannot get card_mod to work in Mushroom and Button Card, but the examples using card_mod are effective. How can I resolve this issue?

type: custom:mushroom-person-card
entity: person.qsq
card_mod:
  style:
    mushroom-shape-icon$: |
      .shape {
        --shape-color: orange !important;
      }

Try the same thing with background instead.

--shape-color only applies the color when the entity is considered on (so for person entity when home).

type: custom:mushroom-person-card
entity: person.qsq
card_mod:
  style:
    mushroom-shape-icon$: |
      .shape {
        background: orange !important;
      }

Does this work?

You are comparing a float to a string.
The output of your sensor is likely to be a float. But your values you are comparing against are string because you have wrapped them in '100' if you try without the ' ' it will probably work.

Strings and floats are comparable, but not the way you would expect, so your result is going to be strange.

This is effective, thank you very much. Because I’m just starting to learn and don’t understand many things, may I ask where you recommend starting to learn Mushroom?

If you are talking about card mod and mushroom together you can look through the guide in my profile for examples. If you are talking about just mushroom the github would probably be best.

If i try without ’ ’ doesn’t work

Clearly your sensor isnt a float automatically.

This should work:

       {% set nivelbateria = states('sensor.office_blinds_battery') | float%}
       {% if nivelbateria >= 0  and nivelbateria < 20 %} 
         red;
       {% elif nivelbateria >= 21 and nivelbateria  < 80 %} 
         orange;
       {% else %} 
         green;
       {% endif %}

Ok i will change that…

I take advantage of you being here :grinning:, how i do to make round the nambers?

I put round in the end?

You can yes.


Vs:

thanks :+1:

Do you know how to create a media player card that uses Spotify as a music service and with a drop-down menu where you can select the source to play the music?

For the card I would have no problem creating it, but what about the services/scripts to manage the sources?

Sorry i am going to have to say outside of my experience - but i would also say that the question is probably not for the Mushroom thread :slight_smile:

V3 of my nest hub HA Dashboard ft Jellyfin, LMS and stash app integration. I’m very proud of this.

The floorplan is just an image background, and grid layout cards with mushroom cards did most of the rest.




5 Likes

image

Is there a way to only transform/skew a box-reflect? It looks like an aged function, but its appears to be a good way to create a 3D look without using entity pics if it’s possible.


Vs

Or do you mean something else?

Otherwise its just playing with the 2 first values.

card_mod:
  style: |
    ha-card {
      box-shadow: -10px 10px 15px green;
    }

Something different. -webkit-box-reflect: is what I was referencing. I was curious if transform: edits could be used on the box-reflect

card_mod:
          style:
            mushroom-shape-icon$: |
              .shape {
               --shape-color: none;
               -webkit-box-reflect: below -10px linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.4));
                    } 

Just did a full post on it for reddit :slight_smile:

1 Like

Working on a sleek 3D Mushroom dashboard using Card Mod’s ability to edit the pseudo elements (:after , :before ) . I’ll share the code and finished project when a larger chunk is complete.

2 Likes

Just a note to say that it is not Mushrooms ability to edit pseudo elements. Card Mod provides the facility, but it is native CSS.