From 8e4051b5aee852b6c968930c24503f8c8402b0bb Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Tue, 7 Feb 2023 23:21:21 -0500 Subject: [PATCH] Add sensor for if there is a birthday today --- sensors/house_stats.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sensors/house_stats.yaml b/sensors/house_stats.yaml index 438eb24..28ce82b 100644 --- a/sensors/house_stats.yaml +++ b/sensors/house_stats.yaml @@ -158,6 +158,29 @@ {% else %} {{ state_attr('light.front_porch_light','color_temp') | int }} {% endif %} + birthdays_today: + friendly_name: Birthdays Today + value_template: > + {% set birthdays = [ + states.sensor.anniversary_tony_s_birthday, + states.sensor.anniversary_tina_s_birthday, + states.sensor.anniversary_kallen_s_birthday, + states.sensor.anniversary_emmalynn_s_birthday + ] %} + {{ birthdays | selectattr('state','eq','0') | list | count | int }} + icon_template: > + {% set birthdays = [ + states.sensor.anniversary_tony_s_birthday, + states.sensor.anniversary_tina_s_birthday, + states.sensor.anniversary_kallen_s_birthday, + states.sensor.anniversary_emmalynn_s_birthday + ] %} + {% set status = birthdays | selectattr('state','eq','0') | list | count | int %} + {% if status > 0 %} + mdi:cake + {% else %} + mdi:eye + {% endif %} - platform: history_stats name: Basement TV Time