Lovelace: Home Feed Card

@tmchow You can do this using the customize section in your config YAML, or in the UI (Configuration > Customization). In the YAML wit would be something like this:

homeassistant:
  ...
  customize:
    sensor.my_sensor:
      icon: mdi:home

You can use the standard Material Design icons in the format mdi:iconname

I don’t think this is something that I would be able to implement in the card, since it can only see the current state of the entity and not the history. The best way of doing this would probably be to have automations creating persistent notifications when the doors open and close, which would appear on the feed. If you use one notification id for door open and another for door close, then you would always see when it last opened or closed (unless you dismiss the notification).

You need to define device class. https://www.home-assistant.io/components/binary_sensor/#device-class

You need to define device class. Binary sensor - Home Assistant

It seems these are already set with the proper device classes. For example, if I go into looking at my Foyer Motion binary sensor, you’ll see device class is already set to motion and yet the home feed card just says off and on. What am I missing?

Due to the way my card display’s the entities, it can’t use the standard entity rows. These do translation between the internal state and the display state based on the device class. My card is only picking up the internal state (“on” or “off”). I’m currently investigating ways to leverage this same logic in my card.

This will possibly involve having a default mapping built into the card, which you can also override in the configuration (e.g. you may want a door sensor to show the state as “opened” in the card instead of just “open” to be more “feed-like”).

I’ve worked out how to implement the standard device class logic and have release a beta version (0.2.8b1) which is now available on HACS. This doesn’t implement any way to override the mapping (e.g. use “Opened” instead of “Open”) as I’m not sure how useful this would actually be. However, I have implemented a way to customise the text displayed so that it doesn’t just show “name @ state”. This uses the content_template option (which was previously only used for multi-item entities), like this:

type: 'custom:home-feed-card'
  title: Home Feed
  show_empty: false
  id_filter: ^home_feed_.*
  entities:
    - entity: device_tracker.person1_phone
      name: Person 1
      content_template: '{{display_name}} arrived at {{state}} ({{latitude}},{{longitude}})'
    - entity: device_tracker.person2_phone
      name: Person 2
      content_template: '{{display_name}} arrived at {{state}} ({{latitude}},{{longitude}})'

The template can use display_name and state, plus any attributes from the entity.

Thank you Steven, i’ll try.

Thanks for your work on this, it’s super useful.

Are the entity’s icons supposed to automatically show in the feed (mine all show as the bell), or do they all have to be manually defined in the config?

Few issues/questions I’m not figuring out yet:

  • Any way to have it show ALL status updates for an item? for example, if I open my garage door, it shows that status at the top of the feed. If I close it, the feed gets updated to closed., but the closed status REPLACES the open one. Ideally I’d like to see the open one, as well as closed, so I can see the history of everything that happened.
  • Things such as water sensors randomly show “unavailable” or “off”. I only want them to pop up if it switches to “ON” (or other entities I’d like to only show if a certain status is picked).
  • I can’t get rid of the “@” status no matter what I do to my config.
  • Any way to change the size of the home feed box? or set a max limit # for total number of feeds shown? I don’t want to have the scroll bar there.

feed2

This isn’t currently possible, but I’ll defintely consider it as, if possible, it would be a great feature.

I may consider adding an option for this, but you can do this now by wrapping my card in the auto-entities card as I mentioned in my earlier post.

Do you definitely have the beta version installed (this was added in 0.2.8b1)?
If you use HACS you will need to click on the “hamburger” menu when on the details for my card and select “Show Beta”, otherwise you can manually download the beta versions from the Releases tab on the GitHub page.

Not currently, but I’ll look into adding an option to disable the scroll bar and set a maximum number of items.

Beta version 0.2.8b3 has now been published.
This includes new options to:

  • include entity history in the feed, not just the current state
  • disable scrollbars
  • limit number of items in feed
  • set maximum height of feed (CSS style)
  • override default state display name (e.g. if you want “not_home” to display as something like “Unknown Destination” rather than “Away”).

The additional options for entities are:

include_history (optional, defaults to false)

This allows the history of an entity to be displayed, rather than just its current state (states of “unknown” are automatically filtered out). This currently uses the history for the last day.

max_history (optional)

The maximum history of the entity to display, this defaults to 3 In addition any attribute of the entity can be used (do not prefix with attributes. ).

remove_repeats (optional, defaults to true)

This controls whether to remove repeated states from the history (e.g. the current state is the same as the previous state). Since “unknown” states are filtered out, this will avoid an entity appearing twice because it changed from “on” to “unknown” and back again following a restart. This can be disabled by setting this to false.

state_map (optional)

This allows custom mappings of states to display names, to override the device_class based mappings. In the example below this is used to map the “not_home” state to “Unknown Destination” instead of the default “Away”.

Example:

type: 'custom:home-feed-card'
  title: Home Feed
  show_empty: false
  id_filter: ^home_feed_.*
  entities:
      - entity: device_tracker.my_phone
        name: Me
        content_template: '{{display_name}} arrived at {{state}} ({{latitude}},{{longitude}})'
        include_history: true
        max_history: 5
        remove_repeats: false
        state_map:
          not_home: Unknown Destination

The top level config also has the following three options:

scrollbars_enabled (optional, defaults to true)

This controls whether the feed is scrollable. If this is set to false then, by default, all items will be displayed unless the max_height or max_item_count option is used.

max_height (optional, defaults to 28em when scrollbars enabled, otherwise unlimited)

The maximum height of the feed in CSS format (e.g. “100px”, “20em”, etc.). When scrollbars are disabled, the content will be cut off at this height, otherwise it will control the scrollable height.

max_item_count (optional, defaults to unlimited)

The maximum number of items to show in the feed, useful if scrollbars are disabled.


If you are using HACS and don’t see the new version, check that you have enabled Beta versions (“Show Beta” on the “hamburger” menu) and also try using the “Reload” option to reload the data.
If you are not using HACS, you can download this release from here.

1 Like

0.2.8 has now been published as a non-beta release. This also includes an additional fix for calendar events. The card should have been sending the time as UTC when querying the events for the feed, but was actually sending it as the local time. This has been fixed now, so the correct events should now appear in the feed.

Hi, thanks for this card; it’s a very nice addition.

One question:

I am trying to use the new state_map to map on/off for some groups of doors to open/closed. It doesn’t seem to be working. Config is below.

  - type: 'custom:home-feed-card'
    title: Home Feed
    show_empty: false
    id_filter: ^home_feed_.*
    entities:
      - entity: group.household
      - entity: group.exit_doors
        state_map:
          Off: Closed
          On: Open
      - entity: group.garage_doors
        state_map:
          Off: Closed
          On: Open
      - entity: alarm_control_panel.ha_alarm

@jwelter I believe the internal state is “on” and “off” rather than “On” and “Off” and, since the map is a dictionary, it is case sensitive.

I had tried that as well; but same issue. Wondering if the “group” represents state differently.

This worked fine for me with a group containing two binary sensors with a device_class of “door”, which should be the same as with actual door sensors:

- type: 'custom:home-feed-card'
    title: Home Feed
    show_empty: false
    id_filter: ^home_feed_.*
    entities:
      - entity: group.doors
        content_template: '{{state}}'         
        state_map:
          'on': 'Some doors are open'
          'off': 'All doors are closed'

The content_template shouldn’t actually be needed there, I was just experimenting with how a combination of the content_template and state_map can be used to have something more interesting than just “Entity is at state”.

Edit: If this is still not working for you, make sure you are on the latest version or try reinstalling it from HACS (if you use it).

Ahhh!!! I was missing the ‘xxxx’ around the states; added that and working well. Thanks!

please make state filtering function without using auto-entity

Is there an example of max_height I have tried to implement it, but can’t get it to work

Is it not available through HACS anymore? Can’t find it
 Even tried to reinstall HACS.