Smart Alarm Clock

I am unsure if what I am attempting is achievable. I figure if not, Tom will probably tell me. What I am attempting to achieve is on Fridays, at 21:15, I would like for my automation to set all of my alarms for the following week (Sun-Sat) based on my work schedule that automatically uploads into a single calendar. I have figured out how to set the alarm based on the start_time attribute using:

service: notify.mobile_app_pro23_ultra
data:
  message: command_activity
  data:
    intent_action: android.intent.action.SET_ALARM
    intent_extras: >-
      android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.DAYS:2;:ArrayList<Integer>,android.intent.extra.alarm.HOUR:{{ as_timestamp(as_datetime(state_attr('calendar.test', 'start_time')) - timedelta(hours=1,minutes=45)) | timestamp_custom("%H") }},android.intent.extra.alarm.MINUTES:{{ as_timestamp(as_datetime(state_attr('calendar.test', 'start_time')) - timedelta(hours=1,minutes=45)) | timestamp_custom("%M") }}

This will successfully set my alarm on my phone for the next start time on whichever day I choose. But I want it to set the whole week at the same time.

My automation so far:

description: "Set Alarm for Next Week"
mode: single
trigger:
  - platform: time
    at: "21:15:00"
condition:
  - condition: time
    weekday:
      - fri
