Weather Data Source
At the risk of going over some old ground here.....
I would like to Have a data source that I can log Current Temperature, Humidity, and wind speed for say
Looks like I need a http retriever?
I have read a few topics in the forum already such as https://forum.infiniteautomation.com/topic/3837/sunrise-sunset
but I must say that the whole Regex thing blows my mind.
Just wondering if anyone can assist in this with what is required to grab these parameters?
My Purpose is to check Cooling tower Water consumption in different weather conditions, and it would be good not to have a weather station at each location.
Any advise is appreciated.
my solution with openweathermap.org.
First step create a data source "HTTP Retriever":
In the URL field you have to put the following:
Second step create some datapoints:
The api paramters:
Create a datapoint Temp (temperature):
phildunlap last edited by phildunlap
Which will return an array if we got a match,
It would probably take more work to grab the whole forecast and the HttpRetriever may not be the best solution if one were to go after forecast data.
.*Humidity: .*?(\d+%).*will be our regex and 1 is the capture group, for Humidity.
Temperature seems a little more difficult, but we can see in a wget that it's easy to find that value relative to the word 'Now' in the same fashion, like,
MattFox last edited by MattFox
If you are unsure about regular expressions: regexr.com is a darned good resource and has helped me on many occasions. It also has a glossary of terms you can use in order to best 'capture' the groups of data you desire.
I use Weather Underground's API for my data (wunderground.com) as it provides a flexible API as well as forecasting.
and would suggest that but it appears some do-gooders have decided to shut the api down in two months for a more favourable pay 20x more for everything...
If I find something soon that works I'll keep you informed. Personally, I'd use an http query (namely curl) from a bash script to generate a file which could be in CSV format from an API that mango could parse into a datafile datasource. But that's just my approach. Keeps the API calls low too.
Thanks all, This has been very helpful.