🔊 Ready to go blueprint for playing adhan / azan on media players with many optional features

I tried to get this but I couldn’t find a way to display all the information with what we have. If someone can make a calendar integration for this, then that will be the perfect way to display all the dates.

Thanks brother. Another issue I noticed is that the hijri date is showing a day behind. How would I adjust this to add 1 day?

There is an adjustment option in the request,
You can use this URL with the adjustment field = 1 to increase the date by 1 day

http://api.aladhan.com/v1/gToH?date={{ now().strftime("%d-%m-%Y") }}&adjustment=1

Thank you! Much appreciate your quick response. This worked perfectly.

Salam aalikom! I have the islamic prayer times integration installed and works great. I added your optional sensors mentioned above (month, day). However, I can’t seem to find them as sensors. Could please share some lights about that? Thank you.

Salam,

Just to confirm you have this in your configuration.yaml and the sensor doesn’t show up?

sensor:
  - platform: rest
    name: Islamic month
    resource_template: http://api.aladhan.com/v1/gToH?date={{ now().strftime("%d-%m-%Y") }}&adjustment=1
    value_template: "{{ value_json.data.hijri.month.en }}"

Have you done a full restart of you Home Assistant?

1 Like

That did it! Thank you very much brother. Is there a way to show today date in Arabic in in hijri ? I would like to insert it in a lovelace card with the prayers time!

The following sensor should give you the month in arabic, unfortunately u can’t get arabic numbers from the API. There is probably a way to display convert English to Arabic numbers

sensor:
  - platform: rest
    name: Islamic month
    resource_template: http://api.aladhan.com/v1/gToH?date={{ now().strftime("%d-%m-%Y") }}&adjustment=1
    value_template: "{{ value_json.data.hijri.month.ar }}"
1 Like

One request if possible. Is there a way to create sensors for Imsak, tajahood? Thank you again!

Sure brother
Here is the sensor for Imsak and Tahajduh.
You will have to change it to follow your city, country and state/province
Remember to restart :wink:

sensor:
  - platform: rest
    name: Imsak
    resource_template: http://api.aladhan.com/timingsByCity?city=MYCITY&country=MYCOUNTRY&state=MYSTATE
    value_template: "{{ value_json.data.timings.Imsak }}"
  - platform: rest
    name: Tahajjudh
    resource_template: http://api.aladhan.com/timingsByCity?city=MYCITY&country=MYCOUNTRY&state=MYSTATE
    value_template: "{{ value_json.data.timings.Lastthird }}"
1 Like

I’m getting this error when try to create an automation with your blueprint. I’m assuming it’s due to Islamic Prayer Times integration not working correctly recently?

Message malformed: expected str for dictionary value @ data['action'][0]['choose'][0]['conditions'][0]['state']

This is fantastic. Thank you very much brother. I finally made it working with a few tweaks still to be corrected.

I wish the islamic prayer integration included all the sensors like Imsak, Tahhajoud…
Is there a way I can have the time for imsak and tahhajoud shows in am and pm like the rest of the other prayers time?
Your automation is great and would like to know if you group your media players or put in input select.
One request if you have time. Is there a way you can add a sensor for time left until next prayer.
Thank you again.

1 Like

re-adding/updating the blueprint should fix the issue

You can try adding iso8601=true to the URL to show it like the others.
For example:
http://api.aladhan.com/timingsByCity?city=MYCITY&country=MYCOUNTRY&state=MYSTATE&iso8601=true

I just add all my media_players using the input select. See the picture at the end of my original post

My original post also has a configuration for a sensor to show the next prayer time. You might need to edit the entity_ids depending on what you have.

Thank you again. However, adding " &iso8601=true " did not fix the am and pm as you can see in the screenshot:


As to the sensor I was referring to, it s another sensor that can calculate how much time left until the next prayer. I saw your sensor about the next prayer and I added it to setup.
Thank you again for your time and your efforts!

It didn’t fix the issue, but I found a work around by putting a value for Islamic month sensor value (Optional), and clearing the value for Islamic month sensor (Optional).

It seems your blueprint autofills the value to [object Object] on both fields, when nothing is inputted upon saving.

Fully Automated solutions for Alexa and Google. please try www.SmartAzan.com

Are the returned values in text format? I tried this and it shows correct times but I am not able to add automation to compare to current time and play Adhan. Entities dont show in the below screen because I suspect they are not of the Time format. How can I convert to Time format?

Assalamu Alaikum

I just tried setting this up and getting the following error when saving the automation.

Any help is appreciated

Can you give values to islamic month sensor and islamic month sensor value and get back to me?