Skip to content

Instantly share code, notes, and snippets.

@zubir2k
Last active April 28, 2022 00:20
Show Gist options
  • Save zubir2k/60fa28c5227acb25ffa09e0c8bc4d83e to your computer and use it in GitHub Desktop.
Save zubir2k/60fa28c5227acb25ffa09e0c8bc4d83e to your computer and use it in GitHub Desktop.
alias: Doa Pagi on Sunrise
description: ''
trigger:
- platform: template
value_template: |
{{is_state("sun.sun", "above_horizon")}}
condition: []
action:
- service: media_player.play_media
target:
entity_id:
- media_player.all_devices
data:
media_content_id: media-source://media_source/local/audio/doa-pagi.mp3
media_content_type: audio/mp3
extra:
title: Doa Pagi
- delay:
hours: 0
minutes: 2
seconds: 53
milliseconds: 0
- condition: template
value_template: >-
{% set raya = (state_attr('sensor.solat_jakim',
'prayerTime')[0].hijri[8:10] ~ '-' ~ state_attr('sensor.solat_jakim',
'prayerTime')[0].hijri[5:7]) %}{{ raya == '01-10' or raya == '10-12' }}
- service: media_player.play_media
target:
entity_id:
- media_player.all_devices
data:
media_content_id: media-source://media_source/local/audio/takbir.mp3
media_content_type: audio/mp3
extra:
title: >-
Takbir Raya {{state_attr('sensor.solat_jakim',
'prayerTime')[0].hijri[0:4] ~ 'h'}}
mode: single

Home Assistant Doa Pagi & Takbir visitors

Automation playing Doa Pagi on sunrise with addition of Takbir Raya on Eidul Fitr and Eidul Adha

Prerequisite

  • This will create hijri date sensor
  • It will allow to trigger based on the following conditions:
    1. Eidul Fitri 1 Syawal (01-10)
    2. Eidul Adha 10 Zulhijjah (10-12)
  • Doa Pagi (Hijjaz - Munif)
  • Takbir Raya (Rabbani - Ustaz Asri)

Installation

Create new automation and copy the YAML from automation.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment