Filtering out Anniversaries in my glance card

Hi, I am currently using @pinkywafer’s anniversaries integration as a glance card. I have 6 anniversaries set, and will likely get more. I was wondering what the best way would be to only show the 3 next upcoming ones?

You could use the excellent lovelace-auto-entities card by @thomasloven https://github.com/thomasloven/lovelace-auto-entities

1 Like

Thanks @pinkywafer, I will check it out :slight_smile:

You can do something like:

type: 'custom:auto-entities'
card:
  type: glance
filter:
  include:
    - entity_id: sensor.anniversary*
sort:
  method: state
  numeric: true
  count: 3

Which will automatically pull all anniversary entities (that have the anniversary prefix) sort them and display the top 3

2 Likes

Perfect @pinkywafer. That works, thanks so much for your time

1 Like

Hello,
is it possible to display more information.
For example : age.

I tried with “secondaryinfo-entity-row” and “multiple-entity-row” but it doesn’t work.
Do you have an idea ?

Thank you

Sure, you just need to know which attribute you want. The ‘current age’ attribute would be current_years I used this as the anniversary may be something other than birthdays, so age wouldn’t seem right if it was years since something happened! There’s also a years_at_next_anniversary attribute!

Anyway, if you’re using multiple-entity-row, your config for the entity should be something like this:

- type: custom:multiple-entity-row
  entity: sensor.anniversary_your_birthday_sensor
  entities:
    - attribute: current_years
      name: age
      unit: years

Hope this helps

2 Likes

Ohh thank you @pinkywafer

you are really too strong.

Here is the result on my dashboard.

image

I love

Thank you

1 Like

Hi Chikite,

Would you mind sharing the yaml of this dashboard result

Thanks!

type: type'custom:auto-entities'
card:
  type: entities
  title: "Anniversaire à venir \U0001F382"
filter:
  include:
    - entity_id: sensor.anniversary*
      options:
        type: 'custom:multiple-entity-row'
        entity: this.entity_id
        entities:
          - attribute: current_years
            name: Age
            unit: ans
sort:
  method: state
  numeric: true
  count: 3

Super Chikite, thanks!

Still learning ;-)… is there way to get a notification on my phone in the morning (let’s say at 8) for an anniversary occurring on that day? I can do this on individual anniversaries but how to run this across all anniversaries (also when I add new), do I need a group of sensors for this?

All, I have tried to write a code to alert me in the morning for any anniversaries. Code is not yet working, anybody able to support? Thanks

alias: Notify anniversary
description: ''
trigger:
  - platform: state
    event_type: state_change
condition:
  - condition: template
    value_template: "{{ trigger.event.data.entity_id.startswith('sensor.anniversary_') }}"
action:
  - delay: '08:00'
  - service: notify.mobile_app_iphone
    data:
      message: '{{ trigger.to_state.name }} has his/her anniversary'
      title: Anniversary!
mode: single

Hi, for remaining days state, how do I display 1 month 5 days instead of 35 days?