Color based on attribute
See original GitHub issueCovered my whole lovelace UI in buttons to control the house - LOVE IT! Thanks
Would it be possible to have a color_trigger based on attribute? I’m thinking of primarily a fan (so if the speed = ‘low’) then the color of the button would change then? If you had 3 buttons (low, medium, high) you could set instead of off or on (as the fan doesnt have off or on) color_trigger based on the attribute of the fan speed.
- type: "custom:button-card"
entity: switch.bedroom_fan
size: 48px
icon: mdi:fan
name: Low
action: service
service:
domain: fan
action: set_speed
data:
entity_id: fan.bedroom_fan
speed: low
color_type: card
color_off: rgb(68, 70, 73)
color: rgb(1, 121, 116)
**color_trigger:
value_template: "{{ is_state('fan.attributes.speed', 'low')}}"**
I am being a little lazy here as could make switches for each speed, but i’m thinking of also those folks that use it for tv remotes (ie light up the xbox logo when that attribute is set)?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10
Top Results From Across the Web
Vary symbology by color—ArcGIS Pro | Documentation
Unclassed colors shows variation in a feature attribute by distributing a color scheme evenly across features. Or, you can refine one of the...
Read more >How to Color Your Map Using an Attribute - Esri
Let's click that thing. A little popup asks us what attribute we want to use for color. There is a droplist of the...
Read more >How to color code DOORS objects based on the attribute value
Answer. The default text color in a DOORS column is black. You can change the color of text information in a column based...
Read more >How to I colour based on Attribute Table Field Value? : r/QGIS
Click Symbology. At the top, click the dropdown that prob'ly says Single Symbol and choose Categorized. Set the Value to the field Name....
Read more >ArcMap Symbology: Assign colors based on a column value in ...
Then, use the field calculator geoprocessing tool or right click on that new field in the attribute table and bring up the field...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released!
@jaburges
That’s a button for a select input. It calls a service to select the next option when you click on it. That was already possible before, now the new thing is the state parameter. Here I defined 3 states with 3 values and 3 different colors.
What do you think?