This setup uses Homebridge and IFTTT to announce the prayer calls on my HomePods. In IFTTT, the Muslim Pro service provides the prayer-time trigger. The Webhooks service then calls a button exposed by Homebridge's Programmable HTTP Switch plugin. Pressing that virtual button runs a HomeKit scene that plays the Athan on the selected HomePods.
For the webhook to reach Homebridge, it needs an externally accessible address. You can use your public IP address with port forwarding on your router, although that setup is not covered here. In my case, I already had dynamic DNS configured and used a reverse proxy to direct traffic to my domain name.
Download and install Homebridge for your platform from https://homebridge.io. I run it on my Synology NAS. Once it is installed, the Homebridge interface should be available at http://localhost:8581/.
Open the Plugins page, search for “Programmable HTTP Switch,” and install it.
For the Fajr button in my setup, I used the following values:
Accessory: fajr
Accessory identifier: fajr
Button name: fajr
Button identifier: fajr
Supported actions: leave only singlePress enabled
Port: 3001
The default port was already in use by another service on my network, so I changed it to 3001. You can keep the default if it is available in your environment.
I added five buttons, one for each prayer time. Save the configuration, restart Homebridge, and then add the bridge to Apple Home by scanning the QR code on the Homebridge Status page.
In the Apple Home app, create a custom scene for each prayer call. Add the HomePods you want to use, configure the media action to play audio, and choose the Athan you want from Apple Music.
Find the corresponding HTTP switch in Apple Home. For the Fajr switch, configure the single-press action to run the Fajr scene you just created. Repeat the same pattern for the remaining prayer times.
On my Mac, I tested the Fajr button from Terminal with this request:
curl -i -X PUT -H 'Content-Type: application/json' -d '{"action": "singlePress"}' https://MY_URL/accessories/fajr/buttons/fajr
Replace MY_URL with the address that routes to your Homebridge HTTP switch. If the request is working, it should press the virtual button and run the HomeKit scene.
In IFTTT, create an applet and use the Muslim prayer-time service for the If This trigger. Configure the prayer time to suit your needs.
For Then That, select Webhooks and use the following settings:
URL: https://MY_URL/accessories/fajr/buttons/fajr
Method: PUT
Content type: application/json
Additional headers: leave blank
Use this request body:
{ "action": "singlePress" }
I created five applets, one for each prayer time. Each applet points to its matching button in the Homebridge HTTP switch plugin. Keeping the prayer calls separate also lets me choose a different Athan for each one, which is admittedly a little fancy.