Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: closest anniversary coming up (who, how long would it take - count down) #157

Open
zivgin opened this issue Dec 23, 2023 · 8 comments

Comments

@zivgin
Copy link

zivgin commented Dec 23, 2023

Would be great to have an entity we can simply select and present in the dashboard.
It will contain the name and upcoming new age (if less then a week remaining), and count down of days + icon.

@PingedPeach
Copy link

i want this

@BebeMischa
Copy link

BebeMischa commented Sep 13, 2024

You could already do that with HACS custom auto-entities card and custom multiple entity row card ;-)

Make your self a dashboard card:

type: custom:auto-entities
card:
  show_name: true
  show_icon: true
  show_state: true
  type: entities
  state_color: true
  columns: 3
  title: Birthdays
filter:
  include:
    - entity_id: sensor.anniversary*
      options:
        type: custom:multiple-entity-row
        entity: this.entity_id
        entities:
          - attribute: years_at_anniversary
            unit: years over
sort:
  method: state
  numeric: true

Final result:
image

@zivgin
Copy link
Author

zivgin commented Sep 14, 2024

Thank you! i tried it, but i have 20 people, i want to only show the closes 3 people and not everyone. or just the 1 person that is closes. is it possible? i couldn't figure out how using your method.

@BebeMischa
Copy link

search for the difference ;-)

type: custom:auto-entities
card:
  show_name: true
  show_icon: true
  show_state: true
  type: entities
  state_color: true
  columns: 3
  title: Birthdays
filter:
  include:
    - entity_id: sensor.anniversary*
      options:
        type: custom:multiple-entity-row
        entity: this.entity_id
        entities:
          - attribute: years_at_anniversary
            unit: years over
sort:
  method: state
  numeric: true
  count: 3

@zivgin
Copy link
Author

zivgin commented Sep 16, 2024

Nice! it worked!
I think i have last question, how can i get the closes birthday in some form of structure
For example i would like to run an automation, that runs daily that echo out the closes birthday's person name, and in how many days is his birthday
And also run anautomation on the day of the birthday.

So i would need to get the "closesBirthday("person_name"), and closesBirthday("amountOfDaysLeft") basically
There's also edge cases in case there are multiple birthdays on the same date

@perlchamp
Copy link

perlchamp commented Feb 6, 2025

@BebeMischa :
nice. Is there a possibility to highlight an entry if its birthday is today?

for these 'features' I normally use the html-template-card. And this works for me, but...
...how would be the template code of your yaml-code, cause i couldn't figure out, how to sort the list by state as int.

This would work for me, if there is a way to change the state value (string) to int. I didn't find a solution. Is anybody out there who can show me the right way ?

{% set geburtstag_sensoren = alle_sensoren | selectattr('entity_id', 'search', 'geburtstag') | sort(attribute='state', reverse=false) %}

Because state is a string '9' is more than '20' :-(

Many thanks in advance !

@BebeMischa
Copy link

This is what I use:

type: custom:auto-entities
show_empty: false
card:
  title: Er is er een jarig, hoera, hoera, dat kun je wel zien, dat is
  type: glance
  show_name: true
  show_state: false
  show_header_toggle: false
  show_icon: false
sort:
  method: state
  numeric: true
filter:
  include:
    - entity_id: /(birthday|anniversary|holiday)/
      state: "= 0"

@perlchamp
Copy link

Yes i know, need Jinja-solution, but don't want to fill up this thread.
Other possibility to contact?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants