wildly copied from other themes and incorporating several my custom-ui color theming, I try to be as precise and adequate as possible. Not at all sure ion the termination here ( and the opening
card-mod-row-yaml: |
"*:first-child$": |
it does work and all mentioned domains are colored. Iâd rather write is as
if config.entity is of domain [âautomationâ,âbinary_sensorâ,âinput_booleanâ,âswitchâ] or something like that, but not sure how to handle thatâŚ
very nice, thank you very much Taras.
werking beautifully and solving an inspector unhandled promise rejection in 1 go ! (I think)
might I bother you with this too:
lokking for and ending match.
sensor.*_actueel, and sensor.*_state need some formatting too ;-=)
In fact, they need the identical formatting⌠now _state could maybe fitted in the match you made for me, _actueel can not, because they are numbers, and now use:
icon_color: >
if (state > 0) return 'var(--primary-color)';
return 'steelblue';
my pardon, and yes, thatâs custom-ui JS. Which I now am trying to transform to Jinja.
so, first, all sensors ending with _state (they have state on/off) need the same styling as what you made above. I hoped those would somehow also fit in that template.
then, the sensors with ending _actueel, which are power sensors, need that same styling when not 0 (which most of the time means the corresponding switches are âoffââŚ), hence the identical styling
Iâm not sure I can be of much help with that. My example is based on your example (containing config.entity.startswith) so I donât understand why it now claims the config dict object has no entity attribute.
Unfortunately I donât use nearly as many custom cards as you do so I have no experience with templating that uses built-in objects like config. All I can confirm is that the suggested templates do work in the Template Editor.
OK. Please consider marking my first post with the Solution tag because, I believe, it adequately answers your original question. Other users might have a similar need to select entities by multiple domains.