One more suggestion: You are downloading Azan.mp3 every time when the automation runs. This adds a significant delay in output. Please download Azan.mp3 and then put it in your www folder. Then your URL will change from
Thanks, however this is the first thing I tried however even tho I have uploaded the mp3 file to the the raspberry pi.
http://10.107.1.219:8123/root/Athan.mp3
&
http://10.107.1.219:8123/home/Athan.mp3
In-fact any folder I try the automation doesnt work neither does the if I try and access file through chrome its says “404: Not Found”. However I can access the homeassistant address below perfectly fine
Asalam-u-alikum Sahar, thank you for your efforts in putting together these scripts. This is the first time that i have programmed anything (used your step by step guide to get me through). I was hoping if you could help we with expanding the code to mute and unmute my tv soundbar when the azhan starts?
the soundbar is connected by Smartthings and the tv upstairs is connected directly as a device. I haven’t made any updates to the automation script you provided, just wondering if you knew how to do it
Assalamu Alaikum, I am trying to also get the Adhan to play from my google nest hub. I am trying to install home assistant on windows 10 OS. But not having luck as of yet.
I’m a complete noob to computing and IT, so please bare with me- Jazzakallah
Steps made:
I downloaded python- latest version/release for windows that they have on their site.
I downloaded the visual effects building tools required as I was getting an error message when trying to install home assistant on Command Prompt.
Now when I try to run the home assistant programme- it shows this-see below? Can or does anyone know what I’m doing wrong or missing.
Sorry if turns out to be something silly
2020-04-13 14:00:03 INFO (MainThread) [homeassistant.bootstrap] Config directory: C:\Users\Student\AppData\Roaming\.homeassistant
2020-04-13 14:00:03 INFO (SyncWorker_0) [homeassistant.loader] Loaded homeassistant from homeassistant.components.homeassistant
2020-04-13 14:00:03 INFO (SyncWorker_1) [homeassistant.loader] Loaded persistent_notification from homeassistant.components.persistent_notification
2020-04-13 14:00:03 INFO (MainThread) [homeassistant.setup] Setting up homeassistant
2020-04-13 14:00:03 INFO (MainThread) [homeassistant.setup] Setup of domain homeassistant took 0.0 seconds.
2020-04-13 14:00:03 INFO (MainThread) [homeassistant.setup] Setting up persistent_notification
2020-04-13 14:00:03 INFO (MainThread) [homeassistant.setup] Setup of domain persistent_notification took 0.0 seconds.
2020-04-13 14:00:03 INFO (SyncWorker_1) [homeassistant.loader] Loaded script from homeassistant.components.script
2020-04-13 14:00:03 INFO (SyncWorker_0) [homeassistant.loader] Loaded default_config from homeassistant.components.default_config
2020-04-13 14:00:03 INFO (SyncWorker_2) [homeassistant.loader] Loaded group from homeassistant.components.group
2020-04-13 14:00:03 INFO (SyncWorker_1) [homeassistant.loader] Loaded scene from homeassistant.components.scene
2020-04-13 14:00:03 INFO (SyncWorker_2) [homeassistant.loader] Loaded automation from homeassistant.components.automation
2020-04-13 14:00:03 INFO (SyncWorker_0) [homeassistant.loader] Loaded tts from homeassistant.components.tts
2020-04-13 14:00:03 INFO (SyncWorker_3) [homeassistant.loader] Loaded cloud from homeassistant.components.cloud
2020-04-13 14:00:03 INFO (SyncWorker_2) [homeassistant.loader] Loaded http from homeassistant.components.http
2020-04-13 14:00:03 INFO (SyncWorker_0) [homeassistant.loader] Loaded webhook from homeassistant.components.webhook
2020-04-13 14:00:03 INFO (SyncWorker_3) [homeassistant.loader] Loaded alexa from homeassistant.components.alexa
2020-04-13 14:00:03 INFO (SyncWorker_1) [homeassistant.loader] Loaded config from homeassistant.components.config
2020-04-13 14:00:03 INFO (SyncWorker_2) [homeassistant.loader] Loaded frontend from homeassistant.components.frontend
2020-04-13 14:00:03 INFO (SyncWorker_0) [homeassistant.loader] Loaded api from homeassistant.components.api
2020-04-13 14:00:03 INFO (SyncWorker_3) [homeassistant.loader] Loaded auth from homeassistant.components.auth
2020-04-13 14:00:03 INFO (SyncWorker_1) [homeassistant.loader] Loaded device_automation from homeassistant.components.device_automation
2020-04-13 14:00:03 INFO (SyncWorker_2) [homeassistant.loader] Loaded lovelace from homeassistant.components.lovelace
2020-04-13 14:00:03 INFO (SyncWorker_2) [homeassistant.loader] Loaded onboarding from homeassistant.components.onboarding
2020-04-13 14:00:03 INFO (SyncWorker_1) [homeassistant.loader] Loaded person from homeassistant.components.person
2020-04-13 14:00:03 INFO (SyncWorker_0) [homeassistant.loader] Loaded search from homeassistant.components.search
2020-04-13 14:00:03 INFO (SyncWorker_3) [homeassistant.loader] Loaded websocket_api from homeassistant.components.websocket_api
2020-04-13 14:00:03 INFO (SyncWorker_2) [homeassistant.loader] Loaded system_log from homeassistant.components.system_log
2020-04-13 14:00:03 INFO (SyncWorker_1) [homeassistant.loader] Loaded history from homeassistant.components.history
2020-04-13 14:00:03 INFO (SyncWorker_0) [homeassistant.loader] Loaded recorder from homeassistant.components.recorder
2020-04-13 14:00:03 INFO (SyncWorker_3) [homeassistant.loader] Loaded logbook from homeassistant.components.logbook
2020-04-13 14:00:03 INFO (SyncWorker_2) [homeassistant.loader] Loaded map from homeassistant.components.map
2020-04-13 14:00:03 INFO (SyncWorker_1) [homeassistant.loader] Loaded mobile_app from homeassistant.components.mobile_app
2020-04-13 14:00:03 INFO (SyncWorker_0) [homeassistant.loader] Loaded ssdp from homeassistant.components.ssdp
2020-04-13 14:00:03 INFO (SyncWorker_3) [homeassistant.loader] Loaded sun from homeassistant.components.sun
2020-04-13 14:00:03 INFO (SyncWorker_3) [homeassistant.loader] Loaded system_health from homeassistant.components.system_health
2020-04-13 14:00:03 INFO (SyncWorker_0) [homeassistant.loader] Loaded updater from homeassistant.components.updater
2020-04-13 14:00:03 INFO (SyncWorker_2) [homeassistant.loader] Loaded zeroconf from homeassistant.components.zeroconf
2020-04-13 14:00:03 INFO (SyncWorker_2) [homeassistant.loader] Loaded zone from homeassistant.components.zone
2020-04-13 14:00:03 INFO (SyncWorker_0) [homeassistant.loader] Loaded input_boolean from homeassistant.components.input_boolean
2020-04-13 14:00:03 INFO (SyncWorker_1) [homeassistant.loader] Loaded input_datetime from homeassistant.components.input_datetime
2020-04-13 14:00:03 INFO (SyncWorker_3) [homeassistant.loader] Loaded input_text from homeassistant.components.input_text
2020-04-13 14:00:03 INFO (SyncWorker_2) [homeassistant.loader] Loaded input_number from homeassistant.components.input_number
2020-04-13 14:00:03 INFO (SyncWorker_0) [homeassistant.loader] Loaded input_select from homeassistant.components.input_select
2020-04-13 14:00:03 INFO (MainThread) [homeassistant.bootstrap] Setting up {'system_log'}
2020-04-13 14:00:03 INFO (MainThread) [homeassistant.setup] Setting up http
2020-04-13 14:00:03 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds.
2020-04-13 14:00:03 INFO (MainThread) [homeassistant.setup] Setting up system_log
2020-04-13 14:00:03 INFO (MainThread) [homeassistant.setup] Setup of domain system_log took 0.0 seconds.
2020-04-13 14:00:04 INFO (MainThread) [homeassistant.setup] Setting up recorder
2020-04-13 14:00:04 INFO (MainThread) [homeassistant.setup] Setting up webhook
2020-04-13 14:00:04 INFO (MainThread) [homeassistant.setup] Setup of domain webhook took 0.0 seconds.
2020-04-13 14:00:04 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=19 from 2020-04-13 12:44:31.385546)
2020-04-13 14:00:05 INFO (MainThread) [homeassistant.setup] Setting up alexa
2020-04-13 14:00:05 INFO (MainThread) [homeassistant.setup] Setup of domain alexa took 0.0 seconds.
2020-04-13 14:00:05 INFO (MainThread) [homeassistant.setup] Setup of domain recorder took 0.8 seconds.
2020-04-13 14:00:05 INFO (SyncWorker_3) [homeassistant.loader] Loaded google_assistant from homeassistant.components.google_assistant
2020-04-13 14:00:05 INFO (SyncWorker_2) [homeassistant.loader] Loaded camera from homeassistant.components.camera
2020-04-13 14:00:05 INFO (SyncWorker_0) [homeassistant.loader] Loaded homekit from homeassistant.components.homekit
2020-04-13 14:00:05 INFO (SyncWorker_3) [homeassistant.loader] Loaded device_tracker from homeassistant.components.device_tracker
2020-04-13 14:00:05 INFO (SyncWorker_2) [homeassistant.loader] Loaded media_player from homeassistant.components.media_player
2020-04-13 14:00:08 INFO (MainThread) [homeassistant.setup] Setting up cloud
2020-04-13 14:00:08 INFO (MainThread) [homeassistant.setup] Setup of domain cloud took 0.1 seconds.
2020-04-13 14:00:08 INFO (MainThread) [homeassistant.setup] Setting up scene
2020-04-13 14:00:08 INFO (MainThread) [homeassistant.components.scene] Setting up scene.homeassistant
2020-04-13 14:00:08 INFO (MainThread) [homeassistant.setup] Setting up input_select
2020-04-13 14:00:08 INFO (MainThread) [homeassistant.setup] Setting up ssdp
2020-04-13 14:00:08 INFO (MainThread) [homeassistant.setup] Setup of domain ssdp took 0.0 seconds.
2020-04-13 14:00:08 INFO (MainThread) [homeassistant.setup] Setting up input_boolean
2020-04-13 14:00:08 INFO (MainThread) [homeassistant.setup] Setting up updater
2020-04-13 14:00:08 INFO (MainThread) [homeassistant.setup] Setting up sun
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain sun took 0.8 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up group
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain group took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up zone
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up input_number
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up input_datetime
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up lovelace
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up script
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain script took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up input_text
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up automation
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain automation took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up person
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up system_health
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain system_health took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up websocket_api
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain websocket_api took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up api
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up history
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain history took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up config
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up device_automation
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain device_automation took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain scene took 1.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain input_select took 1.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain input_boolean took 1.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain input_number took 0.2 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain input_datetime took 0.2 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain lovelace took 0.2 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain input_text took 0.1 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up auth
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain auth took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain api took 0.1 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up search
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain search took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain person took 0.1 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain config took 0.1 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain zone took 0.2 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up onboarding
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up zeroconf
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain onboarding took 0.1 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain zeroconf took 0.1 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up mobile_app
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up frontend
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain frontend took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain mobile_app took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up map
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain map took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up logbook
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain logbook took 0.0 seconds.
2020-04-13 14:00:09 INFO (SyncWorker_5) [homeassistant.loader] Loaded notify from homeassistant.components.notify
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up notify
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain notify took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.components.notify] Setting up notify.mobile_app
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.components.updater] Submitted analytics to Home Assistant servers. Information submitted includes {}
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain updater took 1.6 seconds.
2020-04-13 14:00:09 INFO (SyncWorker_3) [homeassistant.loader] Loaded binary_sensor from homeassistant.components.binary_sensor
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up default_config
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain default_config took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up binary_sensor
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain binary_sensor took 0.0 seconds.
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.updater
2020-04-13 14:00:09 INFO (SyncWorker_0) [homeassistant.loader] Loaded google_translate from homeassistant.components.google_translate
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setting up tts
2020-04-13 14:00:09 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.0 seconds.
2020-04-13 14:00:11 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 7.50s
2020-04-13 14:00:11 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2020-04-13 14:00:11 INFO (MainThread) [homeassistant.core] Timer:starting
2020-04-13 14:00:11 INFO (SyncWorker_0) [homeassistant.components.zeroconf] Starting Zeroconf broadcast
2020-04-13 14:00:11 INFO (SyncWorker_1) [homeassistant.loader] Loaded hue from homeassistant.components.hue
Do you have a raspberry pi or any laptop/computer that you can run all the time 24/7.
Because hassio needs to be run all the time else it will not work.
Currently using my laptop- it could potentially be left on. But I’m guessing the raspberry pi is the better option as its costs less to run all the time? I have checked it out, I think from where in based its costs around 35/40 for the basic kit which isn’t too bad. I shall try to buy one and install it- I think its supposed to be a smoother set up. if I run into any problems will come back! Jazzakallah for the reply.
Solution for delay in audio if multiple devices used.
Encase anyone in future encounters the issue of audio delay between multiple devices. I fixed the issue by creating a group in Google Home app of all the speakers that I want to use then restarted Home Assistant and it recognises the group and then use the group entity instead of the the speakers individually.
@Sodz You can play Surat Al-Kahaf on every Friday at 11 AM using this code.
Please add the following code to your configuration.yaml file.
binary_sensor:
- platform: workday
country: UK # Change your country if you are not in UK
workdays: [fri]
Then add the following code to your automation.yaml file.
#################### Surat Kahaf ####################
- alias: 'Surat Kahaf'
trigger:
platform: time
at: '11:00:00'
condition:
condition: state
entity_id: 'binary_sensor.workday_sensor'
state: 'on'
action:
- data:
entity_id: "media_player.sahar_google_mini" # replace with your Google Home's id
media_content_id: "https://www.al-hamdoulillah.com/coran/mp3/files/abderrahman-soudais/018.mp3"
media_content_type: "music"
service: media_extractor.play_media
- data:
entity_id: media_player.sahar_google_mini # replace with your Google Home's id
volume_level: '0.9'
service: media_player.volume_set