Cool use for the new tile card is being able to toggle lights with the icon and bring up more info by tapping the card. @piitaya Is it possible to add support for light colour in the icon?
Tile Light Card
type: custom:vertical-stack-in-card
cards:
- type: tile
entity: light.local_lamp
show_entity_picture: false
name: Monitor Light
card_mod:
style: |
ha-card {
background: none;
box-shadow: none;
{% if is_state(config.entity, 'on') %}
{% set r = state_attr(config.entity, 'rgb_color')[0] %}
{% set g = state_attr(config.entity, 'rgb_color')[1] %}
{% set b = state_attr(config.entity, 'rgb_color')[2] %}
{% if is_state(config.entity, 'on') %}
--primary-text-color: rgb({{r}}, {{g}}, {{b}});
--secondary-text-color: rgba({{r}}, {{g}}, {{b}},0.5);
{% endif %}
{% endif %}
}
ha-tile-icon {
{% if is_state(config.entity, 'on') %}
--icon-color: rgb({{r}}, {{g}}, {{b}}) !important;
--shape-color: rgba({{r}}, {{g}}, {{b}},0.2) !important;
{% endif %}
}
- type: custom:mushroom-light-card
entity: light.local_lamp
use_light_color: true
show_brightness_control: true
show_color_control: true
show_color_temp_control: true
collapsible_controls: false
icon_type: none
primary_info: none
secondary_info: none
card_mod:
style: |
ha-card {
margin-top: -15px;
background: none;
box-shadow: none;
{% if is_state(config.entity, 'on') %}
--primary-text-color: rgb({{ state_attr(config.entity,'rgb_color') [0] }},
{{ state_attr(config.entity,'rgb_color') [1] }},
{{ state_attr(config.entity,'rgb_color') [2] }});
{% endif %}
}
}
card_mod:
style: |
ha-card {
{% if is_state('light.local_lamp', 'on') %}
background: rgba({{ state_attr('light.local_lamp','rgb_color') [0] }},
{{ state_attr('light.local_lamp','rgb_color') [1] }},
{{ state_attr('light.local_lamp','rgb_color') [2] }},0.1);
{% endif %}
}
Collapsable Tile Light Card
type: custom:vertical-stack-in-card
cards:
- type: tile
entity: light.local_monitor_light
show_entity_picture: false
name: Monitor Light
card_mod:
style: |
ha-card {
background: none;
box-shadow: none;
{% if is_state(config.entity, 'on') %}
{% set r = state_attr(config.entity, 'rgb_color')[0] %}
{% set g = state_attr(config.entity, 'rgb_color')[1] %}
{% set b = state_attr(config.entity, 'rgb_color')[2] %}
{% if is_state(config.entity, 'on') %}
--primary-text-color: rgb({{r}}, {{g}}, {{b}});
--secondary-text-color: rgba({{r}}, {{g}}, {{b}},0.5);
{% endif %}
{% endif %}
}
ha-tile-icon {
{% if is_state(config.entity, 'on') %}
--icon-color: rgb({{r}}, {{g}}, {{b}}) !important;
--shape-color: rgba({{r}}, {{g}}, {{b}},0.2) !important;
{% endif %}
}
- type: conditional
conditions:
- entity: light.local_monitor_light
state: 'on'
card:
type: custom:mushroom-light-card
entity: light.local_monitor_light
use_light_color: true
show_brightness_control: true
show_color_control: true
show_color_temp_control: true
collapsible_controls: true
icon_type: none
primary_info: none
secondary_info: none
card_mod:
style: |
ha-card {
margin-top: -15px;
background: none;
box-shadow: none;
{% if is_state(config.entity, 'on') %}
--primary-text-color: rgb({{ state_attr(config.entity,'rgb_color') [0] }},
{{ state_attr(config.entity,'rgb_color') [1] }},
{{ state_attr(config.entity,'rgb_color') [2] }});
{% endif %}
}
}
card_mod:
style: |
ha-card {
{% if is_state('light.local_monitor_light', 'on') %}
background: rgba({{ state_attr('light.local_monitor_light','rgb_color') [0] }},
{{ state_attr('light.local_monitor_light','rgb_color') [1] }},
{{ state_attr('light.local_monitor_light','rgb_color') [2] }},0.1);
{% endif %}
}