How to copy or create a new uploader function. need 2 "wunderground" uploaders for use with Opensprinkler.com

113 views
Skip to first unread message

Alco van N

unread,
Jun 21, 2019, 6:06:59 AM6/21/19
to weewx-user
Hi,

I recently extent my home-automatisation systems with a garden sprinkler installation. it's off-course with open hard&software!
So I use the opensprinkler.com software with a RPI and custom pcb for controlling my valves. al works fine!

Now I want to get my weewx data into the sprinkler software for calculation the amount of water in a cycle.

In short this reuses the wunderground upload feature and send a WU report to the opensprinkler API.

But there is one thing, I also want to keep the upload feature to wunderground.com. So i thought I can duplicate the upload by adding a second [[wunderground ]] to the weewx.conf but that's not gonna work.

So can anybody help me with this? Can i set 2 uploaders for Wunderground? or where can I modify/duplicate the services to have a dedicated one for opensprinkler?
I'm happy to create a special opensprinkler uploader.. but need some information where to start.

tnx!


Chris Richmond

unread,
Jun 21, 2019, 8:29:41 AM6/21/19
to weewx-user
I've done a similar thing to get the last 2 days precipitaiton from weewx into OS.  I actually replaced the whole CGI with a python script that pulls forecast
data from OWM and DarkSky.  At the time OS was using OWM, but not really dealing with the data correctly and the calculated percentage
was zero, so I rolled my own.  I can pull the details together if you like.
Chris

Alco van N

unread,
Jun 21, 2019, 1:09:23 PM6/21/19
to weewx-user
That should be great Chris, I still can user OWM with Opensprinkler, or a general format for any PWS. The have a build a weather "input" services that I've installed.
So I think I can directly or slightly adapt your Py script to use with that!

( a general rest-full / POST command to send weather info to Opensprinkleris documented at: https://github.com/OpenSprinkler/OpenSprinkler-Weather/blob/master/docs/pws-protocol.md ) they really did a nice job there to make it more flexible.



Chris Richmond

unread,
Jun 22, 2019, 9:38:06 PM6/22/19
to weewx-user
Working on packaging things up.  May take a few days.  As for OS, their default is a call to a cgi script they host somewhere.
I replaced that with something local that returns the necessary data, including recent precipitation.  It's been appearantly
working fine for months or more, but when I tried the validation parts, it isn't working, so debugging.  What I can't verify are
the cgi parts.  From the command line, works as expected.  There's some web thingy that's being a PITA.

Chris

Chris Richmond

unread,
Jun 23, 2019, 9:40:16 PM6/23/19
to weewx-user
Hi, making good progress.  Need to figure out what's up with json.loads.  Works in one case, not the other.
Other than that, the same script works from the command line or as a cgi, which was on my to-do list for a while.

Chris

Andrew Milner

unread,
Jun 23, 2019, 10:01:32 PM6/23/19
to weewx-user
I use opensprinkler pi, but locally on my network and do not connect to OS in the cloud at all. Following the demise of WU from OS I switched weewx to upload also to OWM which worked fine except that OWM will only give pws data back via the API - so OS could only get local area data rather than station specific dsata.  So I now get the Zimmerman data from OWM using the OWM API and then set the Waterlevel in OS using the OS API via a cron job 30 mins before watering is due.  This seems to work quite well - and I get to see the OS area water level most of the time and my station specific level close to watering time.!!

Alco van N

unread,
Jun 25, 2019, 2:24:11 PM6/25/19
to weewx-user
Oh that's great Chris!

I also poked a bit around on the OpenSprinkler forum, and second I will try to get it work with Node-Red. (a great graphical NodeJS tool). I have (all my sensors at home) available in MQTT so I try to make a webhook to Opensprinkler from Node-Red. But still no luck (need some time to sort there OpenSprinkler API out).

Op maandag 24 juni 2019 03:40:16 UTC+2 schreef Chris Richmond:

Chris Richmond

unread,
Jun 27, 2019, 6:38:08 PM6/27/19
to weewx-user
Sent Alco a prelim offer on the side.  Would need a place to store this in public at some point, I suppose.
Chris
 
Reply all
Reply to author
Forward
0 new messages