I’m trying to create a boolean (that can then be used in automations) from my local weather page, based on whether there is (any) rain forecast for the current day.
The info I want to get is in text of course, and with a value template also need to be converted to a boolean; so any rain at all (>0 = on).
Happy to have a bash at that part later, but initially I can’t even work out how to return the scrape.
Well - there is the wife factor that ‘trusts’ our local weather provider (I’ll stay out of that validity argument), but the other factor is the inbuilt weather doesn’t seem to have today’s rain.
And I’d rather it was as up to date as possible - rather than rely on yesterday’s version today, if that makes sense.
And you can also use TAF and that is as local as it gets.
This is probably what I would use since it updates very often (not sure how often since I don’t know the airport).
Which says the forecast between 13th at 6 UTZ to 14th at 6 UTZ predicts light rain showers (-SHRA).
I’m going to need to think for a while because it was a while since I decoded METAR and TAF, but I believe you just need to look for RA in either of these strings.
In your case, use selector as p .u-mT-0 u-mB-0 fineprint u-textGrey u-mT-0 u-mB-0
If you check the selector, it starts with p, which means paragraph element in html and continues with related css tags. I am just not sure if we need dot (.) after p or not, please give it a try.
Thank anyway chaps.
Have gone off using this now, as I have realised it totals the precipitation for the day for the figure I need, including if it has rained already.
Been working on the WeatherAPI integration instead, and that looks to be promising.