Islamic Prayer Times Notifications (On mobile device and Media Player like Alexa)

I assume that you are trying to use google home speaker. If so, then please deleter the blue print, and reimport it again. As I upadted it for people using google.

From the Music Service you need to choose audio/mp4

Thank you, yes you are correct I’m trying to get the Adhan to play on a Nest Hub Max display

I’m no longer seeing any errors and I successfully get a notification on my mobile device

Only issue I still have is the Adhan does not play - it makes the initial noise and the screen changes as if media is about to play, but no sound from the media player

Here are my settings and the Adhan_Media.mp3 file is located in a folder called ‘www’ which sits in the Config folder

try this address

https://www.islamcan.com/audio/adhan/azan1.mp3
without the quotation marks

Hey! Thanks a lot

This worked perfectly

1 Like

Thank you shadynafie and Taras for your efforts.
I am trying to accomplish this but I am still new to home assistant and I am still learning. I would a blueprint for adthan to play all the five (including Fajr) prayers adthan on alexa echo. Is there an easy way to achieve this? Thank you all in advance for your assistance.

Assalamualaikum, thank you for the blueprint it has been super helpful as my existing solution (Automate Islamic Adhan (also called Azan or Azzan) or other prayer calls) just stopped working for some reason and i havent had time to debug it.

I’m trying to use the following link : Dropbox - Adhaan.mp3 - Simplify your life
however it doesnt seem to play.

If you have remote access to your home assistant with duckdns or other services, you can host your own adthan mp3 and then in your adthan automation list the path for it.

I’ve tried this in the past and its not worked. Do you mind sharing an example of a relative path thats worked for you?

@SuBo . I am assuming you already have alexa configured in your home assistant. If not, you need to have that first setup. The rest is easy and I can share my automation code with you if you would like that.

I’m
Confused I’ve changed the prayer time locations and they are all the same. When I check my local mosque the times aren’t the same some are later and some earlier. I chose custom but that didn’t change anything either am I
Missing something?

Hi, can you please share code that works with Alexa that’s play mp3 which I have link, I don’t need anymobile notifications… I have tried soo many codes which have failed. @raub21
Thanks

Sure. Just make sure you install Alexa in Home Assistant and that is working fine. Second, add the Islamic prayer time integration from the settings<devices and service<add integration. After that, configure the islamic prayer and integration to the calculation method you prefer.
Now, you can go the automation page and paste the following code:

alias: Adthan call through Alexa echo
description: ""
trigger:
  - platform: time
    at: sensor.dhuhr_prayer
    id: dhuhr
  - platform: time
    at: sensor.asr_prayer
    id: Asr
  - platform: time
    id: Maghrib
    at: sensor.maghrib_prayer
  - platform: time
    id: Isha
    at: sensor.isha_prayer
  - platform: time
    id: fajr
    at: sensor.fajr_prayer
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: dhuhr
        sequence:
          - service: notify.family
            data:
              message: حان الآن موعد صلاة الظهر
              title: 🕌 Prayer Time 🕌
          - service: notify.alexa_media
            data:
              message: <audio src='https://yourhomeassistanturl/local/audio/duhradthan.mp3'/>
              target:
                - media_player.kitchen_s_echo_show
                - media_player.master_show
              data:
                type: tts
      - conditions:
          - condition: trigger
            id: Asr
        sequence:
          - service: notify.family
            data:
              message: حان الآن موعد صلاة العصر
              title: 🕌 Prayer Time 🕌
          - service: media_player.volume_set
            data:
              volume_level: 0.7
            target:
              entity_id:
                - media_player.kitchen_show
                - media_player.master_show
          - service: notify.alexa_media
            data:
              message: <audio src='https://yourhomeassistanturl/local/audio/asradthan1.mp3'/>
              target:
                - media_player.kitchen_show
                - media_player.master_show
              data:
                type: tts
      - conditions:
          - condition: trigger
            id: Maghrib
        sequence:
          - service: notify.family
            data:
              message: حان الآن موعد صلاة المغرب
              title: 🕌 Prayer Time 🕌
          - service: notify.alexa_media
            data:
              message: <audio src='https://yourhomeassistanturl/local/audio/maghribadthan.mp3'/>
              target:
                - media_player.kitchen_show
                - media_player.living_room_show
                - media_player.master_show
              data:
                type: tts
      - conditions:
          - condition: trigger
            id: Isha
        sequence:
          - service: notify.family
            data:
              message: حان الآن موعد صلاة العشاء
              title: 🕌 Prayer Time 🕌
          - service: notify.alexa_media
            data:
              message: <audio src='https://yourhomeassistanturl/local/audio/ishaadthan.mp3'/>
              target:
                - media_player.kitchen_show
                - media_player.living_room_show
                - media_player.master_show
              data:
                type: tts
      - conditions:
          - condition: trigger
            id: fajr
        sequence:
          - service: notify.family
            data:
              message: حان الآن موعد صلاة الفجر
              title: 🕌 Prayer Time 🕌
          - service: notify.alexa_media
            data:
              message: <audio src='https://yourhomeassistanturl/local/audio/subhadthan.mp3'/>
              target:
                - media_player.living_room_show
                - media_player.master_show
                - media_player.kids_dot
              data:
                type: tts
