Skip to content

🕋 Automation for Malaysia Adzan (Muslim call to prayer) based on JAKIM API.

License

Notifications You must be signed in to change notification settings

raub21/HomeAssistantAdzan

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Assistant Adzan
visitors Donate

Automation for Malaysia Adzan (Muslim call to prayer) based on the following sources:

  • JAKIM Official (eSolat) - Website.
  • AzanPro - Website.
  • Local - locally stored prayer time yearly data in Home Assistant

Whats New in v3.0

  • Source and location can be entered using input text and input select.
  • Easily change sources if one failed (i.e. Timeout)
  • Solat data can be stored locally and use as source.
  • Added Persistent Notification as default notification.

You may also try GPS Based Solat sensor. (API provided by MPT)

Screenshot

image

image

Video Tutorial

Youtube

Installation

  • Copy the lines into your configuration.yaml.
  • It will enable/create the following:
    1. Downloader
    2. Input Select (for source selection)
    3. Input Text (for state/location code
    4. Load solat sensors
  • Copy esolat.yaml into /config. DO NOT ALTER THIS FILE
  • Reboot your Home Assistant to take effect.
  • Once rebooted, perform the following:
    1. Enter your location code input_text.solat based on location/zone list
    2. Enter your Home Assistant URL in input_text.homeurl
    3. Select source (eSolat/AzanPro/Local)

eSolat
https://www.e-solat.gov.my/index.php?siteId=24&pageId=50

AzanPro
https://api.azanpro.com/zones

Copy the automations into your current automations.yaml

  • Azan 3.0
  • Azan 3.0 Yearly Update
    (you need to run it once for the initial setup. It will save a esolat.json file into your /www/ path)

image

Adzan:
It is highly recommended to use speaker group (via Home Assistant) or from your Alexa or Google Home App.
Example use in this automation is all_devices media_player.all_devices

Random verse:
You may add/remove audio files depending on your preferences.
You can also use URL by changing the media-source://media_source/local/audio/xxx.mp3

  - service: media_player.play_media
    data:
      media_content_type: audio/mp3
      media_content_id: |
        {{ ["media-source://media_source/local/audio/surah1.mp3",
            "media-source://media_source/local/audio/surah2.mp3",
            "media-source://media_source/local/audio/surah3.mp3",
            "media-source://media_source/local/audio/surah4.mp3",
            ] | random }}

2(a). automation_alexa.yaml -- For Alexa Devices

  • IMPORTANT: Please ensure Alexa_Media_Player addon has been configured.
  • Audio files must be placed at /config/www/audio
  • Due to Alexa restriction, it will only work on Home Assistant with SSL (HTTPS) -- tested to work on Cloudflare SSL
  • Alexa Documentation

Audio requirements:

  • Bit rate: 48kbps
  • Sample rate: 22050Hz, 24000Hz, or 16000Hz
  • Duration: Cannot exceed 4min (240sec)

2(b). Raspberry Pi Audio

  • Ensure VLC is installed. For HA hosted in a RaspberryPi, you may use Local-VLC addon.
  • Ensure official VLC Media Player integration is configured.
  • IMPORTANT: All audio files must be stored in /share/audio

Add new entities card on your dashboard and paste the YAML codes.

image

MP3 Audio Files

Copy 2 audio files into your /media/audio/ OR /config/www/audio OR /share/audio

  • azan.mp3
  • azansubuh.mp3
  • azan_alexa.mp3
  • azansubuh_alexa.mp3

Special Thanks

About

🕋 Automation for Malaysia Adzan (Muslim call to prayer) based on JAKIM API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published