Skip to content

πŸ•‹ Automation for Malaysia Adzan (Muslim call to prayer) based on JAKIM API. Give support by pressing the ⭐ button. Jazakallahu khair

License

Notifications You must be signed in to change notification settings

zubir2k/HomeAssistantAdzan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Home Assistant Adzan
GitHub Repo stars Twitter Follow Repo Donate

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

  • JAKIM Official (eSolat) - Website.
  • AzanPro - Website.
  • Home Assistant Official Islamic Prayer Time - Website.

Whats New in v4

  • Fully revamped eSolat sensors.
  • Easy install with minimal configuration.
  • Prayer time sensor will show in timestamp format. 12/24hours format are now in attributes.
  • Automation are now created by default automatically. However, you may choose to create your own.
  • Dynamic Media Player selector.
  • Added support the official Home Assistant Islamic Prayer Time
  • Volume Slider Control based on the selected speaker/media_players (feature added from pull-request #2)
  • Version checker & updater (NOTE: The updater will only update essential files only).

The Default Automation will perform the following:

  • Play TTS (for Google) or Play audio TTS (for Alexa)
  • Play Azan
  • Send Persistent Notification (Azan & 15min Reminder)
  • Send default Notification (notify.notify)

Screenshot

image

image

image

lovelace-dashboard

image

Video Tutorial

Youtube

Installation

1. Copy all files

  • Browse into your Home Assistant directory and paste all files into \config and \media.

2. Add eSolat into configuration.yaml

  • Add the following line into the config file
homeassistant:
  packages: !include_dir_named HAMY/
  • Restart Home Assistant to take effect.

3. Dashboard lovelace-ui.yaml

  • Add new card, scroll at the bottom and choose Manual.
  • Copy & paste the YAML respectively.

image

Configure eSolat

1. Source

  • Select source (Jakim/AzanPro/Local/Islamic Prayer Time)
  • Enter state code (not applicable for Islamic Prayer Time) -- Refer state code here.
  • For Islamic Prayer Time, please ensure to complete the configuration in the Home Assistant Integration menu

2. Azan Audio & Automation

  • Select your preferred media player
  • Choose your automation (Google or Alexa). Select Custom if you wish to use your own automation.
  • For Google, please enter azan.mp3 and azansubuh.mp3 as your audio files. You may use your own mp3 stored in your \media folder.
  • For Alexa, please enter your home_url. IMPORTANT: Please ensure Alexa_Media_Player addon has been configured.

3. Refresh

  • Click here Open your Home Assistant instance and show your automations. to open your automation panel.
  • Run Azan Yearly Update

image

  • Press both Online and Local sensors to take effect.

Automation Ideas

There are many ways that you can benefit from the prayer time sensors.

1. Execute action upon x minute before prayer time.

Example: 15min before Maghrib, play random surah. 15*60 where 15 is in minutes.

{{ state_attr('sensor.solat_maghrib', '24hours') == (now().strftime('%s') | int + 15*60) | timestamp_custom("%H:%M", false) }}

2. Random play audio

Example: Random play Surah before/after azan.

  - 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 }}

3. Others

Send notification to any Android TVs and perhaps then shutting off the TV.
Example: Alert family to get ready for Maghrib. Then turn off the TV 😁

Special Thanks

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

⚠ Disclaimer

THIS IS NOT AN INTEGRATION ADD-ON (issue#3). THIS IS A TEMPLATE THAT CREATES SENSORS AND AUTOMATION FOR ADZAN PRAYER.