At path: style -- Expected a value of type `never`, but received: `"ha-card {

Hello,

I am designing my own thermostat with mushrooms cards.

But I have a bug that I can’t figure out.

I want to put the background of my card in black color and remove the borders, but when I put this code:

type: custom:mushroom-entity-card
entity: sensor.salon_temp
name: Salon
icon_type: none
fill_container: false
tap_action:
  action: navigate
  navigation_path: SALON
style: |
  ha-card {
    background-color: rgba(0,0,0,0,0);
  }

I get as error:

At path: style – Expected a value of type never, but received: `"ha-card { background-color: rgba(0,0,0,0,0);}

Can anyone tell me the reason for the error,

Thanks

Isn’t rgba supposed to have 4 parameters?

rgba(255, 99, 246, 0.2)

You are right,

but even so, I still have the error.

The corrected code is:

type: custom:mushroom-entity-card
entity: sensor.salon_temp
name: Salón
icon_type: none
fill_container: false
tap_action:
action: navigate
navigation_path: SALON
style: |
ha-card {
background-color: rgba(0,0,0,0);
box-shadow: none;
border-style: hidden;
}

Now the error is:

At path: style – Expected a value of type never, but received: "ha-card {\n background-color: rgba(0,0,0,0);\n box-shadow: none;\n border-style: hidden;\n}\n"

Thanks for your help

You posted an unformatted code which does not show indents which are important in yaml.
Never dealt with mushroom but it is possible that the reason is a use of card-mod.
Use

card_mod:
  style: |
    …

instead of

style: |
  …

Like this:

type: custom:mushroom-entity-card
entity: sensor.salon_temp
name: Salón
icon_type: none
fill_container: false
tap_action:
  action: navigate
  navigation_path: SALON
card_mod:
  style: |
    ha-card {
      background-color: rgba(0,0,0,0);
      box-shadow: none;
      border-style: hidden;
    }

Now error is:

At path: card_mod – Expected a value of type never, but received: [object Object]

Well, please post a screenshot of the whole editor window with this error)))

Also - create a new card and post the editor screenshot too:

type: entities
entities:
  - entity: sun.sun
card_mod:
  style: |
    ha-card {
      color: red;
    }

Asking just in case: do you have card-mod installed?

card-mod was not installed.

I am installing it now

your code now works:

Thanks for your help, that was the problem, I didn’t know I had to install card-mod, I’m new to this.

Thank you very much for your time.

2 Likes

I have the same issue. I get the follwing error:

  • At path: title – Expected a value of type never, but received: "afvalbeheer"

This is my code:

type: custom:mushroom-template-card
title: afvalbeheer
views:

  • path: default_view
    title: Home
    cards:
    • type: entities
      entities:
      • entity: sensor.limburg_net_pmd
        name: PMD
      • entity: sensor.limburg_net_restafval
        name: Grijze bak
      • entity: sensor.limburg_net_papier
        name: Papier/karton
      • entity: sensor.limburg_net_gft
        name: Groene bak
        title: Volgende ophaling
    • type: entities
      entities:
      • entity: sensor.limburg_net_vandaag
        name: Vandaag
        icon: mdi:recycle
      • entity: sensor.limburg_net_morgen
        name: Morgen
        icon: mdi:recycle
      • entity: sensor.limburg_net_eerst_volgende
        icon: mdi:recycle
        name: Eerstvolgend
        title: Aankomende ophaling
    • type: calendar
      entities:
      • calendar.afvalbeheer_limburg_net

This is absolutely unrelated to the thread.
Start with not specifying a mushroom type for a dashboard.