s3.leo
(S3 Leo)
December 30, 2020, 3:11pm
258
zeeshany:
Thanks for your quick response.
Yes, I already have alexa media player installed through HACS.
What I’m having difficulty is 1) automation.yaml indentation of your config 2) understanding of how
media_content_type: SPOTIFY
and media_content_id: Azan Makkah 3
would make alexa ecoh play Adhan?
below I’ve pasted the code but its having issue with last 5 lines indentation.
please can you help?
Copy to clipboard
- id: '1578755762336'
alias: Azan notifying
description: ''
trigger:
- platform: template
value_template: '{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.fajr_prayer”),"%Y-%m-%dT%H:%M:%S"))}}'
- platform: template
value_template: '{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.dhuhr_prayer”), “%Y-%m-%dT%H:%M:%S”))}}'
- platform: template
value_template: '{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.asr_prayer”), “%Y-%m-%dT%H:%M:%S”))}}'
- platform: template
value_template: '{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.maghrib_prayer”), “%Y-%m-%dT%H:%M:%S”))}}'
- platform: template
value_template: '{{ as_timestamp(strptime(states(“sensor.time_date”), “%H:%M, %Y-%m-%d”)) == as_timestamp(strptime(states(“sensor.isha_prayer”), “%Y-%m-%dT%H:%M:%S”))}}'
condition: []
action:
service: media_player.play_media
data:
media_content_type: SPOTIFY
media_content_id: Azan Makah 3
entity_id: media_player.master_room_echo_dot
data:
message: حان وقت الآذان
title: ({{ now().strftime("%H:%M")}})
service: notify.all_devices
mode: single
As you know there are two ways to creat automation , one will be either from yamil and the other will be throw the configuration > automations > Add automation
Am sure 2nd method will fix the induction issue
s3.leo
(S3 Leo)
December 30, 2020, 3:27pm
260
Service
Data
(Space)media_content_type
(Space)media_contect_id
entity_id
Data
(Space)message
(Space)title
Service
Hopefully it’s clear , explaining in forums are new to me , wish I could add a photo
s3.leo:
Azan Makah 3
Thanks no worries.
So, now i’m able to play content on desired ecoh dot by executing the automation… however its not the Azan Makah, its most of the time random surah like Surah al kursi etc… I’ve tried copying link of azan makah 3 (Azan Makah 3 - song and lyrics by Sheikh Ali Bin Ahmad Al Mulla | Spotify ) and put it in place of meida_content_id but Alexa says can’t find that.
I’m nearly there… i hope can solve this tonight…
Hello All,
I’m almost giving up trying to play azan on echo dot, no matter what i’ve tried media_player.play_media plays just random surahs from spotify
Anyone here can please guide?
s3.leo
(S3 Leo)
December 31, 2020, 9:14am
263
I had the same issue at start , so I recommend keep the name exactly (( Azan Makah 3 ))
On more thing I would like to ask you to check the following
s3.leo
(S3 Leo)
December 31, 2020, 9:15am
264
You also can do a test to use it the automation
Thanks brother for the references.
Do I need to have a paid spotify subscription for this to work? as i see your spotify UI has previous/play/next button. Could this be the reason for me its playing random surahs and not the Azan Makah 3?
Thanks,
regards
s3.leo
(S3 Leo)
December 31, 2020, 2:47pm
267
Yes it’s paid , can you add your own athan to Spotify library?
I did the same with my HomePod
anismtl
(Anis)
January 3, 2021, 5:53pm
268
Hi Brother,
which is the best calculation_method, For Canada ,Montreal.
Thanks
s3.leo
(S3 Leo)
January 3, 2021, 8:11pm
271
University of Islamic Sciences in Karachi
Islamic Society of North America
Muslim World League
Umm Al-Qura University in Makkah
The calculation method used for prayer times. Must be one of: karachi
, isna
, mwl
, makkah
.
s3.leo
(S3 Leo)
January 3, 2021, 8:13pm
272
123:
If anyone is interested in simplifying their Azan automation’s trigger, you can take advantage of an enhancement introduced in version 0.118.
It’s now possible to create a Time Trigger using a timestamp sensor . What that means is you can replace all of this:
Copy to clipboard
trigger:
- platform: template
value_template: '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.fajr_prayer"),"%Y-%m-%dT%H:%M:%S"))}}'
- platform: template
value_template: '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.dhuhr_prayer"), "%Y-%m-%dT%H:%M:%S"))}}'
- platform: template
value_template: '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.asr_prayer"), "%Y-%m-%dT%H:%M:%S"))}}'
- platform: template
value_template: '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.maghrib_prayer"), "%Y-%m-%dT%H:%M:%S"))}}'
- platform: template
value_template: '{{ as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")) == as_timestamp(strptime(states("sensor.isha_prayer"), "%Y-%m-%dT%H:%M:%S"))}}'
with this:
Copy to clipboard
trigger:
- platform: time
at:
- sensor.fajr_prayer
- sensor.dhuhr_prayer
- sensor.asr_prayer
- sensor.maghrib_prayer
- sensor.isha_prayer
That’s very great , I’ll test it now
sham
(Shamim)
January 4, 2021, 10:07am
274
Assalamualaikum Wa RahmatullAh
I have also managed to get this automation working, may Allah bless and reward each and every one of you for your efforts.
I have a quick question, I have the automation working with Alexa media player integration as suggested. I cannot get it to play on multiple echo devices at the same time. I have tried adding multiple ‘media_player’ entities as a list as well as comma separated entities but it just plays on the last item on the list.
Does anyone have this working?
jzk
sham
(Shamim)
January 4, 2021, 8:21pm
275
In case anyone else has the same issue I had, i managed to get it working by adding ‘in everywhere’ after the name of the adhan track. ‘Everywhere’ being the group name of multi-room music group i had set in the Alexa app.
Asalam o alikum,
So it was indeed the paid subscription issue i signed up for spotify premium now the automation works and plays on my ecodot… jazakAllah for all your help
now to figure how to play in 4 ecodots
Thanks Shamim, tried this and worked for me too
1 Like
اسلم عليكم ورحمة الله
جزاك الله brother for the work and effort ,
However is it possible to create a UI interface to show the namaz times?
s3.leo
(S3 Leo)
January 11, 2021, 2:50pm
279
This my UI , hopefully will be helpful
type: glance
entities:
entity: sensor.fajr_prayer
format: time
name: الفجر
entity: sensor.dhuhr_prayer
format: time
name: الظهر
entity: sensor.asr_prayer
format: time
name: العصر
entity: sensor.maghrib_prayer
format: time
name: المغرب
entity: sensor.isha_prayer
format: time
name: العشاء
state_color: false
1 Like