I set up an automation in iOS that triggers this shortcut always when the clock app is closed.
@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
.
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!
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 ![]()