When exactly was that birthday, and how old will the person be? With Home Assistant and a small integration, it is no problem to automate this.
There are several ways to do this.
You can use the integration with Google Calendar, but the downside here is that it does not enter how old the person is.
An integration called “Anniversary” has been created which works very well for this purpose. Not only do you get the person’s age, but it’s relatively easy to create an automation that sends you a push message on the person’s birthday.
First, you need to install the “Anniversary” integration. There are two ways to do this. Either manually, or via HACS.
Would recommend installing it via HACS. Search for the integration and select install – afterward, the Home Assistant server must be restarted.
If you would rather install it manually, you can find the information here: https://github.com/amaximus/anniversary
To add a new birthday, go to Configuration -> Integration and select “+ add integration”. Search for “anniversaries” and click on it.
Fill out the form that appears
For each birthday you enter, the integration creates a sensor (sensor.anniversary_ *)
Each sensor will contain one set of attributes that can be used in, among other things, automation.
To get a notification on your mobile when someone has a birthday, we set up the following automation.
It triggers every day at 08.15, then it checks if anyone has a birthday.
We have a condition that says that one of the sensors must have a value of 0 to proceed. If it has a value of 0, then the person has a birthday today.
Furthermore, we add a small template in the message on the mobile that brings up the person who has a birthday, and the age of the person.
Wola – never forget a birthday again.
alias: Birthday
description: ''
trigger:
- platform: time
at: '08:15'
condition:
- condition: or
conditions:
- condition: state
entity_id: sensor.anniversary_person2
state: '0'
- condition: state
entity_id: sensor.anniversary_person1
state: '0'
- condition: state
entity_id: sensor.anniversary_test
state: '0'
action:
- service: notify.mobile_app_lars_sin_iphone_11
data:
message: >-
{% set count = namespace(value=0) %} WOHO! {%- for state in
states.sensor -%} {%- if state.attributes.attribution == "Sensor data
calculated by Anniversaries Integration" and state.state | int <= 0 -%}
{%- if count.value != 0 %},{% endif %}
{{state.attributes.friendly_name}} becomes
{{state.attributes.years_at_next_anniversary -1}} years today {%- set
count.value = count.value + 1 -%} {%- endif -%} {%- endfor %}
title: Birthday
mode: single