thomasloven / lovelace-auto-entities

🔹Automatically populate the entities-list of lovelace cards
MIT License
1.2k stars 111 forks source link

Duplicated Entities #342

Open ShayGus opened 1 year ago

ShayGus commented 1 year ago

Problem: If an entity specified inside entities, but also is true for the filters. It will show up twice.

Expected behavior: If an entity specified using "entities", it should be excluded from the automatic entities. The entity should show up only once.

ildar170975 commented 1 year ago

Please post a code demonstrating the issue.

ShayGus commented 1 year ago
filter:
  include:
    - domain: sensor
      entity_id: sensor.*_power
      state: '>10'
      options:
        type: gauge
        min: 0
        max: 3600
  exclude:
    - entity_id: sensor.total_power
    - name: '*EM3*'
entities:
  - type: gauge
    entity: sensor.estimated_power_minus_individual
    name: Estimated  AC + Stove
    unit: W
    max: 17500
  - type: gauge
    entity: sensor.study_radiator_plug_power
    name: Radiator
    min: 0
    max: 2100
    needle: true
    segments:
      - from: 0
        color: lightblue
      - from: 600
        color: green
      - from: 950
        color: yellow
      - from: 1700
        color: orange
show_empty: false
card:
  square: false
  columns: 6
  type: grid
card_param: cards
sort:
  method: state
  numeric: true
  reverse: true
view_layout:
  grid-area: m

image

ildar170975 commented 1 year ago
  1. No need to post your full code, details which are not related just distracts. Always post a short Minimal Working Example.
  2. You should use a unique option which prevents duplicating.
ShayGus commented 1 year ago

I've added unique: true, the result is still the same.

unique: true
sort:
  method: state
  numeric: true
  reverse: true
ildar170975 commented 1 year ago

Try “unique: entity”

ShayGus commented 1 year ago

This works, thanks.