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: to show how old person is. #152

Open
tevas007 opened this issue Nov 2, 2023 · 7 comments
Open

Feature request: to show how old person is. #152

tevas007 opened this issue Nov 2, 2023 · 7 comments

Comments

@tevas007
Copy link

tevas007 commented Nov 2, 2023

Just featurerequest,, if possible: an option to show how old person is, if date format YYYY-MM-DD is used.

@tevas007 tevas007 changed the title Future request: to show how old person is. Feature request: to show how old person is. Nov 2, 2023
@JeffCrum1
Copy link

No idea what this 'feature request' is since there is already an attribute, current_years, that has that information.

What am I missing?

In Developer Tools | Template, put:

{{ state_attr('sensor.anniversary_jeff_bday', 'current_years') }}

@tevas007
Copy link
Author

tevas007 commented Nov 8, 2023 via email

@tevas007
Copy link
Author

tevas007 commented Nov 8, 2023 via email

@bt-beardedtechie
Copy link

Hi can you tell me how you accomplished this in UI? I'm unable to show in my calendar or in my atomic calendar card on my dashboard.

@BebeMischa
Copy link

using two HACS delivered cards - auto-entities and multiple-entity-row

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

I get this:

image

Of course you can ignore the exclude, I'm using anniversaries also for countdowns on my concerts visits :-)

@bt-beardedtechie
Copy link

I'll check this out.

I am trying to add this to my atomic calendar card. Would the same steps work for that as well?

@JeffCrum1
Copy link

JeffCrum1 commented Nov 16, 2024

I have no idea about the atomic calendar card. But, similar to @BebeMischa I do get these into a list in a card.

But I use a custom flex-table-card like this:

I name my anniversaries entries as ...
[name] BDay
So, I remove BDay from the output as you can see in the Name column using the modify.

type: custom:flex-table-card
title: Birthdays
entities:
  include: sensor.anniversary_*bday
sort_by: friendly_name+
css:
  tbody tr+: "user-select: text"
columns:
  - name: Name
    data: friendly_name
    modify: x.replace(' BDay', '')
  - name: Birthdate
    data: date
    modify: >-
      var date = new Date(x); const months = ['January ','February ','March
      ','April ','May ','June ','July ','August ','September ','October
      ','November ','December ']; months[date.getMonth()] +
      String(date.getDate())
  - name: Age
    data: current_years
    align: right
  - name: Days
    data: state
    align: right

And it looks like
image

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