On Tuesday, March 7, 2017 at 8:36:53 PM UTC-8, Ian Boag wrote:
>
> I have a Pi-driven setup that talks to a FO1080 and 4 cameras. Uploads by
> cellular. Someone else on the airfield has put up a (much) better
> (commercial grade) WS funded by an external organisation. I can get a feed
> off it if I want (via a JSON query) - owner doesn't mind.
>
> I would like to read this feed and insert it into weewx as if it was the
> input data from the station. So weewx will make the html and do the WU
> upload.
>
> I could of course just hard-code the data into index.html (from
> index.html.tmpl) but that would still leave the WU thing in the air
>
> Not sure where to start - the obvious place is the fousb.py driver and
> have it go to a file with the downloaded query in it (instead of talking to
> the station). I can read the numbers etc. I assume that fousb.py just
> returns the values from the station .... and would return them from a file
> instead. I can do the python for the JSON query and
> extraction/reformatting etc.
>
>
I have a somewhat similar two-system setup that has worked for years now:
- outside pi has a few DS18B20 sensors on it
- it reads them via a python script called from cron and writes a
json-formatted output file
- it also serves that file up via nginx to the weewx system which has a
extension that:
- essentially grabs the file ala curl
- writes the data into the right elements in my second db
- and my local weewx skin picks that data up from the second db easily
by specifying it in the cheetah template
So if you can get a json-formatted file onto your weewx system, writing it
into a second db shouldn't be a big deal. Pick+choose in your skins which
db outTemp (or whatever) comes from. Don't sweat if both systems have
windSpeed or whatever, just pick which station you want to be authoritative
for that element and set your skin accordingly.
If you want to see the extension that I did on the weewx side, it's at
https://github.com/vinceskahan/vds-weewx-local-skin/blob/with-raspi/bin/user/pi.py
but I suspect there are better examples out there for how to get
json-formatted special data into a weewx db.