figured it would be only for the auto entities, but it isnt, because this does also work straight away:
- type: map
card_mod:
style:
ha-map $: |
{% set entities = config.entities | map(attribute='entity') | list %}
{% for entity in entities %}
{% if not is_state(entity,'home') %}
div:has(> ha-entity-marker[entity-id="{{ entity }}"]) {
filter: brightness(1.75);
}
{% endif %}
{% endfor %}
so the challenge is to get to the next .marker in the Dom pathā¦
this also works btw:
- type: map
card_mod:
style:
ha-map $: |
{% for entity in config.entities %}
{% if is_state(entity,'home') %}
div:has(> ha-entity-marker[entity-id="{{ entity }}"]) {
filter: brightness(1.75);
}
{% endif %}
{% endfor %}
but then we can NOT set the entities as objects, and need to do
entities:
- person.1
- person.2
etc
hahaha, try this:
- type: map
card_mod:
style:
ha-map $: |
{% for entity in config.entities %}
{% if is_state(entity,'home') %}
div:has(> ha-entity-marker[entity-id="{{ entity }}"]) {
filter: brightness(1.75);
outline: solid 4px red !important;
animation: resizing_outline 1s linear infinite;
}
{% endif %}
{% endfor %}
@keyframes resizing_outline {
0% {outline-offset: 0;}
25% {outline-offset: 5px;}
50% {outline-offset: 10px;}
75% {outline-offset: 15px;}
100% {outline-offset: 20px;}
}
different effect.
getting closer with the activity:
- type: map
card_mod:
style:
ha-map $: |
{% for entity in config.entities %}
{% set id = entity.split('.')[1] %}
{% set activity = states('sensor.' ~ id ~ '_activity') %}
{% if activity in ['Automotive','Cycling','Walking'] %}
div:has(> ha-entity-marker[entity-id="{{ entity }}"]) {
filter: brightness(1.75);
outline: solid 2px var(--warning-color);
animation: resizing_outline 1s linear infinite;
}
{% endif %}
{% endfor %}
@keyframes resizing_outline {
0% {outline-offset: 0;}
25% {outline-offset: 5px;}
50% {outline-offset: 10px;}
75% {outline-offset: 15px;}
100% {outline-offset: 20px;}
}
(condition now is targeted correctly to the entity. Element still the wrong one of course)
for now Iāll settle for this
- type: map
card_mod:
style:
ha-map $: |
{% for entity in config.entities %}
{% set id = entity.split('.')[1] %}
{% set activity = states('sensor.' ~ id ~ '_activity') %}
{% if activity in ['Automotive','Cycling','Walking'] %}
div:has(> ha-entity-marker[entity-id="{{entity}}"] ) {
outline: solid 2px var(--warning-color);
border-radius: 50px;
animation: resizing_outline 1s linear infinite;
}
{% endif %}
{% endfor %}
@keyframes resizing_outline {
0% {outline-offset: 0;}
25% {outline-offset: 5px;}
50% {outline-offset: 10px;}
75% {outline-offset: 15px;}
100% {outline-offset: 20px;}
}
the added border-radius
makes it practically identicalā¦ hurrayā¦
(cant stand not being able to find the correct syntax to target the .marker though, and not being able to set it on an individual entity in the entities list)