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)
- Automation Adzan using Home Assistant: https://youtu.be/DZGJwaeQuGA
- Beginners Guide to Home Assistant: https://youtu.be/-jyegp-mL20
- Copy the lines into your configuration.yaml.
- It will enable/create the following:
- Downloader
- Input Select (for source selection)
- Input Text (for state/location code
- 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:
- Enter your location code
input_text.solat
based on location/zone list - Enter your Home Assistant URL in
input_text.homeurl
- Select source (eSolat/AzanPro/Local)
- Enter your location code
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)
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)
- 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.
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
- @farxpeace - for the original code
- HomeAssistantMalaysia