iOS 17.1 push iPhone alarm clock to HA

I set up an automation in iOS that triggers this shortcut always when the clock app is closed.

1 Like

@BenSisko
Why in god’s name do you not provide any info on how you did this automation?
See, OP posted a puzzle and we are all not involved people trying to figure out over MONTHS to interpolate the information OP had simply given to us, what would have saved hours of time. Now people like YOU hitting the comments and you describe exactly what OP already mentioned in his original posting, but you left out any information about the how-to.

I really don’t understand what’s so difficult in explaining stuff to other people. I always do that. And i wonder, what’s going on with the people who just repeat a non-explanatory statement of the original posting without distributing any how-to. It’s beyond my understanding.

@Gekko23 first step is to make sure your shortcut works correctly.

Then, you can create an automation inside shortcuts on the phone, that is triggered when application is closed and you select Clock application. For action, select to call your HA clock shortcut.

That’s it, there is really nothing more to explain on that, besides showing it with screenshots. The fiddly part is to get the shortcut working and most of the thread is on that problem.

My input was only how to trigger the shortcut automatically most convenient (from my point of view) as there were some posts before discussing this issue. So I only posted the idea for the automation as setting it up is really basic, given the shortcut is working. I just realized now that the automation trigger was mentioned in the entry post already.

Hello, I can’t get this working on iOS 18. Does this still work? I don’t get any error, but HA shows there is no data.

I did change the server in the setup, but didn’t touch anything else.

I didn’t have the Home Assistant input boolean helpers set with the same name as in the configuration. All good now.

I just discovered that the iphone shortcut does not fully replace the name of the Home Asisstant Server… In some places it says ā€œThe Loftā€ instead of the initially selected server name.

And what is ā€œOnderdeel uit lijstā€?

First of all - thanks for your write-up! I’ve followed the steps from the original post, combined with @sebkouba comment but there is still some piece missing for me.

I can currently set an alarm in my iPhone. The correct time is then sent to my Home Assistant instance. After that the Helper Alarm toggle gets activated and the time of my first and last alarm (I currently set only one alarm) - gets added to the sensors. ā€œAlarm setā€ is on.

After that my test alarm on my iPhone rings - I stop the alarm but I guess no result gets reported back to HA. I’ve also tested successfully the automatism in HA which should turn on a light in my case.

Does anyone else have an approach, or is this construct running under iOS 18? Many thanks in advance!

@xFuture603 Not sure if I understood correctly, but I think you are expecting too much.
The shortcut gives the alarm times and status (switched on or off) to HA. When the alarm rings on the iPhone and is stopped, there is no interaction with HA.
You have to build an automation in HA which turns on the light at the alarm time and when the alarm switch is on. The only convenience is that the time and the status is synchronized, but if you want something to happen when you stop the alarm, you have to find an additional solution.

Hello, we have been using the transmission for a while now, thank you very much.
Now the following problem has arisen: we have recently added two HA servers to the HA app. The shortcuts are processed by the Iphone and the points server asks which server receives the data. You can then select the appropriate server there. Of course, nobody selects the server at 11.55 pm :slight_smile: .
So the wake-up times are not transmitted.
I had already looked to see if it was possible to select a final server, but I couldn’t find anything.
Does anyone have a tip for solving this problem?

I’m in the same situation: last alarm time is the same as the first alarm time. Looks like it is only reading the first alarm and apply it to both first and last. Did you find a solution for this?

@belikerich, Thank you. with your shortcut, the time is correct. There’s a problem: the shortcut only provides the first alarm time and duplicates it into the first and last times.
Can you help me?

Hi I also want to configure the iPhone alarm sync to HA.

My sensors are due to this config in the configuration.yaml under ā€œsensorā€ folder:

homeassistant:
  allowlist_external_dirs:
    - /config/sensor
    - /config/template

sensor: !include_dir_list sensor
template: !include_dir_list template

How the config from the first post should look in the ā€œsensorā€ or ā€œtemplateā€ folder?

sensor:
  - platform: time_date
    display_options:
      - "time"

