thomasloven / lovelace-auto-entities

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

Filtering using last_updated and last_changed doesn't work #224

Closed ptrsconsulting closed 1 year ago

ptrsconsulting commented 2 years ago

Hi,

I've spent much time already trying to filter by one of the 2 dates, like in the example, but struggled to see any changes. The entities just disappear whenever I use this attribute filter. Is it a bug or am I doing it wrong? :/ Filtering

GrizzlyAK commented 2 years ago

I also see weird behavior when trying to use just the examples on the Code page. For example, the one for List the five last triggered motion sensors: list 5 motion sensors that haven't been activated in a LONG time, not the ones I know have. Also, last_updated and last_changed give the same wrong results. The last_triggered option seems to work, listing 5 of the most recent, but when I trigger a sixth one, it doesn't appear in the list. Perhaps I just don't understand what this card is supposed to do. last_triggered isn't even a real attribute, is it?

I'm having lots of trouble with the filtering too.

ndbroadbent commented 2 years ago

Sorry to reply on an old issue, but in case anyone else finds this - @ptrsconsulting The "last_changed" filter is a top-level key, and should not be under attributes. It should be like this:

filter:
  include:
    - domain: binary_sensor
      attributes: 
        device_class: motion
      last_changed: '> 1'