Hey Ildar,
yes, as you can see in the post above, the last 2 templates on their own work, and indeed, it uses --card-mod-icon:
what I can not get working, is the 2 templates together. canāt this be done?
this does work:
card_mod:
style: |
:host {
--paper-item-icon-color: red;
--card-mod-icon: mdi:home;
}
so I guess I must be making a mistake with the 2 templatesā¦
EDIT:
wait, I found it, checking the above, I suddenly spotted the delimiters ;
so:
- entity: sensor.snapshot_backup
card_mod:
style: |
:host {
--card-mod-icon:
{% if states(config.entity) == 'backed_up' %} mdi:check-circle
{% else %} mdi:alert-circle
{% endif %};
--paper-item-icon-color:
{% if states(config.entity) == 'backed_up' %} green
{% else %} red
{% endif %};
}
looks like:
also, this immediately exhibits the difference between custom-ui and card-mod. Where card-mod Mods the card, (appropriately of course), custom-ui customizes the entity. thatās why the more-info of the snapshot state still looks like:
compared to custom-ui, which makes the entities show in more-info with their customizationsā¦
custom-ui works for almost everything, except for entities created in Python scripts, or some CCās. Like in this case, where the entities are made by the Snapshot to Google add-on, or, as earlier, the fan, which is made by the ArgonOne active cooling add-on
If you have questions on custom-ui, please hop over to the Github repo, and Ill be glad to help. youāll be very pleased with the simplicity, and global functioning of eg:
device_tracker.*_bt:
templates: &bt
icon: >
if (state == 'home') return 'mdi:bluetooth';
return 'mdi:bluetooth-off';
icon_color: >
if (state == 'home') return 'rgb(0,123,255)';
return 'grey';
custom-ui is still very functional, and it isnāt deprecated, it simply never was supported