Athan in Home Assistant using Mawaqit integration (call for prayers)

Assalamo Alaykom brothers,
I would like to share my automation for Athan in Home Assistant.

Pre-requisites:

  • Mawaqit Integration installed and set for your location:
    (details for installation can be found under this link, go to Settings > Devices & Services > Add Integration and search for "Mawaqit
  • Media player device in your network
  • Athan mp3 sound files ==> example link to download mp3 Athan files

Procedure:

  1. install and configure MAWAQIT integration

  2. setup up Mawaquit with your nearest mosque:

  3. create a folder named salat (or any other name) under /config/www/
    there are several methods to create a folder, in my case I use Studio code server Add on for it, my folder is /config/www/salat and in home assistant code the /config/www is replaced by /local/ hence the folder in the code is like this /local/salat/athan.mp3.
    Google serach will help you find the best method based on your HA knowledge.
    To create a new folder in Home Assistant (HA), use the
    File Editor or VS Code add-on to navigate to your /config directory and click the “New Folder” icon. Alternatively, use SSH to run mkdir /config/new_folder_name. Common folders to create include www for custom UI files or custom_components

  4. download and upload the Athan files to the created folder, in my case it is /config/www/salat. you would require at least 2 files:
    A- Fajr Athan
    B- Athan

  5. get the names of the Athan time sensor entities from Mawaqit integration:

    • sensor.fajr_adhan
    • sensor.dhuhr_adhan
    • sensor.asr_adhan
    • sensor.maghrib_adhan
    • sensor.isha_adhan
  6. create an automation go to Settings > Automation > + new Automation
    Screenshot 2026-02-11 at 11.37.24

  7. click on the top right 3 dots and change the edit mode by clicking Edit in YAML

  8. paste the bellow code in the automation code window:
    :warning:

  • check the names of the prayer time sensor entities and compare them to the names of the sensors in the automation code, make sure replace the sensor names in the five lines entity_id with your own environment sensor entities names:

entity_id: sensor.dhuhr_adhan

  • make sure to edit the code to reflect your created Athan folder and Athan file names, it is in this line and repeated for each prayer:

media_content_id: /local/salat/fajr.mp3

  • The offset value is set to -3 seconds, please feel free to adjust it based on your environment setup.

offset: “-00:00:03”

My HA requires 3s between launching the automation and executing the Athan command, hence the -3s offset.

AUTOMATION Code:

alias: My 5 Adan calls
description: "Salat times Athan with custom Athan sound files"
triggers:
  - trigger: time
    at:
      entity_id: sensor.fajr_adhan
      offset: "-00:00:03"
    id: Fajr
  - trigger: time
    at:
      entity_id: sensor.dhuhr_adhan
      offset: "-00:00:03"
    id: dhuhr
  - trigger: time
    at:
      entity_id: sensor.asr_adhan
      offset: "-00:00:03"
    id: asr
  - trigger: time
    at:
      entity_id: sensor.maghrib_adhan
      offset: "-00:00:03"
    id: maghrib
  - trigger: time
    at:
      entity_id: sensor.isha_adhan
      offset: "-00:00:03"
    id: isha
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Fajr
        sequence:
          - action: media_player.play_media
            data:
              extra:
                thumb: /local/salat/athan.png
                title: Athan
              media:
                media_content_id: /local/salat/fajr.mp3
                media_content_type: audio/mp3
                metadata: {}
            target:
              entity_id: media_player.ff_kiosk
      - conditions:
          - condition: trigger
            id:
              - dhuhr
        sequence:
          - action: media_player.play_media
            data:
              extra:
                thumb: /local/salat/athan.png
                title: Athan
              media:
                media_content_id: /local/salat/athan.mp3
                media_content_type: audio/mp3
                metadata: {}
            target:
              entity_id: media_player.ff_kiosk
      - conditions:
          - condition: trigger
            id:
              - asr
        sequence:
          - action: media_player.play_media
            data:
              extra:
                thumb: /local/salat/athan.png
                title: Athan
              media:
                media_content_id:/local/salat/athan.mp3
                media_content_type: audio/mp3
                metadata: {}
            target:
              entity_id: media_player.ff_kiosk
      - conditions:
          - condition: trigger
            id:
              - maghrib
        sequence:
          - action: media_player.play_media
            data:
              extra:
                thumb: /local/salat/athan.png
                title: Athan
              media:
                media_content_id:/local/salat/athan.mp3
                media_content_type: audio/mp3
                metadata: {}
            target:
              entity_id: media_player.ff_kiosk
      - conditions:
          - condition: trigger
            id:
              - isha
        sequence:
          - action: media_player.play_media
            data:
              extra:
                thumb: /local/salat/athan.png
                title: Athan
              media:
                media_content_id: /local/salat/athan.mp3
                media_content_type: audio/mp3
                metadata: {}
            target:
              entity_id: media_player.ff_kiosk
mode: single
  1. if you like the media player to show a Athan picture, download one and save it in the same folder as the Athan files, in my case it is /local/salat/athan.png

  2. save the automation and test it

  3. you can switch to visual mode to modify the automation.

You can also setup different Athans for each prayer by specifying another Athan mp3 file.

I hope this helps you.
Assalamo Alaykom

Wa alaikum salam, this is very good! Thanks for your work.

I am a member of MAWAQIT, team leader of the Home Assistant Team. Would it be possible to have a discussion with you regarding this? If yes, please contact me at [email protected]

Thanks!

Assalamo Alaykom Brother,
I just sent you an email from email23m(at)gmail.com.

Assalamo Alaykom
Abdelhadi

Perhaps this should be moved to “Share your projects”?
Since this is a ready solution, not a question…

Hi Ildar,
fine with me, if the post would be found as easy as in the configuration area.
Kind regards,

Hi!
I moved it to “Share my projects”, imho this is a better place to give people a ready solution.
Of course, you can still discuss the solution with other users & improve it.
(note that the 1st post of yours can be changed if you decide to add any improvements / additions)

thank you Ildar

1 Like