Reason being, the islamic prayer time integration does not give the same timings as the local Muslim governing body in my country.
Up until a week ago, the scrape was working fine to be included in my automations. However, suddenly it was not giving any value/data after being okay for 2 months.
I went on to have a look at the sites and notice that nothing changed visually.
Note that I am not muslim so bear with me…only looking at this purely technical
I checked 4 websites for prayer times for asr today and got 4:55 / 4:56 /4:56 / 4:57
My integration show 4:56
I have no clue why they differ but from where I stand…I would not trust any website before one knows what is behind its definition, could it be that it looks more to sun-rise/set and these indeed differe it one is a bit more east/west?
EDIT: the same applies to the integration of course but first one would need to know the true time, only then one can verify the integration
The website is the governing council for muslims in Singapore. Their calculations take precedence in these matters. The timings indicated in the website are fix-ed and calibrated according to various factors.
Looking at this technically, I am guessing that the websites have altered their page source resulting in my scrape sensors no longer being active.
(I have no programming/coding background and only recently started learning those because of HA)
Am I able to scrape the timings from either of these websites?
I have no clue what and how many websites exist so cannot asnwer this.
The ones I chose to feedback the differences are random , i.e. popping up via google. Also, governmental sites may not be correct at times
If the integration is ‘off’ then I would report an issue there.
Sure, in this case, we can trust the timing provided on the websites mentioned on the first post.
I shall bring up an issue with the dev of that integration.
In the meantime, I would like to learn if I can scrape the timings off either of these websites. Would you be able to point a direction that I can follow?
I looked at your websites just now and they changed to :01 and also mine changed to :57 (from :56)
So… I am a bit confused now, should this not be stable per day?
It looks like this change is being caused by the website now using javascript to inject that data into the website. And apparently the Scrape integration cannot handle that.
However, following this post: Scrape HTTPS JavaScript generated content I found a solution for this.
The prayer times data is now delivered as JSON through a separate api link.
So if you create a RESTful Sensor that retrieves the prayer times from the api website, and a Template sensor to retrieve the JSON attribute it should be working again.
Something like this:
Great! You are welcome
About the coffee: no, that’s OK. When I started with Home Assistant two years ago or so I also was helped several times via this community, so I am happy to be able to return this now when I can.
May be you can do the same sometimes when you have the time?
And I am still learning a lot as well while following the forums and looking into questions.
In this case I found the solution by reading this post from @Troon and this post from @ikea.
I managed to get the prayer times, but they are not triggering my automation. I suspect it’s because the time is in 12hr format and I can’t figure how to change to 24hr.
I personally know nothing about Muslim praying times, so please explain: is there always one time shown per day per location on this muis website, and are those times give in 12-hour format?
If so, then why isn’t the am / pm code given on that site?
How do you know whether it is in the morning or the evening?
Or is this indicated by those icons in front of the times?