On 14/07/14 21:32, Kenneth Ljungqvist wrote:
> I've got a weather station hooked up to a Raspberry Pi and it works
> like a charm. Currently I'm only uploading the data to Weather
> Underground.
I assume you're using 'live logging' to do this.
> Now I want to use the data for my garden irrigation system. I'd like
> to store the data in a database or setup a web service to expose the
> data for storage somewhere else.
> I can't find any documentation on how to extract the data and access
> it through a python script or whatever. Could someone please point me
> in the right direction?
>
> Am I suppose to use templates with live log and read the data from the
> templates every 48 seconds?
That's one possibility - to use a template to write a data file of
current conditions that's then read by another program.
The pywws.DataStore module's documentation describes how to use it to
access stored data, but it's generally a bad idea to have two different
programs accessing the same data files. It's a very simple storage system.
You could create a "user calibration" module that writes data to a
proper database, but you'd need to do something to prevent the same data
being stored a second time if the data is reprocessed.
You could send your data to another service such as OpenWeather or CWOP
and then use that service's API to get data for your irrigation system.
Long term, I'd like to write an alternative storage "back end" for pywws
that uses MySQL or similar, but I haven't had time to look into this yet.
--
Jim Easterbrook <
http://www.jim-easterbrook.me.uk/>