Hello, I am using version 2022.7.4, I have installed islamic prayer times, all is well, but the adhan won’t go off automatically. I have put my configuration files below for your idea. The scripts below used to work on an extremely old version of HA that I was running for the past few years. Since my old raspberry died, I’ve put this on a vmware esxi server for more stability. Please let me know if you can see what am I missing.
Fajr Adhan
################################################################################
- alias: Fujr Adhan
id: ‘1517693010922’
trigger:
value_template: ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.islamic_prayer_time_fajr”), “%Y-%m-%dT%H:%M:%S”)) -3600 }}’ # Activate this in November right after the time change
value_template: ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.islamic_prayer_time_fajr”), “%Y-%m-%dT%H:%M:%S”)) +3600 }}’ # Activate this in March right after the time change
value_template: '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.islamic_prayer_time_fajr"), "%Y-%m-%dT%H:%M:%S")) }}' # Always the Normal
action:
- service: media_player.volume_set
data:
entity_id:
- media_player.family_room_speaker
- media_player.master_bedroom_speaker
volume_level: ‘0.40’
# Fujr Adhan
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.master_bedroom_speaker
media_content_id: http://192.168.1.160/aud/adhan/adhan_fajr_makkah.mp3
#media_content_id: http://192.168.1.160/aud/adhan/adhan_al-aqsa.mp3
media_content_type: audio/mp3
- delay: '00:03:50'
#- delay: '00:04:15'
# Adhan Dua
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.master_bedroom_speaker
media_content_id: http://192.168.1.160/aud/dua/dua-e-adhan.mp3
media_content_type: audio/mp3
- delay: '00:00:19'
#- service: media_player.volume_set
# data:
# entity_id:
# - media_player.family_room_speaker
# - media_player.guest_room_wifi
# volume_level: '0.29'
# 96 Surah Al'Alaq
#- service: media_extractor.play_media
# data:
# entity_id:
# - media_player.family_room_speaker
# - media_player.guest_room_wifi
# media_content_id: http://192.168.1.160/aud/surah/quran_96.mp3
# media_content_type: audio/mp3
#- delay: '00:02:46'
# 109 Surah Al'Kafirun
#- service: media_extractor.play_media
# data:
# entity_id:
# - media_player.family_room_speaker
# - media_player.guest_room_wifi
# media_content_id: http://192.168.1.160/aud/surah/quran_109.mp3
# media_content_type: audio/mp3
#- delay: '00:01:19'
# 110 Surah An'Nasr
#- service: media_extractor.play_media
# data:
# entity_id:
# - media_player.family_room_speaker
# - media_player.guest_room_wifi
# media_content_id: http://192.168.1.160/aud/surah/quran_110.mp3
# media_content_type: audio/mp3
#- delay: '00:00:57'
# 01 Surah Al'Fatiha
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
- media_player.master_bedroom_speaker
media_content_id: http://192.168.1.160/aud/surah/quran_01.mp3
media_content_type: audio/mp3
- delay: '00:01:28'
# 112 Surah Al'Ikhlas
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
- media_player.master_bedroom_speaker
media_content_id: http://192.168.1.160/aud/surah/quran_112.mp3
media_content_type: audio/mp3
- delay: '00:00:41'
# 113 Surah Al'Falaq
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
- media_player.master_bedroom_speaker
media_content_id: http://192.168.1.160/aud/surah/quran_113.mp3
media_content_type: audio/mp3
- delay: '00:00:56'
# 114 Surah An'Nas
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
- media_player.master_bedroom_speaker
media_content_id: http://192.168.1.160/aud/surah/quran_114.mp3
media_content_type: audio/mp3
- delay: '00:01:17'
# Ayat'ul Kursi
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
- media_player.master_bedroom_speaker
media_content_id: http://192.168.1.160/aud/ayah/ayat_ul-kursi.mp3
media_content_type: audio/mp3
Dhuhr Adhan
################################################################################
- alias: Dhuhr Adhan
id: ‘1517693010923’
trigger:
value_template: ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.islamic_prayer_time_dhuhr”), “%Y-%m-%dT%H:%M:%S”)) -3600 }}’ # Activate this in November right after the time change
value_template: ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.islamic_prayer_time_dhuhr”), “%Y-%m-%dT%H:%M:%S”)) +3600 }}’ # Activate this in March right after the time change
value_template: '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.islamic_prayer_time_dhuhr"), "%Y-%m-%dT%H:%M:%S")) }}' # Always the Normal
action:
- service: media_player.volume_set
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
volume_level: ‘0.5’
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
#media_content_id: http://192.168.1.160/aud/adhan/adhan_makkah.mp3
media_content_id: http://192.168.1.160/aud/adhan/adhan_al-aqsa.mp3
media_content_type: audio/mp3
#- delay: '00:03:22'
- delay: '00:04:15'
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/dua/dua-e-adhan.mp3
media_content_type: audio/mp3
- delay: '00:00:19'
- service: media_extractor.play_media
data:
entity_id: media_player.family_room_speaker_2
media_content_type: audio/mp3
# 01 Surah Al'Fatiha
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_01.mp3
media_content_type: audio/mp3
- delay: '00:01:28'
# 112 Surah Al'Ikhlas
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_112.mp3
media_content_type: audio/mp3
- delay: '00:00:41'
# 113 Surah Al'Falaq
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_113.mp3
media_content_type: audio/mp3
- delay: '00:00:56'
# 114 Surah An'Nas
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_114.mp3
media_content_type: audio/mp3
- delay: '00:01:17'
# Ayat'ul Kursi
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/ayah/ayat_ul-kursi.mp3
media_content_type: audio/mp3
Asr Adhan
################################################################################
- alias: Asr Adhan
id: ‘1517693010924’
trigger:
value_template: ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.islamic_prayer_time_asr”), “%Y-%m-%dT%H:%M:%S”)) -3600 }}’ # Activate this in November right after the time change
value_template: ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.islamic_prayer_time_asr”), “%Y-%m-%dT%H:%M:%S”)) +3600 }}’ # Activate this in March right after the time change
value_template: '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.islamic_prayer_time_asr"), "%Y-%m-%dT%H:%M:%S")) }}' # Always the Normal
action:
- service: media_player.volume_set
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
volume_level: ‘0.5’
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
#media_content_id: http://192.168.1.160/aud/adhan/adhan_makkah.mp3
media_content_id: http://192.168.1.160/aud/adhan/adhan_al-aqsa.mp3
media_content_type: audio/mp3
#- delay: '00:03:22'
- delay: '00:04:15'
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/dua/dua-e-adhan.mp3
media_content_type: audio/mp3
- delay: '00:00:19'
# 01 Surah Al'Fatiha
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_01.mp3
media_content_type: audio/mp3
- delay: '00:01:28'
# 112 Surah Al'Ikhlas
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_112.mp3
media_content_type: audio/mp3
- delay: '00:00:41'
# 113 Surah Al'Falaq
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_113.mp3
media_content_type: audio/mp3
- delay: '00:00:56'
# 114 Surah An'Nas
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_114.mp3
media_content_type: audio/mp3
- delay: '00:01:17'
# Ayat'ul Kursi
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/ayah/ayat_ul-kursi.mp3
media_content_type: audio/mp3
Maghrib Adhan
################################################################################
- alias: Maghrib Adhan
id: ‘1517693010925’
trigger:
value_template: ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.islamic_prayer_time_maghrib”), “%Y-%m-%dT%H:%M:%S”)) -3600 }}’ # Activate this in November right after the time change
value_template: ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.islamic_prayer_time_maghrib”), “%Y-%m-%dT%H:%M:%S”)) +3600 }}’ # Activate this in March right after the time change
value_template: '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.islamic_prayer_time_maghrib"), "%Y-%m-%dT%H:%M:%S")) }}' # Always the Normal
action:
- service: media_player.volume_set
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
volume_level: ‘1.0’
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
#media_content_id: http://192.168.1.160/aud/adhan/bahrain_tv_athan_akmagraib.mp3
media_content_id: http://192.168.1.160/aud/adhan/adhan_al-maghrib_madinah.mp3
media_content_type: audio/mp3
- delay: '00:03:37' # adhan_al-maghrib_madinah
- service: media_player.volume_set
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
volume_level: '0.5'
- service: media_extractor.play_media
data:
entity_id: media_player.family_room_speaker
media_content_id: http://192.168.1.160/aud/dua/dua-e-adhan.mp3
media_content_type: audio/mp3
- delay: '00:00:19'
# 01 Surah Al'Fatiha
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_01.mp3
media_content_type: audio/mp3
- delay: '00:01:28'
# 112 Surah Al'Ikhlas
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_112.mp3
media_content_type: audio/mp3
- delay: '00:00:41'
# 113 Surah Al'Falaq
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_113.mp3
media_content_type: audio/mp3
- delay: '00:00:56'
# 114 Surah An'Nas
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_114.mp3
media_content_type: audio/mp3
- delay: '00:01:17'
# Ayat'ul Kursi
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/ayah/ayat_ul-kursi.mp3
media_content_type: audio/mp3
Isha Adhan
################################################################################
- alias: Isha Adhan
id: ‘1517693010926’
trigger:
value_template: ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.islamic_prayer_time_isha”), “%Y-%m-%dT%H:%M:%S”)) -3600 }}’ # Activate this in November right after the time change
value_template: ‘{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.islamic_prayer_time_isha”), “%Y-%m-%dT%H:%M:%S”)) +3600 }}’ # Activate this in March right after the time change
value_template: '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.islamic_prayer_time_isha"), "%Y-%m-%dT%H:%M:%S")) }}' # Always the Normal
action:
- service: media_player.volume_set
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
volume_level: ‘0.5’
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
#media_content_id: http://192.168.1.160/aud/adhan/adhan_makkah.mp3
media_content_id: http://192.168.1.160/aud/adhan/adhan_al-aqsa.mp3
media_content_type: audio/mp3
#- delay: '00:03:22'
- delay: '00:04:15'
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/dua/dua-e-adhan.mp3
media_content_type: audio/mp3
- delay: '00:00:19'
# 01 Surah Al'Fatiha
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_01.mp3
media_content_type: audio/mp3
- delay: '00:01:28'
# 112 Surah Al'Ikhlas
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_112.mp3
media_content_type: audio/mp3
- delay: '00:00:41'
# 113 Surah Al'Falaq
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_113.mp3
media_content_type: audio/mp3
- delay: '00:00:56'
# 114 Surah An'Nas
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/surah/quran_114.mp3
media_content_type: audio/mp3
- delay: '00:01:17'
# Ayat'ul Kursi
- service: media_extractor.play_media
data:
entity_id:
- media_player.family_room_speaker
- media_player.guest_room_wifi
media_content_id: http://192.168.1.160/aud/ayah/ayat_ul-kursi.mp3
media_content_type: audio/mp3
This is what I have on my dash board: (Please ignore the lines that are appearing as heading (bolded and enlarged) as they have a # for comment in the code)