Lovelace: Home Feed Card

Thanks for the reply. I think it’s this:

I’m using this card for a feed that has a reverse order.

This is the link wikiquote

I wish I could view the entities by time in descending order.
In this way, if I put max_items: 1 will I only see the last one ?

Thanks again :0)

What component are you using to read that feed? I may set that up so I have a sensor which matches your configuration so I can test any changes I make.

:sweat_smile::disappointed:

I’m sorry, but I’m using iantrich’s feedparser. Can it be a problem for you?

I have tried to create a ‘last motion’ feed with my motion sensors and the below code however it doesn’t seem to be updating correctly. For example I can look in the dev-states and see that the kitchen motion sensor was triggered 6 hours ago, yet it isn’t in the home feed card… any ideas? (there are a number of motion sensors that should all be showing activity around 6 hours ago, but there is nothing showing for that time period)

          - type: 'custom:home-feed-card'
            title: Last Motion
            id_filter: ^nothing.*
            max_item_count: 10
            entities:
              - entity: binary_sensor.ensuite_multisensor_motion
                include_history: true
                exclude_duplicates: false
                exclude_states:
                  - "off"
              - entity: binary_sensor.garage_multisensor_sensor
                include_history: true
                exclude_duplicates: false
                exclude_states:
                  - "off"
              - entity: binary_sensor.gym_multisensor_sensor
                include_history: true
                exclude_duplicates: false
                exclude_states:
                  - "off"
              - entity: binary_sensor.kitchen_multi_sensor_sensor
                include_history: true
                exclude_duplicates: false
                exclude_states:
                  - "off"
              - entity: binary_sensor.lounge_multisensor_sensor
                include_history: true
                exclude_duplicates: false
                exclude_states:
                  - "off"
              - entity: binary_sensor.motion_sensor_158d0001ad43db
                include_history: true
                exclude_duplicates: false
                exclude_states:
                  - "off"
              - entity: binary_sensor.pantry_motion_sensor
            include_history: true
            exclude_duplicates: false
            exclude_states:
              - "off"
          - entity: binary_sensor.paradox_z14_main_shed_pir
            include_history: true
            exclude_duplicates: false
            exclude_states:
              - "off"
          - entity: binary_sensor.paradox_z15_garden_shed_pir
            include_history: true
            exclude_duplicates: false
            exclude_states:
              - "off"
          - entity: binary_sensor.paradox_z4_lounge_pir
            include_history: true
            exclude_duplicates: false
            exclude_states:
              - "off"
          - entity: binary_sensor.paradox_z5_living_pir
            include_history: true
            exclude_duplicates: false
            exclude_states:
              - "off"
          - entity: binary_sensor.passage_multi_sensor_sensor
            include_history: true
            exclude_duplicates: false
            exclude_states:
              - "off"

image

image

I’ve just deployed a new Beta release (0.3.4b1). You will need to use the “Show beta” option in the settings for this card in HACS to see this. This should fix your issue by sorting the items from entities in descending order of their timestamps before applying max_items.
I did notice that, to get timestamps from feedparser which parsed correctly in my card, I had to set the date_format option in feedparse to ‘%Y-%m-%d’ like this:

- platform: feedparser
  name: wikiquote
  feed_url: https://it.wikiquote.org/w/api.php?action=featuredfeed&feed=qotd
  date_format: '%Y-%m-%d'

So, if you still have problems when updating to this version, you may need to do that.

The option exclude_duplicates is wrong. It should be remove_repeats. The default value for this option is true so, since you are excluding the off state with the exclude_states option (which is applied before the remove_repeats option), all but the earliest occurrence of motion for a sensor over the last 24 hours are being excluded.

oooooo YES! :star_struck:
Thanks so much. It works as well as I expected !!
the image (which I will try to remove) is distorted, will it be the caches of my browser? … anyway … thank you very much!

before the beta version

beta versione

There was an issue in 0.3.4b1 due to a a fix I had added to stop images being cut off in the feed. This was setting the width to 100% but unfortunately this also caused images smaller than the width of the feed being stretched. I have just released 0.3.4b2, which now set the maximum width rather than the width, which should work for both cases.

Oh man, you are great! I have no words, thank you very much !!:blush::blush:

will you share the code of your card? Italian here and i’d like to have something similar…

I wrote a mini article here :wink:

and … I corrected the code right now.

1 Like

Thanks, i’ll take a look at it…

I removed all of the exclude_duplicates: false code but it is still not showing the latest motion activity…

Did you just remove the exclude_duplicates: false or did you replace it with remove_repeats: false? Each entity would need to look like this (using the first one as an example) if you want all the events to appear:

- entity: binary_sensor.ensuite_multisensor_motion
  include_history: true
  remove_repeats: false
  exclude_states:
    - "off"

I followed your instructions but i today i get this:

21

Why the news is about 11 november? And the ANSA news are not listed?
Is the link clickable or i have only the number of news?
I checked the sensor and about hassio help it says 0, while wikiquote shows me only the first of 10 and it’s the oldest article…

Are you using the Beta version? That fixes an issue with multi-value entities, where max_items would pick the earliest rather than the latest items from the entity.

Yes, fixed, thanks!

  1. Follow Steven’s instructions install beta 0.3.4b1
  1. The administrator has changed hosts, we still don’t know what happened :frowning:
  1. You read Steven’s guide? In the package I entered max_items: 1
  1. Try this (with the beta version at point 1)
      - type: custom:home-feed-card
        title: "\U0001F4F0 ANSA"
        show_empty: false
        entities:
          - entity: sensor.news_ansa
            multiple_items: true
            list_attribute: entries
            content_template: >-
              [{{title}}]({{link}}) 

I hope to help you :wink:
edit I see now…OK you solved :D**

1 Like

Thanks, that fixed it :grinning:

I’m sorry if I missed this somewhere above.

Is there a way to force the sensors to be listed in order?

And is there a way to hide the time stamp and icons?

Also I tried to apply style: to both the top level and each entity but was unsuccessful.

I’m using this to display NFL standings I scrape using Siri Shortcuts on my iPhone.