action:
  - parallel:
      - if: [#If calendar entry from calendar.test is found on sunday#]
        then:
          - service: notify.mobile_app_pro23_ultra
            data:
              message: command_activity
              data:
                intent_action: android.intent.action.SET_ALARM
                intent_extras: >-
                  android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.DAYS:1;:ArrayList<Integer>,android.intent.extra.alarm.HOUR:{{ as_timestamp(as_datetime(state_attr('calendar.test', 'start_time')) - timedelta(hours=1,minutes=45)) | timestamp_custom("%H") }},android.intent.extra.alarm.MINUTES:{{ as_timestamp(as_datetime(state_attr('calendar.test', 'start_time')) - timedelta(hours=1,minutes=45)) | timestamp_custom("%M") }}

      - if: [#If calendar entry from calendar.test is found on monday#]
        then:
          - service: notify.mobile_app_pro23_ultra
            data:
              message: command_activity
              data:
                intent_action: android.intent.action.SET_ALARM
                intent_extras: >-
                  android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.DAYS:2;:ArrayList<Integer>,android.intent.extra.alarm.HOUR:{{ as_timestamp(as_datetime(state_attr('calendar.test', 'start_time')) - timedelta(hours=1,minutes=45)) | timestamp_custom("%H") }},android.intent.extra.alarm.MINUTES:{{ as_timestamp(as_datetime(state_attr('calendar.test', 'start_time')) - timedelta(hours=1,minutes=45)) | timestamp_custom("%M") }}

All I need is to figure out the triggers for each specific day, and what to change in the service to make it work for that specific day. Obviously once I have Sunday figured out, I can apply the same logic to Mon - Sat.

Thank you in advance!
My reason for this is that I am using Sleep as Android and I want it to tell me when to go to bed dynamically.

Edit: The following is a link to intents.
https://developer.android.com/reference/android/provider/AlarmClock

as i think about this, there are lots and lots of edge cases so i’m not sure how much help you need. but if you just need a start here’s a bare bones start for you:

  - service: calendar.get_events
    metadata: {}
    data:
      start_date_time: >
        {% set next_dow = 0 %}  {% set delta_days = 7 - now().weekday() +
        next_dow %} {{ (now() + timedelta(days = delta_days)).date() | string +
        " 00:00:00" }}
      duration: 
        hours: 24
    target:
      entity_id: calendar.test_calendar
    response_variable: day_events
  - service: input_text.set_value
    metadata: {}
    data:
      value: |
        {% for event in day_events['calendar.test_calendar']['events'] %}
          event: {{ event.summary }}
          start_time: {{ event.start}}
        {% endfor %}
    target:
      entity_id: input_text.test_text

if you put that in an automation it’ll grab the events from the next day of the week (i’ve set in next_dow where monday == 0). if willing to count on your automation always happening on a specific day (you said friday), you can simplify this…

it grabs the calendar elements from that day. can you assume there is only 1? do you need to find the earliest start? i didn’t know what to assume.

if it were me, instead of doing the “if sunday, if monday, if tuesday” i would make a script that does a single day. and then in your automation, loop through and call that script 7 times.

hopefully this helps you get started…

Thanks for response. You are correct in assuming that there is only going to be one entry on the days I am scheduled.

Tried the automation you provided, no text input. I did however create a sensor that will grab the coming events, I just don’t know how to incorporate it.

- trigger:
    - platform: event
      event_type: sudo_work
  sensor:
    - name: sudo_Work
      unique_id: sudo_work
      state: "{{ trigger.event.data.scheduled_events.events | count() }}"
      attributes:
        scheduled_events: "{{ trigger.event.data.scheduled_events }}"
      icon: mdi:calendar
alias: Update Sensor - sudo Work
description: ""
trigger:
  - platform: time_pattern
    minutes: /10
condition: []
action:
  - service: calendar.list_events
    target:
      entity_id: calendar.test
    data:
      duration:
        hours: 72
    response_variable: sudo_work
  - event: sudo_work
    event_data:
      scheduled_events: "{{ sudo_work }}"
mode: single

Outputs:

scheduled_events: 
events:
  - start: '2024-03-09T22:00:00-07:00'
    end: '2024-03-09T23:00:00-07:00'
    summary: Test
    description: Test
  - start: '2024-03-10T23:00:00-06:00'
    end: '2024-03-11T00:00:00-06:00'
    summary: Test
    description: Test

icon: mdi:calendar
friendly_name: sudo_Work

huh… if i follow, you implemented a sensor that, every time the calendar is updated, it pulls all the events from the calendar and shoves it into an array of events in the sensor.

why? why not get_events from the calendar when you need it? if you have a month or year long calendar, that’s quite overkill. also in your sensor it’s not easy (that i can see) how you would query for a specific day to ask “is there an event on this day”. whereas with get_events you can (as i did in my script).

i’m really not sure how you can readily achieve what you want using your sensor without a lot of complexity. someone else smarter than me likely can.

wrt using my code, you did replace all of my test_calendar, test_text etc with valid entries of your own, right? and also make sure that there’s an event on the next_dow that i put in therer as a sample, right?

I changed the calendar name in the code from yours. I may be missing the step on making sure there is an event on the next_dow. How would I go about that. Also, I bet I can change list to get and get something better out of mine. I’ll let you know in a min. Still willing to use yours just not sure what you mean.

Update: Same output when I use get as when I use list

Edit: I may have figured out what you were suggesting. Will update.

Okay, possibly cooking now. I’ll see what I can do with this. Thank you.

cool. holler if i can help. if you get it all working, please share the code if you don’t mind. i’m curious…

I really hate doing scripts, I haven’t found anything that I can do in a script without being able to just put it in the automation.
The following is how I got it to work.

alias: Update - input_text - sudo - Work Alarms
description: ""
trigger:
  - platform: time_pattern
    minutes: /10
    enabled: false
condition: []
action:
  - service: calendar.get_events
    metadata: {}
    data:
      start_date_time: >
        {% set next_dow = 0 %}  {% set delta_days = 6 - now().weekday() +
        next_dow %} {{ (now() + timedelta(days = delta_days)).date() | string +
        " 00:00:00" }}
      duration:
        hours: 24
    target:
      entity_id: calendar.w2w_schedule
    response_variable: day_events
  - service: input_text.set_value
    metadata: {}
    data:
      value: |
        {% for event in day_events['calendar.w2w_schedule']['events'] %}
          {{ event.start }}
        {% endfor %}
    target:
      entity_id: input_text.sudo_work_sunday
  - service: calendar.get_events
    metadata: {}
    data:
      start_date_time: >
        {% set next_dow = 1 %}  {% set delta_days = 6 - now().weekday() +
        next_dow %} {{ (now() + timedelta(days = delta_days)).date() | string +
        " 00:00:00" }}
      duration:
        hours: 24
    target:
      entity_id: calendar.w2w_schedule
    response_variable: day_events
  - service: input_text.set_value
    metadata: {}
    data:
      value: |
        {% for event in day_events['calendar.w2w_schedule']['events'] %}
          {{ event.start }}
        {% endfor %}
    target:
      entity_id: input_text.sudo_work_monday
  - service: calendar.get_events
    metadata: {}
    data:
      start_date_time: >
        {% set next_dow = 2 %}  {% set delta_days = 6 - now().weekday() +
        next_dow %} {{ (now() + timedelta(days = delta_days)).date() | string +
        " 00:00:00" }}
      duration:
        hours: 24
    target:
      entity_id: calendar.w2w_schedule
    response_variable: day_events
  - service: input_text.set_value
    metadata: {}
    data:
      value: |
        {% for event in day_events['calendar.w2w_schedule']['events'] %}
          {{ event.start }}
        {% endfor %}
    target:
      entity_id: input_text.sudo_work_tuesday
  - service: calendar.get_events
    metadata: {}
    data:
      start_date_time: >
        {% set next_dow = 3 %}  {% set delta_days = 6 - now().weekday() +
        next_dow %} {{ (now() + timedelta(days = delta_days)).date() | string +
        " 00:00:00" }}
      duration:
        hours: 24
    target:
      entity_id: calendar.w2w_schedule
    response_variable: day_events
  - service: input_text.set_value
    metadata: {}
    data:
      value: |
        {% for event in day_events['calendar.w2w_schedule']['events'] %}
          {{ event.start }}
        {% endfor %}
    target:
      entity_id: input_text.sudo_work_wednesday
  - service: calendar.get_events
    metadata: {}
    data:
      start_date_time: >
        {% set next_dow = 4 %}  {% set delta_days = 6 - now().weekday() +
        next_dow %} {{ (now() + timedelta(days = delta_days)).date() | string +
        " 00:00:00" }}
      duration:
        hours: 24
    target:
      entity_id: calendar.w2w_schedule
    response_variable: day_events
  - service: input_text.set_value
    metadata: {}
    data:
      value: |
        {% for event in day_events['calendar.w2w_schedule']['events'] %}
          {{ event.start }}
        {% endfor %}
    target:
      entity_id: input_text.sudo_work_thursday
  - service: calendar.get_events
    metadata: {}
    data:
      start_date_time: >
        {% set next_dow = 5 %}  {% set delta_days = 6 - now().weekday() +
        next_dow %} {{ (now() + timedelta(days = delta_days)).date() | string +
        " 00:00:00" }}
      duration:
        hours: 24
    target:
      entity_id: calendar.w2w_schedule
    response_variable: day_events
  - service: input_text.set_value
    metadata: {}
    data:
      value: |
        {% for event in day_events['calendar.w2w_schedule']['events'] %}
          {{ event.start }}
        {% endfor %}
    target:
      entity_id: input_text.sudo_work_friday
  - service: calendar.get_events
    metadata: {}
    data:
      start_date_time: >
        {% set next_dow = 6 %}  {% set delta_days = 6 - now().weekday() +
        next_dow %} {{ (now() + timedelta(days = delta_days)).date() | string +
        " 00:00:00" }}
      duration:
        hours: 24
    target:
      entity_id: calendar.w2w_schedule
    response_variable: day_events
  - service: input_text.set_value
    metadata: {}
    data:
      value: |
        {% for event in day_events['calendar.w2w_schedule']['events'] %}
          {{ event.start }}
        {% endfor %}
    target:
      entity_id: input_text.sudo_work_saturday
  - parallel:
      - service: notify.mobile_app_pro23_ultra
        data:
          message: command_activity
          data:
            intent_action: android.intent.action.SET_ALARM
            intent_extras: >-
              {% set messagetext = message | default('Sunday Wake Up') %}
              android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.MESSAGE:{{
              messagetext
              }},android.intent.extra.alarm.DAYS:1:ArrayList<Integer>,android.intent.extra.alarm.HOUR:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_sunday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%H", true)
              }},android.intent.extra.alarm.MINUTES:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_sunday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%M", true) }}
      - service: notify.mobile_app_pro23_ultra
        data:
          message: command_activity
          data:
            intent_action: android.intent.action.SET_ALARM
            intent_extras: >-
              {% set messagetext = message | default('Monday Wake Up') %}
              android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.MESSAGE:{{
              messagetext
              }},android.intent.extra.alarm.DAYS:2:ArrayList<Integer>,android.intent.extra.alarm.HOUR:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_monday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%H", true)
              }},android.intent.extra.alarm.MINUTES:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_monday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%M", true) }}
      - service: notify.mobile_app_pro23_ultra
        data:
          message: command_activity
          data:
            intent_action: android.intent.action.SET_ALARM
            intent_extras: >-
              {% set messagetext = message | default('Tuesday Wake Up') %}
              android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.MESSAGE:{{
              messagetext
              }},android.intent.extra.alarm.DAYS:3:ArrayList<Integer>,android.intent.extra.alarm.HOUR:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_tuesday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%H", true)
              }},android.intent.extra.alarm.MINUTES:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_tuesday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%M", true) }}
      - service: notify.mobile_app_pro23_ultra
        data:
          message: command_activity
          data:
            intent_action: android.intent.action.SET_ALARM
            intent_extras: >-
              {% set messagetext = message | default('Wednesday Wake Up') %}
              android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.MESSAGE:{{
              messagetext
              }},android.intent.extra.alarm.DAYS:4:ArrayList<Integer>,android.intent.extra.alarm.HOUR:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_wednesday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%H", true)
              }},android.intent.extra.alarm.MINUTES:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_wednesday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%M", true) }}
      - service: notify.mobile_app_pro23_ultra
        data:
          message: command_activity
          data:
            intent_action: android.intent.action.SET_ALARM
            intent_extras: >-
              {% set messagetext = message | default('Thursday Wake Up') %}
              android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.MESSAGE:{{
              messagetext
              }},android.intent.extra.alarm.DAYS:5:ArrayList<Integer>,android.intent.extra.alarm.HOUR:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_thursday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%H", true)
              }},android.intent.extra.alarm.MINUTES:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_thursday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%M", true) }}
      - service: notify.mobile_app_pro23_ultra
        data:
          message: command_activity
          data:
            intent_action: android.intent.action.SET_ALARM
            intent_extras: >-
              {% set messagetext = message | default('Friday Wake Up') %}
              android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.MESSAGE:{{
              messagetext
              }},android.intent.extra.alarm.DAYS:6:ArrayList<Integer>,android.intent.extra.alarm.HOUR:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_friday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%H", true)
              }},android.intent.extra.alarm.MINUTES:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_friday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%M", true) }}
      - service: notify.mobile_app_pro23_ultra
        data:
          message: command_activity
          data:
            intent_action: android.intent.action.SET_ALARM
            intent_extras: >-
              {% set messagetext = message | default('Saturday Wake Up') %}
              android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.MESSAGE:{{
              messagetext
              }},android.intent.extra.alarm.DAYS:7:ArrayList<Integer>,android.intent.extra.alarm.HOUR:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_saturday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%H", true)
              }},android.intent.extra.alarm.MINUTES:{{
              as_timestamp(as_datetime(states.input_text.sudo_work_saturday.state)
              - timedelta(hours=1,minutes=45)) | timestamp_custom("%M", true) }}
