Last active
August 18, 2021 10:01
-
-
Save zubir2k/7de57df50ea87736b823f4af4448d971 to your computer and use it in GitHub Desktop.
HomeAssistantTakbirRaya
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Integration Required: | |
# 1. Google Calendar (https://www.home-assistant.io/integrations/calendar.google) | |
# 2. Malaysia Holiday Calendar | |
# Create new automation and paste below. | |
alias: Takbir | |
description: '' | |
trigger: | |
- platform: template | |
value_template: >- | |
{{state_attr("calendar.malaysia_holidays", "message") == "Hari Raya Haji" | |
and states("sensor.time") == "08:00" and | |
state_attr("calendar.malaysia_holidays", "start_time").split(' ')[0] == | |
states("sensor.date")}} | |
- platform: template | |
value_template: >- | |
{{state_attr("calendar.malaysia_holidays", "message") == "Hari Raya Puasa" | |
and states("sensor.time") == "08:00" and | |
state_attr("calendar.malaysia_holidays", "start_time").split(' ')[0] == | |
states("sensor.date")}} | |
condition: [] | |
action: | |
- service: media_player.play_media | |
data: | |
media_content_type: audio/mp3 | |
media_content_id: https://xxxx.duckdns.org/media/local/audio/takbir.mp3 | |
extra: | |
title: Takbir Raya | |
target: | |
entity_id: media_player.all_devices | |
mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment