-
-
Save AalianKhan/322c6ed840cecc5fc5043281d7224674 to your computer and use it in GitHub Desktop.
blueprint: | |
name: 🔊 Adhan Announcement | |
description: Play the adhan on selected speakers while also pausing media players of your choice. You can also add islamic month sensor to play suhoor and iftar dua. You can also optionally disable Fajr adhan. | |
domain: automation | |
input: | |
play_media_player: | |
name: Media players to play | |
description: The Media players to play the Adhan on | |
selector: | |
target: | |
entity: | |
domain: media_player | |
wait_media_player: | |
name: Media player to wait for | |
description: The media player to wait for and check if adhan is finished and continue the automation. Pick any 1 media player you selected above. | |
selector: | |
entity: | |
domain: media_player | |
fajr: | |
name: Play on fajr? | |
description: Should it play the adhan for fajr? | |
default: {} | |
selector: | |
boolean: | |
pause_media_player: | |
name: Media players to pause (Optional) | |
description: The Media players to pause when the Adhan plays. Such as TVs | |
default: {} | |
selector: | |
target: | |
entity: | |
domain: media_player | |
resume_media: | |
name: Resume paused media players after adhan? | |
description: Should it resume all paused media players after the adhan has played? | |
default: false | |
selector: | |
boolean: | |
islamic_month_sensor: | |
name: Islamic month sensor (Optional) | |
description: The sensor to check what month it is in the islamic calendar | |
default: {} | |
selector: | |
entity: | |
islamic_month_sensor_value: | |
name: Islamic month sensor value (Optional) | |
description: The value to check from the sensor to see if it is Ramadan | |
default: {} | |
selector: | |
text: | |
fajr_mp3: | |
name: Path to Fajr adhan MP3 (Optional) | |
description: Enter the path where your custom media player is stored. Examples, media-source://media_source/local/fajr_adhan.mp3 (local path is /media/fajr_adhan.mp3), or an address such as https://www.islamcan.com/audio/adhan/azan1.mp3. Defaults to my Github | |
default: https://github.com/AalianKhan/adhans/blob/master/adhan_fajr.mp3?raw=true | |
selector: | |
text: | |
adhan_mp3: | |
name: Path to adhan MP3 (Optional) | |
description: Enter the path where your custom media player is stored. Examples, media-source://media_source/local/adhan.mp3 (local path is /media/adhan.mp3), or an address such as https://www.islamcan.com/audio/adhan/azan1.mp3. Defaults to my Github | |
default: https://github.com/AalianKhan/adhans/blob/master/adhan.mp3?raw=true | |
selector: | |
text: | |
suhoor_mp3: | |
name: Path to Suhoor dua MP3 (Optional) | |
description: Enter the path where your custom media player is stored. Examples, media-source://media_source/local/suhoor_dua.mp3 (local path is /media/suhoor_dua.mp3), or an address such as https://www.islamcan.com/audio/adhan/azan1.mp3. Defaults to my Github | |
default: https://github.com/AalianKhan/adhans/blob/master/suhoor_dua.mp3?raw=true | |
selector: | |
text: | |
iftaar_mp3: | |
name: Path to Iftaar dua MP3 (Optional) | |
description: Enter the path where your custom media is stored. Examples, media-source://media_source/local/iftaar_dua.mp3 (local path is /media/ftaar_dua.mp3), or an address such as https://www.islamcan.com/audio/adhan/azan1.mp3. Defaults to my Github | |
default: https://github.com/AalianKhan/adhans/blob/master/iftar_dua.mp3?raw=true | |
selector: | |
text: | |
variables: | |
wait_media_player: !input wait_media_player | |
play_fajr: !input fajr | |
media_resume: !input resume_media | |
trigger: | |
- platform: time | |
at: sensor.islamic_prayer_times_fajr_prayer | |
id: fajr_trigger | |
- platform: time | |
at: sensor.islamic_prayer_times_dhuhr_prayer | |
id: dhuhr_trigger | |
- platform: time | |
at: sensor.islamic_prayer_times_asr_prayer | |
id: asr_trigger | |
- platform: time | |
at: sensor.islamic_prayer_times_maghrib_prayer | |
id: maghrib_trigger | |
- platform: time | |
at: sensor.islamic_prayer_times_isha_prayer | |
id: isha_trigger | |
action: | |
- choose: | |
- conditions: | |
- condition: state | |
entity_id: !input islamic_month_sensor | |
state: !input islamic_month_sensor_value | |
sequence: | |
- choose: | |
- conditions: | |
- condition: and | |
conditions: | |
- condition: trigger | |
id: fajr_trigger | |
- condition: template | |
value_template: '{{ play_fajr == true }}' | |
sequence: | |
- service: media_player.media_pause | |
target: !input pause_media_player | |
data: {} | |
- service: media_player.play_media | |
target: !input play_media_player | |
data: | |
media_content_id: !input suhoor_mp3 | |
media_content_type: mp3 | |
- delay: | |
hours: 0 | |
minutes: 0 | |
seconds: 2 | |
milliseconds: 0 | |
- wait_template: '{{ is_state(wait_media_player, ''idle'') }}' | |
timeout: 00:05:00 | |
- service: media_player.play_media | |
target: !input play_media_player | |
data: | |
media_content_id: !input fajr_mp3 | |
media_content_type: mp3 | |
- condition: template | |
value_template: '{{ media_resume }}' | |
- delay: | |
hours: 0 | |
minutes: 0 | |
seconds: 2 | |
milliseconds: 0 | |
- wait_template: '{{ is_state(wait_media_player, ''idle'') }}' | |
timeout: 00:05:00 | |
- service: media_player.media_play | |
target: !input pause_media_player | |
data: {} | |
- conditions: | |
- condition: trigger | |
id: maghrib_trigger | |
sequence: | |
- service: media_player.media_pause | |
target: !input pause_media_player | |
data: {} | |
- service: media_player.play_media | |
target: !input play_media_player | |
data: | |
media_content_id: !input iftaar_mp3 | |
media_content_type: mp3 | |
- delay: | |
hours: 0 | |
minutes: 0 | |
seconds: 2 | |
milliseconds: 0 | |
- wait_template: '{{ is_state(wait_media_player, ''idle'') }}' | |
timeout: 00:05:00 | |
- service: media_player.play_media | |
target: !input play_media_player | |
data: | |
media_content_id: !input adhan_mp3 | |
media_content_type: mp3 | |
- condition: template | |
value_template: '{{ media_resume }}' | |
- delay: | |
hours: 0 | |
minutes: 0 | |
seconds: 2 | |
milliseconds: 0 | |
- wait_template: '{{ is_state(wait_media_player, ''idle'') }}' | |
timeout: 00:05:00 | |
- service: media_player.media_play | |
target: !input pause_media_player | |
data: {} | |
- conditions: | |
- condition: or | |
conditions: | |
- condition: trigger | |
id: dhuhr_trigger | |
- condition: trigger | |
id: asr_trigger | |
- condition: trigger | |
id: isha_trigger | |
sequence: | |
- service: media_player.media_pause | |
target: !input pause_media_player | |
data: {} | |
- service: media_player.play_media | |
target: !input play_media_player | |
data: | |
media_content_id: !input adhan_mp3 | |
media_content_type: mp3 | |
- condition: template | |
value_template: '{{ media_resume }}' | |
- delay: | |
hours: 0 | |
minutes: 0 | |
seconds: 2 | |
milliseconds: 0 | |
- wait_template: '{{ is_state(wait_media_player, ''idle'') }}' | |
timeout: 00:05:00 | |
- service: media_player.media_play | |
target: !input pause_media_player | |
data: {} | |
default: | |
- choose: | |
- conditions: | |
- condition: and | |
conditions: | |
- condition: trigger | |
id: fajr_trigger | |
- condition: template | |
value_template: '{{ play_fajr == true }}' | |
sequence: | |
- service: media_player.media_pause | |
target: !input pause_media_player | |
data: {} | |
- service: media_player.play_media | |
target: !input play_media_player | |
data: | |
media_content_id: !input fajr_mp3 | |
media_content_type: mp3 | |
- condition: template | |
value_template: '{{ media_resume }}' | |
- delay: | |
hours: 0 | |
minutes: 0 | |
seconds: 2 | |
milliseconds: 0 | |
- wait_template: '{{ is_state(wait_media_player, ''idle'') }}' | |
timeout: 00:05:00 | |
- service: media_player.media_play | |
target: !input pause_media_player | |
data: {} | |
- conditions: | |
- condition: or | |
conditions: | |
- condition: trigger | |
id: dhuhr_trigger | |
- condition: trigger | |
id: asr_trigger | |
- condition: trigger | |
id: maghrib_trigger | |
- condition: trigger | |
id: isha_trigger | |
sequence: | |
- service: media_player.media_pause | |
target: !input pause_media_player | |
data: {} | |
- service: media_player.play_media | |
target: !input play_media_player | |
data: | |
media_content_id: !input adhan_mp3 | |
media_content_type: mp3 | |
- condition: template | |
value_template: '{{ media_resume }}' | |
- delay: | |
hours: 0 | |
minutes: 0 | |
seconds: 2 | |
milliseconds: 0 | |
- wait_template: '{{ is_state(wait_media_player, ''idle'') }}' | |
timeout: 00:05:00 | |
- service: media_player.media_play | |
target: !input pause_media_player | |
data: {} | |
No problem 👌
Well in its current state, it doesn't change the volume but I can surely add that.
Salam,
I think you need to update the blueprint since Home assistant 2023.11 changed the sensor name of the prayer times. i.e.
sensor.fajr_prayer to sensor.islamic_prayer_times_fajr_prayer
Thanks
Walaikum Salam
Thank you very much for informing I have updated the blueprint
[object Object]
is autofilling for both Islamic Month sensor (optional)
and Islamic Month sensor value (optional)
fields, which is not letting you save the automation unless these fields are filled.
Please have a look into this, jzk.
Are we able to define the Prayer time calculation method using this? Or is it defaulted to something?
@firozozman if you are referring to islamic prayer the integration, please see this link. If you are asking the adhan api, please see this link. If you have other questions, just ask
@firozozman if you are referring to islamic prayer the integration, please see this link. If you are asking the adhan api, please see this link. If you have other questions, just ask
Thanks @AalianKhan I installed Islamic Prayer Times from the link you provided. Configure your BluePrint as well. It did trigger Adhan yesterday. But stopped working this morning, since Fajr. Not sure what information you need from me, so that you may help me troubleshoot. JK
[object Object]
is autofilling for bothIslamic Month sensor (optional)
andIslamic Month sensor value (optional)
fields, which is not letting you save the automation unless these fields are filled.Please have a look into this, jzk.
@AalianKhan Can you please look at this?
Getting error message while trying to save script
Message malformed: required key not provided @ data['trigger']
is there any instruction how to set it up or what to change in script
I keep getting this, help please D:
Message malformed: expected str for dictionary value @ data['action'][0]['choose'][0]['conditions'][0]['state']
Nice work, I love it. Jazak Allah. Is there a way to set the volume before the athan starts?
Thanks