see:
- title: Map mods
path: map_mods
icon: mdi:map
badges:
cards:
# This mod is functional for listed map entities
- type: map
entities:
- person.marijn
card_mod:
style:
ha-map$: |
{% for entity in config.entities %}
{% if is_state(entity, 'home') %}
div:has(> ha-entity-marker[entity-id="{{ entity }}"]) {
filter: grayscale();
}
{% endif %}
{% endfor %}
# This exact same mod is not functional on the auto-entities filtered entities,
# and needs to adapted to use the initial entities mapper list
- type: custom:auto-entities
card:
type: map
card_mod:
style:
ha-map$: |
{% set entities = config.entities | map(attribute='entity') | list %}
{% for entity in entities %}
{% if not is_state(entity, 'not_home') %}
div:has(> ha-entity-marker[entity-id="{{ entity }}"]) {
filter: grayscale(1) brightness(1.75);
}
{% endif %}
{% endfor %}
filter:
include:
- domain: person
# Note:
# In Chrome we can mod directly on the ha-entity-marker[] element, but for Safari the
# extra div:has() is required