alias: "Awtrix: Birthday"
description: ""
triggers:
  - trigger: time_pattern
    hours: "1"
conditions: []
actions:
  - choose:
      - conditions:
          - alias: Someone's birthday?
            condition: template
            value_template: |-
              {% set today = now().date() | string %}
              {% set next = state_attr('calendar.verjaardagen', 'start_time') %}
              {{ today in next }}
        sequence:
          - action: mqtt.publish
            metadata: {}
            data:
              evaluate_payload: false
              qos: 0
              retain: true
              topic: awtrix_0afcb4/custom/birthday
              payload: |-
                {
                  "text": "{{ state_attr('calendar.verjaardagen', 'message') }}",
                  "icon": 46314,
                  "repeat": 1
                }
            alias: Publish app
    default:
      - alias: Remove app
        action: mqtt.publish
        metadata: {}
        data:
          evaluate_payload: false
          qos: 0
          retain: false
          topic: awtrix_0afcb4/custom/birthday
mode: single