On setting prayer times to spur action
I’ve been wondering why prayer apps have never worked for me. After the last three days, I think I’ve found the problem. They send the notification at the exact prayer time, which leaves no room for a proper change of state.
If I’m in the middle of a task, a notification that says it’s time for prayer assumes I can drop everything immediately. Sometimes I can. Often it’s difficult. The reminder is accurate, but it doesn’t help me get from one thing to the next.
I decided to give myself a 15-minute warning instead. I used Google Calendar and AlAdhan’s Prayer Times API to create the warning ahead of each prayer, then connected it to my phone through Home Assistant so the times could always be in sync with my location.
TL;DR: the reminder is a handoff, not a timestamp
- Ask AlAdhan for prayer times using the phone’s current coordinates.
- Keep a rolling set of future prayer events in Google Calendar with a 15-minute reminder.
- Let Home Assistant keep the location and next-prayer data in sync.
- Treat the preparation alert and the exact-time alert as separate jobs when the phone’s calendar sync drops one of them.

The first problem I faced was realising that Apple Calendar wasn’t registering the “time of event” notification, so I decided to compare the two displays.
When Google Calendar shows the alert, I see the start and end time, the duration, and the fact that the alert has fired. It reports the event, but it isn’t forward-facing to spur me to action, which is the point of this set-up. I still have to work out how much time remains before the prayer begins.
On the other hand, Apple Calendar shows a countdown to the event. When the 15-minute reminder arrives, I can see the remaining time instead of doing the calculation myself. That makes the warning much easier to process. I know how long I have to finish the task in front of me and when I need to be ready, or step away.
The underlying information is the same, but it was interesting to see the different product choices here, especially one that’s this subtle.
The updater keeps a rolling 20-day window in Google Calendar. Every six hours, a scheduled run reads the latest location, requests the dates it needs, and reconciles the events that belong to the updater.
Home Assistant’s Companion app provides the iPhone’s location, so I connected the phone to Home Assistant and used the latitude and longitude from the latest GPS report as the input for the prayer-time calculation. The server runs Home Assistant in Docker on my VPS, and a Cloudflare Tunnel gives the phone a stable HTTPS route to it without relying on a private Tailscale address.
I’d initially wanted to use Tailscale, but each time I put it off, Home Assistant stopped working, and that meant the updater would also be down. And I don’t want Tailscale perpetually on on my phone because VPN sometimes affects network performance. There was a time I thought I had exhausted my data subscription but turned out I only had to switch off Tailscale.
Anyways, the updater asks AlAdhan for the timezone and prayer times for those coordinates. I use the Muslim World League calculation method, which AlAdhan identifies as method 3. And because the timezone comes back from the location request, the setup doesn’t depend on the server’s timezone or on a city I selected months ago.
My first instinct was to delete the prayer events, but a prayer that has already happened is still useful calendar history, so refreshing my location shouldn’t trigger a cleanup job or touch an unrelated event just because it shares the same calendar.
Each managed event has a date, a prayer name, and a private marker that identifies it as part of this schedule. On the next run, the updater changes a matching future event in place and creates any missing ones. It leaves past events alone, and it leaves other reminders alone too. I have a walking reminder, for example, which has nothing to do with prayer times and stays separate.
That gives me 100 events in the working window — 20 days multiplied by five daily prayers — without making every refresh look like a new calendar import. The updater also writes the next prayer to a small JSON file, which Home Assistant exposes as a sensor.
The sensor gives the phone one simple value to read. A future widget or Live Activity would not need to understand the full calendar and API setup.

The past three days have been very different. I’ve gone from simply getting alerts and having to rush or feel guilty for being unable to immediately leave what I was doing to properly planning for prayers. A positive out of Apple only reflecting the 15-minute alert is that I recognise the 15-minute alert as the change period, and not just some noise. In a team setting, I should start giving a heads-up about being away and avoid starting something new when I know I have to pray in 15 minutes. Even mentally checking out of the current task has made it much easier to switch & improve my praying time.
It’s still early days, but I’m now looking for ways to automatically display morning and event Dhikr on my laptop screen since that’s where I am most of the day. Maybe there’s even a Chrome extension for this. We’ll see. Else, I may have to build this, too.