template:
  - sensor:
      - name: "Alarm set"
        state: "{{ states('input_boolean.alarm_example') }}"
  - sensor:
      - name: "First alarm"
        state: "{{ state_attr('input_datetime.first_alarm_example', 'timestamp') | timestamp_custom('%H:%M', None) }}"
  - sensor:
      - name: "Last alarm"
        state: "{{ state_attr('input_datetime.last_alarm_example', 'timestamp') | timestamp_custom('%H:%M', None) }}"

I configured under ā€œsensorā€ folder a file ā€œiPhoneTimeDate.yamlā€ with this:

platform: time_date
display_options:
  - "time"

Under ā€œtemplateā€ folder 3 files:

iPhoneAlarmSet.yaml

sensor:

- name: "Alarm set"
  state: "{{ states('input_boolean.alarm_example') }}"

iPhoneFirstAlarm.yaml

sensor:

- name: "First alarm"
  state: "{{ state_attr('input_datetime.first_alarm_example', 'timestamp') | timestamp_custom('%H:%M', local=True, None) }}"

iPhoneLastAlarm.yaml

sensor:

- name: "Last alarm"
  state: "{{ state_attr('input_datetime.last_alarm_example', 'timestamp') | timestamp_custom('%H:%M', local=True, None) }}"

After this I rebootet HA but I can`t see any change in the condition of the sensors after I run the ā€œiOS 17 push iPhone Alarm to HAā€.

At the iPhone during the configuration of the shortcut I only changed the HA-server to my server-entry in the config.

sensor.alarm_set = unknown (althoug after running the shortcut at the iPhone)
sensor.last_alarm = unavailable
sensor.first_alarm = unavailable

Is there any mistake in my config files at ā€œtemplateā€ or ā€œsensorā€ folder or why I can`t see the status of the alarm and also not the time configured at the alarm?

BR
Michael

I just see this in first post.

How these helpers in HA should look like?

For anyone else trying to work out what this actually means and how to achieve it, here’s what I did:

  • Remove the ā€˜Find all alarms’ block at the top of the original shortcut
  • In the search actions bar at the bottom of the screen, add an ā€˜Edit Sleep Alarm’ action at the top of the shortcut
  • In the action underneath which says ā€˜Repeat with each item in Alarms’ (and ā€˜Alarms’ is coloured red, tap alarms, then select clear variable. It will take you back to the action but ā€˜Alarms’ will have disappeared and if you tap the ā€˜Items’ in blue, a list will pop up. From this list select ā€˜Edit Sleep Alarm’.
  • In the top action - ā€˜Skip the next Sleep Alarm’, tap ā€˜Skip’ and change it to ā€˜Toggle’
  • By this point this action should be linked with a little connecting line underneath to the following action 'Repeat with each item in ā€˜Edit Sleep Alarm’.
  • Go back to the search actions bar at the bottom of the screen, add another ā€˜Edit Sleep Alarm’ action to the very top of the shortcut above the action of the same type that you added earlier. This won’t be connected to the following action with a connecting line underneath. That’s ok.
  • Tap Done to save your shortcut. If you have set up all the entities as mentioned at the top of the post, when you next amend your alarm in the sleep schedule then when you leave the clock app it will update. (I don’t change the schedule each day, so I don’t know if it will update when you change the sleep schedule, but I just update the following day’s alarm time, and it does update that.

Hope that helps, enjoy!

1 Like

Thanks for the advice. Does this work only if there is a sleep schedule for all days? I seem to get an error that the shortcut fails to run when the sleep schedule is active only for some of the days of the week.

Hi, same shorcut not work in iOS26. any updates?

Hi, in the step ā€œAdd Alarm to Listā€ you need change ā€œAlarmā€ by chosing detail → Time with Date Format = None and Time Format = short.

This is so frustrating, I can’t get it working. when the alarm is set from 5AM to 12PM, it is sending 12h more, that is, from 17 to 00. I have tried a lot of formats but none of them fixes the problem.

Has anyone found a soution?

Hi, if you are still stuck, I made a shortcut that use multiple alarms with different labels (each label to trigger something for example). You can find it here : Shortcuts
If you still have problem with the formats, follow exactly like here : https://www.youtube.com/watch?v=LV8Zv6hXQRI
Get the right format is really annoying in ios shortcuts…
But I hope it’s helpful :slight_smile: