[RELEASE] Adhan Player app

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.

Would it be possible to:1

  1. Select different speakers per adhan?
  2. Select rules to run before and after each adhan? That way if the volume is increased/decreased for a particular adhan it can be reverted back to the original level after it is done playing.

Yes. Please see "Adhan settings" and specify the URL of the mp3 file of your choosing for any Adhan. I only provide one mp3 for Fajr and another mp3 for all other times.

Yes and no. You can specify a Rule Machine rule to run at the time of any Adhan, see "Adhan settings". There is no support for "after the Adhan" because it is not reliable to know when the Adhan ends. The only recommended workaround is to use a delay in the rule run at the time of the Adhan so that you can have actions execute after the delay, and this after the Adhan.

Sorry, I meant the ability to override the global speaker selection per adhan, not the actual adhan audio.

Got it thanks, that should work.

Oh I see, like only play Fajr on speaker A, but the other ones on speaker B? If so, that's not supported at this time. Is that what you are referring to?

Correct. How hard do you think it would be to implement? If it's not that difficult maybe I can try and submit a pull request.

It should not be too hard to implement. Right now, there is only one speakers variable which is global for the whole app that records the speakers to use for every adhan: https://github.com/akhandok/adhanPlayer/blob/d624c8ae1c7f3728a0085cc2cb3f6b944d5f1bbe/app.groovy#L32

It should not be too hard to keep that as well as have Adhan-specific overrides similar to what is done for the rule machine support: https://github.com/akhandok/adhanPlayer/blob/d624c8ae1c7f3728a0085cc2cb3f6b944d5f1bbe/app.groovy#L292-L298

I request you please open a Github issue, and then if you can submit a PR, I would be grateful. Otherwise, I can get to this in due time when I get a chance (probably around this upcoming weekend, but no guarantees).

I already made the update. It is available in version 4.2 of the app. If you installed the app using Hubitat Package Manager (HPM), your Hubitat will automatically get the update next time HPM updates.

That was fast, JazakAllah Khair!

Wa iyyak

I had one more question. I had a speaker called, let's say Room A Speaker, which I selected in the adhan app. In google home, I then moved Room A Speaker to Room B and renamed it to Room B Speaker. I then re-ran the discovery in the chromecast integration app in hubitat which picked up the new name. However, it still shows up as Room A Speaker in the adhan app. I even deleted the app and re-imported it, re-installed it, but it still shows up with the old name. Is there some cache somewhere that needs to be cleared?

I have seen this before, and it is not so much a cache (I don't think) so much so I think orphaned devices. I faced odd issues when manipulating the Google speakers and having them reflect properly in hubitat. I had to delete the Chromecast integration app, manually delete the old discovered speakers, and the Adhan app. Then reinstalled everything from scratch.

Ok thanks, I'll give that a try.

Would it be possible to select an audio file from the local hubitat storage?

Yes. I do this myself. I cannot take a screenshot at this moment, but if you upload an mp3 to the hub, and then get it's local URL, you can put that into the settings and it will play that.

Oh I see, I didn't realize you can reference local files via a URL, thanks!

I'm seeing some strange behavior with the rules that run at adhan time. Initially I had setup the dhur adhan to run a rule which lowers the speaker volume to 45%. I then removed the rule from the adhan and even deleted the rule itself. But it still somehow lowers the volume to 45%. I tried deleting the adhan app completely and setting it up again but it still happens. Any idea how to completely start from a clean slate?

That sounds really weird and I have no idea why that's happening. Especially if you deleted the rule and even the Adhan app itself. It sounds like somehow the app is finding your old rule....somehow? And "remembers" it's supposed run a particular rule at a certain time. @bravenel may be able to comment more about how the app somehow resurrected a deleted rule even when the app itself were reinstalled. I suggest trying to delete the app, delete the speaker itself, delete the Chromecast integration app and then reboot the hubitat. Then reinstall the integration and add the speaker again and then reinstall the app and see if it still happens (you can use the "test Adhan" feature which simulates an Asr Adhan).

Ok thanks, I'll try that.