Miicroo/ha-birthdays

How to trigger automation

ranrinc opened this issue · 2 comments

Hi there,

Is there away to trigger birthday wishes via google home on specific time (for example at 7'oclock in the morning) rather then after midnight?

and add RIP symbol next to the name of bday if he or she have been pass away?

Something like this would probably work:

some_id:
  trigger:
    - platform: time
      at: "07:00:00"
  sequence:
    - service: tts.google_translate_say
      entity_id: media_player.some_player
      data_template:
        message: >
          {% for state in states.birthdays -%}
            {% if state.state == "0" -%}
              Today it's {{ state.name }} {{ state_attr(state.entity_id, "age_at_next_birthday")  }} birthday.
            {%- endif %}
          {%- endfor %}

(Cant get a code-block to work... but I think you can figure out how to use it :) )

@ranrinc I agree with @rirofal s solution, the best solution is to utilize HomeAssistant's time-platform for time based triggers! 👍 (also updated the code example in his comment with 3 front-ticks to fix the code block)