How can I use attribute state for styling #766
Unanswered
victoroos
asked this question in
Questions about config, custom styles and templates
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi all,
I think I'm quite ok in Home assistant nowadatys, so I wanted to upgrade my simple dashboard with some bubbles.
Works nicely, time for some styling.
I have this as a button:
` - type: custom:bubble-card
card_type: button
button_type: state
entity: sensor.afvalwijzer_gft
scrolling_effect: false
name: Gft Afval
show_state: true
styles: |2-
.bubble-button-background {
background-color: $hass.states['sensor.afvalwijzer_gft'].attributes.is_collection_date_tomorrow === 'true' ? 'green' :
hass.states['sensor.afvalwijzer_gft'].attributes.is_collection_date_today === 'true' ? 'green' :
hass.states['sensor.afvalwijzer_gft'].attributes.is_collection_date_day_after_tomorrow === 'true' ? 'green' : 'grey'} !important;
}
but I couldn't get it to work. It stays green or grey.
I based it on this discussion:
#512
Any tips?
Cheers
Beta Was this translation helpful? Give feedback.
All reactions