mode: single

I have one kink to work out though, how to delete alarms. I have tried to dismiss as per Set Android alarm clock from Home Assistant - #90 by zynth, but this just opens the Samsung Clock. I’d like to be able to delete alarms in my automation because my schedule can change and this way would allow for that. I am using Sleep As Android.

i see some of my code in there too :slight_smile:

i love scripts… most of my automation calls scripts and i reuse scripts in many automations… but to each their own…

something for you to consider to make your code tighter and easier to enhance…

repeat:
  count: 7
  sequence:
    - service: calendar.get_events
      metadata: {}
      data:
        start_date_time: .... {{ repeat.index }}....
        duration:
          hours: 24
      target:
        entity_id: calendar.w2w_schedule      
  

obviously pseudocode… but you can collapse it all into one loop that goes 7 times. each time {{ repeat.index }} will have the count of the iteration (but it’s 1 based, not 0.)

details here: Script Syntax - Home Assistant

if you do that to make it easier on yourself you might then change input_text.sudo_work_tuesday
to be input_text.sudo_work_2
so that you can do input_text.sudo_work_{{ repeat.index }}
etc…

i like having my code tight… :slight_smile:

Bro, I hate to ask this, but can you help me with 2 things?
A. How would I go about modifying the code to run each day and still get the correct input_text? I have a part of the automation clear all alarms so that it can set them again. I realized my schedule can change occasionally and I suck at time code.
B. Explain the repeat.index a little more? I have been trying to make sense of it in the docs, but am completely lost on how it works.

