I have created Prayer time Automation But Not Triggering

Haiii

I was newly configured Islamic Prayer time . Prayer sensor i have used through Integration . But not triggering automatically . I check Execute Manually working Done .
I am pasting my all configuration and Automation file below . please check and i believe some one help me for fix this issues
Configuration .yaml

homeassistant:
  latitude: 25.2345086
  longitude: 51.42757250000001
  unit_system: metric
  time_zone: Asia/Qatar
  
default_config:
discovery:
media_extractor:
sun:

sensor:
  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'
      - 'date_time_iso'
      - 'time_date'
      - 'time_utc'
      - 'beat'

islamic_prayer_times:
    calculation_method: makkah

# Text to speech
tts:
  - platform: google_translate
  
 
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

Automation.yml

# Automation for 5 times Azan
- action:
  - alias: 'Azan'
    data:
      entity_id: media_player.bedroom_speaker
      media_content_id: https://www.islamcan.com/audio/adhan/azan2.mp3
      media_content_type: audio/mp3
    service: media_extractor.play_media
  - data:
      entity_id: media_player.bedroom_speaker
      volume_level: '0.9'
    service: media_player.volume_set
  alias: Adhan
  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")) }}'
    - 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_maghrib"), "%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")) }}'

#Automation for Azkar

- alias: Play Azkaar sabah
  trigger: 
    platform: time
    at: "08:00:00"  
  action:
    - service: media_player.play_media
      entity_id: media_player.bedroom_speaker
      data:
        media_content_id: https://www.islamcan.com/dua/Duaasformorningandevening.mp3 
        media_content_type: audio/mp3
        
#Automation for Azkar  

- alias: Play Azkaar Masa
  trigger: 
    platform: time
    at: "01:00:00"  
  action:
    - service: media_player.play_media
      entity_id: media_player.bedroom_speaker
      data:
        media_content_id: https://www.islamcan.com/dua/Duaasformorningandevening.mp3 
        media_content_type: audio/mp3

        
### Restart HA to force update Islamic Time Sensors at 1AM ###
- alias: Restart HA
  trigger: 
    platform: time
    at: "01:00:00"
  action:
    - service: homeassistant.restart

Prayer time integration Screen shot

The above issue has been solved

Salam,
Can you please share with me the solution? I am facing same issue and I tried to fix it with no luck

I will share you once I open my computer

Assalamu Alikum

First you should add prayer sensors through Integration ISLAMIC PRAYER TIME Then set calculation Method as per your Country …
Then change your automation as per below code

- id: '2020042901'
  alias: Adhan Fajr
  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"))
      }}'
  condition: []
  action:
  - data:
      volume_level: 0.9
    entity_id: media_player.bedroom_speaker
    service: media_player.volume_set
  - data:
      entity_id: media_player.bedroom_speaker
      media_content_id: http://192.168.8.180:8123/local/fajr_Prayer.mp3
      media_content_type: audio/mp3
    service: media_player.play_media
  - delay: 00:00:00
- id: '2020042902'
  alias: Adhan Dhuhr and Asr
  trigger:
  - 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"))
      }}'
  condition: []
  action:
  - data:
      volume_level: 0.9
    entity_id: media_player.bedroom_speaker
    service: media_player.volume_set
  - data:
      entity_id: media_player.bedroom_speaker
      media_content_id: http://192.168.8.180:8123/local/mecca_prayer.mp3
      media_content_type: audio/mp3
    service: media_player.play_media
  - delay: 00:00:00
- id: '151769301093'
  alias: Adhan Maghrib and Isha
  trigger:
  - 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"))-1800
      }}'
  condition: []
  action:
  - data:
      volume_level: 0.9
    entity_id: media_player.bedroom_speaker
    service: media_player.volume_set
  - data:
      entity_id: media_player.bedroom_speaker
      media_content_id: http://192.168.8.180:8123/local/mecca_prayer.mp3
      media_content_type: audio/mp3
    service: media_player.play_media
  - delay: 00:00:00

You should change media Content ID and Entity_id as per your
Then it will work fine

1 Like

Salam alaikom, I wish someone could make a video of how to do this. I do better with watching step by step videos.