You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44-41Lines changed: 44 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ This is a HomeAssistant component for tracking birthdays, where the state of eac
17
17
18
18
## Set up
19
19
Set up the component:
20
-
~~~~
20
+
```yaml
21
21
# Example configuration.yaml entry
22
22
birthdays:
23
23
- name: 'Frodo Baggins'
@@ -27,17 +27,41 @@ birthdays:
27
27
- name: Elvis
28
28
date_of_birth: 1935-01-08
29
29
icon: 'mdi:music'
30
-
~~~~
30
+
```
31
+
32
+
You can also add a custom `unique_id` and attributes to each birthday, for instance to add an icon or other metadata.
33
+
```yaml
34
+
- unique_id: bond_james_bond
35
+
name: James Bond
36
+
date_of_birth: 1920-05-25
37
+
icon: 'mdi:pistol'
38
+
attributes:
39
+
occupation: "Agent"
40
+
license_to_kill: "Yes"
41
+
- unique_id: einstein
42
+
name: 'Albert Einstein'
43
+
date_of_birth: 1879-03-14
44
+
icon: 'mdi:lightbulb-on'
45
+
attributes:
46
+
occupation: 'Theoretical physicist'
47
+
iq: 'Genius level'
48
+
sense_of_humor: 'Einsteinian'
49
+
```
31
50
Restart homeassistant
32
51
33
52
## Entities
34
-
All entities are exposed using the format `birthdays.{name}`. Any character that does not fit the pattern `a-z`, `A-Z`, `0-9`, or `_` will be changed. For instance `Frodo Baggins` will get entity_id `frodo_baggins`, and Swedish names like [`Sven-Göran Eriksson`](https://sv.wikipedia.org/wiki/Sven-G%C3%B6ran_Eriksson) will get entity_id `sven_goran_eriksson`.
53
+
All entities that do not have a specified `unique_id` are exposed using the format `birthdays.{name}`. Any character that does not fit the pattern `a-z`, `A-Z`, `0-9`, or `_` will be changed. For instance `Frodo Baggins` will get entity_id `frodo_baggins`, and Swedish names like [`Sven-Göran Eriksson`](https://sv.wikipedia.org/wiki/Sven-G%C3%B6ran_Eriksson) will get entity_id `sven_goran_eriksson`.
54
+
55
+
## Custom attributes
56
+
You can add a unique id and custom attributes to each birthday, for instance to add an icon or other metadata.
57
+
To do this, add a dictionary under the `attributes` key in the configuration (see example above). The dictionary can contain any key-value pairs you want, and will be exposed as attributes on the entity.
58
+
Fetching the attributes can be done using `state_attr` in a template, for instance `{{ state_attr('birthdays.einstein', 'occupation') }}` will return `Theoretical physicist`.
35
59
36
60
## Automation
37
61
All birthdays are updated at midnight, and when a birthday occurs an event is sent on the HA bus that can be used for automations. The event is called `birthday` and contains the data `name` and `age`. Note that there will be two events fired if two persons have the same birthday.
38
62
39
63
Sending a push notification for each birthday (with PushBullet) looks like this:
0 commit comments