sure happy to help if i can…
for thing A, need more info from you. before you said you wanted it to run every friday and pull the whole next week. are you saying you want it to run every day, not just friday? and if so, what do you want it to load? like on tuesday, do you want it to load wednesday thru next tuesday? then wednesday run for thursday through next wednesday? if you’re going to run it every day, why not just lead the alarms for the next 1 day? i’m a little confused as to what exactly you want (and maybe explain why… there might be a better solution to achieve what you’re after).

for thing B, repeat.index

in your code, you did something for sunday, then you copied everything and just changed monday. then you copied again, and changed just tuesday. whenever you copy and paste code over and over and just change a couple things, it’s almost always better to do it one time and loop through.

if you do the repeat loop like i did above, a variable is created that you can use as repeat.index it will be 1 the first time through the loop. then 2, then 3…

so in the code where you hardcoded {% set next_dow = 2 %}, then change it to 3, then 4, you could replace the 2 with repeat.index

you’d also have to do something similar for input_text.sudo_work_{{ day of the week}}

A. You hit the nail on the head. It seems a little weird, but the reason for setting the whole week is so I can open the alarm app (by just tapping my clock in Niagara Launcher) and easily plan out my week based on when my alarm to get ready for work goes of. i.e. if I work a close shift, I’ll have time to do errands or something beforehand.
B. I think I understand. I’ll play with it a bit.

