Lovelace: Home Feed Card

I have just released version 0.3.2. This makes the module imports local, rather than coming from unpkg.com, so should eliminate the CORS errors.

2 Likes

Thanks, finally all is working again!

Thanks. Mine is working also.

Hi, your card is great! thank you for sharing with you all. I have a problem when I use home feed card. I currently have a card with time and date (clock-card). The date is written in French (I am French). But when I add home feed card, the date is put in English. Someone would have an idea of the problem?
Thanks for your help


good work.

This looks like some sort of conflict with that particular card. I have temporarily changed my browser language to French and other built-in cards still seem to show the language as French even when they are on the same page as the home feed card.

Do you have a link to the card you are using so I can see where the issue lies? I can’t find it on HACS, and searching for clock-card is bringing back multiple results so I want to test with the right one.

okay thank you for your help, I use the tyrsen card (here: Palm Springs Theme) .I followed his instructions by creating a clock-card.js file and pasting his code. And create a file moment.js by translating the months written in English (january, february …) by French (janvier, février …). It did not cause me any problem elsewhere. But I did not find another card that could show me the time and date with a logo as simple and beautiful.

thanks! (sorry for my basic english …)

I forgot to mention that the date goes into English after several seconds to 1 minute

I think I have tracked down what is happening. My card also uses the Moment module and the way it imports it causes it to conflict with the moment.js you created. The version I import already has all the translations, but it wasn’t setting the locale based on the browser lanuage and so the translations weren’t working. I have just pushed a new release, 0.3.3 that should fix that. Can you update to this and see if it fixes the problem for you.

1 Like

After updating it works! that’s great ! thank you for your speed and your help

Hi!
How can I view the reverse order of feeds.
I have 10 items, but I would like to display only one, the last one.
Thanks.

Can you give me a bit more detail on exactly how you want the items to show? The current sort is by absolute time difference (ignoring the sign, positive or negative) between the entity time (state of timestamp sensors, modified time for other entities) and the current time. This means that items at the top of the list have a time nearest to the current time (past or future) and as you go further down the list the items are further into the past or future, which sounds like what you are looking for.

I could implement some alternative sort orders, are any of these what you are looking for?

  • Time difference sort in descending order - same as current sort, but those items further into the past or future would be at the top
  • Simple time sort in descending order - this would sort by the time value in descending order
  • SImple time sort in ascending order - this would sort by the time value in descending order

Both the simple time sort options would cause issues if you have sensors which return timestamps a long way into the past or future, which could result in them sticking to the top or bottom of the feed.

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…