Skip to content

How can I use attribute state for styling #766

Discussion options

You must be logged in to vote

Apparently, this works:

    type: custom:bubble-card
    card_type: climate
    entity: climate.living_room
    icon: mdi:heating-coil
    scrolling_effect: true
    state_color: false
    show_attribute: true
    attribute: current_temperature
    card_layout: normal
    sub_button: null
    styles: |
      :host {
        --bubble-climate-main-background-color: ${ hass.states[entity].attributes.temperature > hass.states[entity].attributes.current_temperature ? 'red' : 'green'} !important;
      }

This is important:

    state_color: false

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by MrBearPresident
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment