lovelace-auto-entities icon indicating copy to clipboard operation
lovelace-auto-entities copied to clipboard

FR: add entity_id to numeric state filter

Open Mariusthvdb opened this issue 2 years ago • 1 comments
trafficstars

so we can do:

      - type: custom:auto-entities
        card:
          type: entities
          card_mod: *mod
        filter:
          include:
            - entity_id: sensor.*_actueel
            - state: < input_number.power_threshold

aware we can do template filters, but for those, the card_mod stylings are near impossible...

adding a simple numeric state_filter would greatly facilitate a scenario like above, and allow for very dynamic configurations, and at the same time be able to use card_mod.

      - type: custom:auto-entities
        card:
          type: entities
          card_mod: *mod
        filter:
          include:
            - entity_id: sensor.*_actueel
              options:
                card_mod:
                  style: |
                    :host {
                        --paper-item-icon-color: {% set state = states(config.entity)|int(-5) %}
                            {% if state == 'unknown'%} gray
                            {% elif state > 2000 %} purple
                            {% elif state > 1000 %} maroon
                            {% elif state > 450 %} darkred
                            {% elif state > 300 %} firebrick
                            {% elif state > 0 %} gold
                            {% else %} var(--no-power-color)
                            {% endif %}
                    }
          exclude:
            - state: > input_number.power_threshold

Mariusthvdb avatar Nov 24 '23 11:11 Mariusthvdb

As done in the entity-filter badge and card, and conditional card, by ... myself 😅 Check https://github.com/home-assistant/frontend/pull/19182

It was released in 2024.4.0, but not present in the release note 😞

Quentame avatar Apr 22 '24 12:04 Quentame