[RELEASE] Adhan Player app

Hello @mohamad67,

I have published the ability to turn on/off particular Adhan(s). Please update your app to receive it. After you confirm that it is working properly, I will officially release it.

Regarding the volume settings, I am afraid that is not always possible. When the speakers are Google/Nest speakers, unfortunately it is only possible to set the volume when something is playing. Although this means I can set the volume so the Adhan plays at the new volume, I cannot reset the volume back to what it was before. Please see @bravenel's comment in Google Home. Set Volume doesn't appear to be working :

For GH mini, it will only adjust volume while it is playing something. So start a track, or tts, then set volume.

Since I do not have any Alexa devices, I cannot test to see if Alexa has this limitation or not. However, since it affects Google/Nest devices, I think it may be best to avoid this setting if possible in the app itself.

However, there is a way that you can workaround this problem. Please consider setting up a rule with Rule-4.0 - Hubitat Documentation like the following:

Capture

The comparison of Hubitat is required because it is Hubitat itself that plays the Adhan track. This will set the volume of your speaker to be whatever volume you want whenever it plays an Adhan (or anything else from Hubitat).

Sorry for suggesting the workaround solution, but I am hesitant to add a functionality to the app if it might not work for all devices/users. Please let me know if you have more questions, and I will try to help out. Thanks.

@azfarkhandoker
Thank you for the update, the on/off work as intended and I was able to set the volume based on your suggestion but what I wanted was a different set volume at different times, like 75% for the dhuhr and 40% for the fajr. And also planning to add announcements that should play at different volume, so is it possible to achieve this by adding restrictions/conditions in rule machine?
I’m in the process of migrating from smartthings and trying to learn the ways of Hubitat so sorry for asking what could be obvious and thanks again for your help.

Hello,

I have updated the application to run RM rules at the time of each Adhan. You can also choose different rule(s) for each Adhan.

Please update the app to the latest code. You can set which rule(s) to run for which Adhan(s) in the "Adhan Settings" page.

This will be included as part of the 3.2 update along with the "on/off" switch. Please try this out and let me know how it goes. If this also goes well, that should cover both of your requests, and I will release RM support and on/off capabilities as a part of the 3.2 update.

Thanks

I can’t make this work, my guess is I need to change the rule from this


but I’m not able to figure what to change the trigger to, leaving it with no trigger didn’t work either.

Update: leaving the rule with no trigger working now, looks like I wasn’t giving it enough time to update when testing the first time around, I’ll let it run for couple days to see if that was the case.

Today the adman didn’t play, looks like there is a glitch with scheduling prayers


the refresh timings ran on time but didn’t update the schedule.
The volume sometimes work and other times doesn’t , I’m watching it over the next few days to confirm.

Please enable debug logging (in advanced settings) so that you can capture the logs if it happens again.

I'm looking into the bug about the volume sometimes not adjusting. This is most likely because the rule(s) run too early.

I have debug logging turned on but the logs only goes back like 3 hours, so there is nothing from the app, does the hub save a limited log entries? I may need to stop other devices from filling the log with status updates.

I added a 1 second delay in the rule, but with the non schedule I didn’t get to confirm, it may need to be more.

Update:

Changed the “custom time of day to refresh adhan times” to 12:35am, originally had it at 10:00pm. So the bug may have been user(me) generated :slight_smile:
Increased the rules delay to 2 seconds.
Will report back in couple days, hopefully everything works good.

Any updates?

It’s working great, only few times it didn’t . I’m trying to figure out what happened


This error is not related to the adhan app, right?

I don't think so, if it were from the app, it would probably say app:<some number>. If you deselect the rules to run during the adhan and the issue persists, it might be related to the app.

Are you using Google speakers or Alexa speakers or something else?

I’m using google, it only missed 4 times in the past week.The adhan app logs doesn’t show any errors, what I posted above was the speaker logs.

Hm. I am not sure. What are the rules you're running? In the errors, I see a Waiting for response timed out (setVolume) which is not functionality that is built into the app. I wonder if something is going wrong with the RM rule(s).

For Google speakers, you have to remember that you can only setVolume after something is playing. So perhaps putting in a delay might help? Not sure...

Edit: I've published v3.2 with these changes and HPM support, so you shouldn't have to manually update the app anymore.

try Smartazan .com

Hello:
I would like to use this app on My hub, I was trying for two days , but it still not working,
I don't know why, installation was ok, speakers are GH mini, my location is Dubai, UAE,
attached the Logs showing error:
app:1142021-05-30 01:10:37.572 am errorError in Adhan response: Bad Request

app:1142021-05-30 01:10:37.091 am debugScheduling refreshTimings for 2021-05-30T06:00:00.000+0400

app:1142021-05-30 01:10:37.087 am debugRefreshing timings with parameters: [uri:https://api.aladhan.com/v1/timingsByAddress, query:[address:, tune:0,0,0,0,0,0,0,0,0, method:8], contentType:application/json, headers:[User-Agent:Hubitat/2.2.7.126 (Adhan Player app)]]

The parameters mention address:, meaning that there is no zip code set. It should be something like this (for a made-up ZIP code of 99999): address:99999,.

What location do you have set in http://<your hub IP>/location/edit?

The location is needed by the backend to properly calculate the Adhan timings for your location.

Thanks for fast reply:
The Zip code is not accepted, because its outside US/Canada,

the Location : http://192.168.0.120/location/edit

Do you mean the Location name : ( ) in the settings?

Do i need to change somthing in the App code in the line 124 address: location.zipCode,
sorry for that, but just trying to understand how its working....

Ah I see. I hadn't considered a case where this would be used outside of North America.

Do you feel comfortable changing the "Apps Code"? If so, please try to do the OPPOSITE of this change: Use ZIP Code instead of latitude and longitude to calculate timings; … · akhandok/adhanPlayer@b564d96 · GitHub

The app used to use latitude and longitude, but that was removed for privacy concerns.

If you do not feel comfortable changing the code, please send me a private message, and I'll work with you to get this resolved.

Download the Hubitat app