thomasloven / lovelace-auto-entities

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

Exclude state filter on 'off' doesn't apply to 'unavailable' devices #285

Closed alexruffell closed 1 year ago

alexruffell commented 2 years ago

``I am not sure this is a bug but figured I should report it in case it is. I am using logbook card to show past states of certain sensors and while trying to make it more legible, I filtered out "off" states. As shown below one of my sensors was not getting filtered out and I believe that is because currently it is 'unavailable'. When I forced it 'on' it shows as desired, when I force it 'off' it is hidden as desired, and when it went back to 'unavailable' on its own, it was now only showing 'unavailable' instead of the other off states shown in the screenshots below.

Is all this normal or could there be a bug?

image image image
type: custom:auto-entities
card:
  type: logbook
  title: Intrusion Detection Log
  style: |
    .card-header {
    font-size: 18px;
    padding: 2px 15px 2px 15px
    }
  hours_to_show: 48
filter:
  include:
    - entity_id: binary_sensor.*_motion_sensor
    - entity_id: binary_sensor.*_(door|lock)
  exclude:
    - entity_id: binary_sensor.fridge_door
    - state: 'off'
   # - state: unavailable
mvdwetering commented 2 years ago

I think this is expected as 'unavailable' is a state just like 'on' or 'off'. So when it is 'unavailable' it is not 'on' and also not 'off' as it is 'unavailable'. This is also why the filter for 'off' does not exclude it (since it is 'unavailable', not 'off')