To all: thank your for the input. I do not use the UI for my lovelace views. I use YAML files; I prefer that mode.
My ui-lovelace.yaml file has a section:
views:
# -----< Include Packaged View Files >-----
- !include lovelace/llv_overview.yaml
- !include lovelace/llv_notifications.yaml
- !include lovelace/llv_schedules.yaml
- !include lovelace/llv_security.yaml
- !include lovelace/llv_sensors.yaml
- !include lovelace/llv_debug.yaml
The “Color Test 4” card YAML I posted originally is in the file llv_debug.yaml included by the ui-lovelace.yaml file. The functionality of where the included files are located has been verified; this has been the structure I’ve used for years, and the other ‘llv_…’ views show up and function properly.
I have other cards using card_mod features that work as well; changing a card’s background color, title text color and sizing, etc.; so I am confident that card_mod is installed correctly (I did install the latest version when I first was trying to figure this out). So I don’t believe the problem lies there, either.
The card “Color Test 4” that I originally posted does indeed appear properly in the web view of that ‘llv_debug’ tab. I have also dropped in other card sections from other, working view files, just to verify that I don’t have a syntax or alignment issue.
I did not include the ‘cards:’ line in my original post. It is in the file, so I should have. I was focusing on the problem within the specific card definition - how to change the name text color of each entity in an entities card individually.
This morning, after all of your welcome suggestions, I re-edited the card definition, to return the ‘- type:’ format and indentation back to how it was originally, after having tried DeeDee’s original suggestion.
It now works.
I am at a loss to explain why. The name text of the first entity is now blue, and for the second, green.
My guess? Perhaps in cutting-and-pasting different examples from various places on the web in search of a solution, I inadvertently included some rogue non-printing character? No idea. But it works now, and indirectly you all contributed to a solution. Again, thank you for your help.
Just for completeness, here is the ‘cards:’ section of the view file, including another test card I used elsewhere while debugging some “turn light on at dusk” routines - just to show that the format of each card section is correct.
cards:
- type: entities
title: "Sun Settings Debug"
show_header_toggle: false
state_color: true
theme: security
entities:
- entity: sensor.sun_next_rising
- entity: sensor.sun_next_setting
- entity: sensor.sun_next_dawn
- entity: sensor.sun_next_dusk
- type: entities
title: "Color Test 4"
show_header_toggle: false
state_color: true
entities:
- entity: switch.in_wall_paddle_switch_120_277_qfsw_500s
card_mod:
style: |
:host {
color: blue;
}
- entity: switch.in_wall_paddle_switch_120_277_qfsw_500s_2
card_mod:
style: |
:host {
color: green;
}
Now I’m off to figure out how to make the name text colors conditional, based on the state of a separate binary_sensor… Thanks again, all!