mode: single

As added note, I host the adthan mp3 files on HA. So the url https://yourhomeassistanturl has to have the right path for the mp3 files. For instance: Let say the url of your home assistant is: https://nameless900.ga . The adthan file can be stored for example in a directory audio with the following link: https://nameless900.ga/local/audio/adthan.mp3
I hope that was clear and let me know if you need further assistance.

Did you fix the issue? if not, where are you located?

no the times are still off of my local mosque. I am located in vancouver canada

sorry hit wrong thing and double posted

Salam aalikom brother. I think the prayers time will be slightly off or over since every mosque has different times for iqamah. Here is my setup of the islamic prayer integration.
image
And here are the prayers times for the mosque I go to:
image

Here are my prayers times from Home assistant:
image

The only thing I may suggest is to check the Home zone in Home assistant is set to your house location in Vancover or close to it. You can check it that in maps in home assistant. Post back if you need further details.

walaikum salam, I have set my location in HA to where I am located as i was trying to make some person cards as well with location status such as home, work and out.
I have gone through all of the different options for choosing a prayer time location and for me they almost always have 1221, 222, and 441 for dhur, asr, and maghrib.
I found some that were close but yours just seem much closer to the appropriate time. Such as asr is always 35min early for me, dhur always 10min early, maghrib not too bad its only 6 min early.
I think ill choose jafari it seems the least “off”
my mosque times are 607, 1231, 257, 447, and 617.
Jafari lists 619, 1221, 222, 504 and 610.

where do i go from here? scripts? blueprints? never done any of this yet only installed some basic integrations for light switch and bulbs lol. Started tinkering with a custom person card but doesnt work yet. Thank you for your help so far

Yes there will be differences in time according to different calculations. For instance, Asr in my mosque start at 4:15pm since I think they chose to follow the ISNA method of calculation. In Home assistant, I chose the Makkah method of calculation and Asr is 3:31pm for me.
I am new as well to home assistant. I migrated from Smarthings that I started using back in 2016. I like Home assistant better since there are plenty of room to tweak things. I am using zwave, zigbee and wifi devices in my setup. As far, as to scripts and blueprints, it all depends what you want to accomplish. There are many tutorials in this community and in youtube. Just be patient and learn a little bit every day.

ya i figure if its close enough then at least its that rmeinder that its almost time or time. I was using homebridge but like the customization of HA better. So far i only have a few light bulbs, thermostats and light switches all on wifi. No clue what zwave or zigbee is lol will have to look that up as ive seen many people mention zigbee. ive tinkered with getting a tablet set up with a “control panel” for when leaving can quickly see everything we need to.

With this little side of the project i want to try and get the azhan to play on my home pods, google mini, and alexa so its heard in all the rooms. did you try the script posted above and have it working?

For sure, I ve found that HA is way better and more complex as well. Make sure you install Hacs,file editor, samba share and google backup.
The last code posted above is mine and that is working perfect for me with Alexa. Adthan is played at the same time in some chosen amazon devices. I installed and setup Alexa in HA which was a little long process since I did not do it through the HA cloud ( nabu casa). Google Home devices seem easy to configure and play all different medias. There are some tutorials on this community forums how to configure adthan on google devices. The same goes for the Apple devices. On a side note, I would recommend if you can afford it to get sonos.

thanks ill take a look at your code and give it a shot. i havent set up the alex and google home mini yet as i was debating trying to setup remote access without subscription for cloud access havent had time yet. Ill look into sonos but right now funds are a little tight so im using what i got lol. Ill take a look for some of the tutorials and see if i can make it work… might just have it come out the apple homepods if it seems too difficult to run off the 3 different types… thinking id maybe need 3 different scripts set up for it maybe… thanks for the advice ill give it a go this weekend