S.A Bilal, sure thing, here’s what I currently have.
Config:
sensor:
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'time_date'
- 'time_utc'
- 'beat'
- platform: islamic_prayer_times
calculation_method: isna
sensors:
- fajr
- sunrise
- dhuhr
- asr
- maghrib
- isha
- midnight
Automation:
Fajr Prayer
- id: '1554439831482'
alias: Athan_Fajr
trigger:
- platform: template
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")) }}'
condition: []
action:
- data:
entity_id: ' media_player.living_room_speaker'
volume_level: '0.90'
service: media_player.volume_set
- data:
entity_id: media_player.living_room_speaker
media_content_id: https://www.youtube.com/watch?v=ADLO-Hm_nCQ
media_content_type: audio/youtube
service: media_extractor.play_media
Athan for the rest of prayers:
- id: '1554438581518'
alias: Athan_4
trigger:
- platform: template
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")) }}'
- platform: template
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")) }}'
- platform: template
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")) }}'
condition: []
action:
- data:
message: Allah Yet2abal <3
title: Time for Prayer
service: notify.tg
- data:
entity_id: ' media_player.living_room_speaker'
volume_level: '0.50'
service: media_player.volume_set
- data:
entity_id: media_player.living_room_speaker
media_content_id: https://www.youtube.com/watch?v=ADLO-Hm_nCQ
media_content_type: audio/youtube
service: media_extractor.play_media
Unfortunately you can’t enter a value template in the Automation editor GUI, to go around that you could create an automation and use a template trigger but leave the value template empty and fill out the rest. Then go to your automation.yaml file and add the value template there. Here’s a picture of the my automation in the Automation editor.