Hi @Ildar_Gabdullin :
Iâm sorry to bother you again, and I was too quick to conclude this workaround works.
To some extend yes it allows me to merge lists defined in several yamls, but it looks like card-mod styling is now broken.
I attach below the working version of floor-plan.yaml:
type: picture-elements
image: /local/floorplan/transparent.png?version=F00CBEDA34B4711C8F5B7C8057BAB745
elements: !include_dir_merge_list floor-plan/
card_mod:
style: |
ha-card {
max-width: 1200px;
height: 100%;
margin: auto;
}
When I convert this to the below (only include 2 yamls), simple card-mod styling inside the thermostats.yaml doesnât work:
type: picture-elements
image: /local/floorplan/transparent.png?version=F00CBEDA34B4711C8F5B7C8057BAB745
elements:
- type: conditional
conditions:
- entity: sensor.ha_uptime
state_not: ""
elements: !include floor-plan/_renders.yaml
- type: conditional
conditions:
- entity: sensor.ha_uptime
state_not: ""
elements: !include floor-plan/thermostats.yaml
card_mod:
style: |
ha-card {
max-width: 1200px;
height: 100%;
margin: auto;
}
The thermostats.yaml is like below:
- &thermostat_base
type: state-label
entity: climate.bathroom_thermostat
title: Bathroom Thermostat
attribute: current_temperature
suffix: "°C"
style: &thermostat_style
border-radius: 20px
text-align: center
background-color: rgba(255,255,255,0.1)
backdrop-filter: blur(1px)
opacity: 100%
font-weight: bold
font-size: 13px
top: 27%
left: 32.5%
card_mod:
style: |
:host {
color:
{% if state_attr(config.entity, 'hvac_action') == 'heating' %}
#ffc108;
{% else %}
#45729e;
{% endif %}
}
tap_action:
action: more-info
double_tap_action:
action: none
hold_action:
action: more-info
# 2ď¸âŁ Remaining thermostats inherit base, override entity, title, and position
- <<: *thermostat_base
entity: climate.bedroom_closet_thermostat
title: Bedroom Closet Thermostat
style:
<<: *thermostat_style
top: 23.5%
left: 71%
- <<: *thermostat_base
entity: climate.bedroom_thermostat
title: Bedroom Thermostat
style:
<<: *thermostat_style
top: 27%
left: 54.6%
...........
In the past I recall I had issue applying card-mod instead a conditional element, this could be a similar issue. Maybe something to do with the code below but I have no idea where and how to modify:
card_mod:
style: |
:host {
color:
{% if state_attr(config.entity, 'hvac_action') == 'heating' %}
#ffc108;
{% else %}
#45729e;
{% endif %}
}
I feel that Iâm last meter to the finish line so really appreciate if you could give me a hand!
Reading the official document it mentions below:
NOTE: card-mod only works on cards that contain a ha-card element. This includes almost every card which can be seen, but not e.g. conditional, entity_filter, vertical-stack, horizontal-stack, grid.
Note, though that those cards often include other cards, which card-mod can work on.
See the manual for each card to see how to specify parameters for the included card(s).
There are also some posts suggesting card-mod doesnât always work well with conditional, but here Iâm applying it directly to the element instead conditional so not sure whatâs missedâŚ