ok, so for A. you want the next 7 days? not next week’s 7 days?

Yes. The following 7 days. I was trying to goof around with now().isoweekday() but kept running into walls.

ok, i’ve converted it over to do the next 7 days and i’ve also converted it to use repeat. take a look at how massively simplified it is by using repeat… you had about 260 lines of code. it’s now 60 lines.

alias: Update - input_text - sudo - Work Alarms
description: ""
trigger:
  - platform: time_pattern
    minutes: /10
    enabled: false
condition: []
action:
  - repeat:
      count: 7
      sequence:
        - variables:
            delta_days: |
              {{ repeat.index }}
            target_date: |
              {{ (now() + timedelta(days = delta_days)).date() }}
            target_datetime: |
              {{ target_date + " 00:00:00" }}
            target_dow_name: >
              {{ as_timestamp(strptime(target_date, '%Y-%m-%d')) |
              timestamp_custom('%A') | lower }}  
        - service: calendar.get_events
          metadata: {}
          data:
            start_date_time: |
              {{ target_datetime }}
            duration:
              hours: 24
          target:
            entity_id: calendar.w2w_schedule
          response_variable: day_events
        - if:
            - condition: template
              value_template: "{{ day_events | length > 0 }}"
          then:
            - service: input_text.set_value
              metadata: {}
              data:
                value: >
                  {% for event in day_events['calendar.w2w_schedule']['events']
                  %}
                    {{ event.start }}
                  {% endfor %}
              target:
                entity_id: |
                  input_text.sudo_work_{{ target_dow_name }}
            - service: notify.mobile_app_pro23_ultra
              data:
                message: command_activity
                data:
                  intent_action: android.intent.action.SET_ALARM
                  intent_extras: >-
                    {% set messagetext = message | default(target_dow_name + '
                    Wake Up') %} 
                    {% set input_state_name =
                       states('input_text.sudo_work_' + target_dow_name)
                    %}
                    android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.MESSAGE:{{
                    messagetext
                    }},android.intent.extra.alarm.DAYS:{{ delta_days }}:ArrayList<Integer>,android.intent.extra.alarm.HOUR:{{
                    as_timestamp(as_datetime(input_state_name) -
                    timedelta(hours=1,minutes=45)) | timestamp_custom("%H",
                    true) }},android.intent.extra.alarm.MINUTES:{{
                    as_timestamp(as_datetime(input_state_name) -
                    timedelta(hours=1,minutes=45)) | timestamp_custom("%M",
                    true) }}
1 Like

here’s a version without the input_text

alias: Update - input_text - sudo - Work Alarms
description: ""
trigger:
  - platform: time_pattern
    hours: "21"
    enabled: false
condition: []
action:
  - repeat:
      count: 7
      sequence:
        - variables:
            delta_days: |
              {{ repeat.index }}
            target_date: |
              {{ (now() + timedelta(days = delta_days)).date() }}
            target_dow_ordinal: >
              {{ (now() + timedelta(days = delta_days)).date().isoweekday() +1 }}
            target_datetime: |
              {{ target_date + " 00:00:00" }}
            target_dow_name: >
              {{ as_timestamp(strptime(target_date, '%Y-%m-%d')) |
              timestamp_custom('%A') | lower }}  
        - service: calendar.get_events
          metadata: {}
          data:
            start_date_time: |
              {{ target_datetime }}
            duration:
              hours: 24
          target:
            entity_id: calendar.w2w_schedule
          response_variable: day_events
        - if:
            - condition: template
              value_template: "{{ day_events['calendar.w2w_schedule']['events'] | length > 0 }}"
          then:
            - variables:
                sudo_work: >
                  {% for event in day_events['calendar.w2w_schedule']['events']
                  %}
                      {{ event.start }}
                  {% endfor %}
            - service: notify.mobile_app_pro23_ultra
              data:
                message: command_activity
                data:
                  intent_action: android.intent.action.SET_ALARM
                  intent_extras: >-
                    {% set messagetext = message | default(target_dow_name + '
                    Wake Up') %} 
                    android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.MESSAGE:{{
                    messagetext }},android.intent.extra.alarm.DAYS:{{ target_dow_ordinal
                    }}:ArrayList<Integer>,android.intent.extra.alarm.HOUR:{{
                    as_timestamp(as_datetime(sudo_work) -
                    timedelta(hours=1,minutes=45)) | timestamp_custom("%H",
                    true) }},android.intent.extra.alarm.MINUTES:{{
                    as_timestamp(as_datetime(sudo_work) -
                    timedelta(hours=1,minutes=45)) | timestamp_custom("%M",
                    true) }}
1 Like