cloudy

Author Topic: POST or GET data to a URL  (Read 525 times)

0 Members and 1 Guest are viewing this topic.

Offline artpics

  • Posts: 46
  • Calabasas California
    • Calabasas  CA Weather
POST or GET data to a URL
« on: February 09, 2010, 03:00:11 AM »
is this possible if WD can do either POST or GET data to a URL, our house is a smarthouse thanks to indigo and we want to write a plugin for weather display and indigo. here is our question.

at the moment we turn off our  garden sprinklers if we have rain in the last week etc

 thanks.

RT

note from developer of indigo.

If any of you are familiar enough with Weather Display to know if it can post values to a custom URL, then an even more elegant solution is something like I did with LWC - it posts data to an IWS plugin I wrote every 5 minutes. The plugin then populates the data into Indigo variables. It's nice cause there's no intermediary file involved, and you only have to worry about setting the software to "push" the values (vs a push to file and then a pull from the file to Indigo). The LWC plugin is pretty simple really - if WD can do either POST or GET data to a URL then it should be pretty simple to use it as a pattern for a WD plugin. I looked, but I didn't see that ability in WD, although I will admit that the UI totally bewilders me so I could be missing it.
Mac 10.6 on an Imac

Offline Weather Display

  • Posts: 64,538
Re: POST or GET data to a URL
« Reply #1 on: February 09, 2010, 07:47:24 AM »
it is available in the windows version, i.e in the formated data file setup in the ftp/internet setup
and you tick to use HTTP get and then tick to use custom file

so yes I could make this available for the mac version too

Offline jmar

  • Posts: 1,405
  • Halifax, Canada
    • HRM Weather
Re: POST or GET data to a URL
« Reply #2 on: February 09, 2010, 05:03:02 PM »
I just went ahead and deleted my previous post. Got a lot of answers from doing and learning as I went along with the help of Jay over at the Indigo forum.

I got the plugin for Indigo and edited it as advised, and am ready to receive a url. Windy I can test this whenever you get WD to post a url. I would suggest a control panel that the user might select the parameters they want to send to Indigo, then the url would be sent based on the user's selections, much like WU or Awekas. But I already have a text file template ready to go that I have been using in the webfile realtime control panel along with testtags, so in that case could just use the http screen instead to process it. Just that a control panel would be so slick in this case.:) Regardless, Indigo will automagically create and populate it's internal vars from the data sent.

Here is the url that would need to be sent, along with a sample data feed. Note that this is derived from the present LWS plugin for Indigo and the data is not metric in the url so this would be something you would want to look at:

Code: [Select]
http://host:port/wd/importData?&date=2009-05-12+17%3A22%3A12&winddir=270&windspeedmph=0.0&windspeedmphav_10m=0.0&windgustmph=0.0&windgustdir=270&windgustmph_10m=0.0&windgustdir_10m=270&humidity=47&dewptf=69.836&tempf=93.200&raininch=0.000&rain24hinch=0.000&baroinch=28.508&action=update
The url begins with     http://host:port/wd/importData?

This would create the following variables in Indigo and populate them via the plugin:
WD_windgustmph
WD_tempf
WD_raininch
WD_windgustmph_10m
WD_windspeedmph
WD_windgustdir_10m
WD_humidity
WD_winddir
WD_date
WD_windspeedmphav_10m
WD_baroinch
WD_dewptf
WD_rain24hinch
WD_windgustdir

Again this is derived from the existing plugin so the data WD includes in the URL with WD's naming convention (as long as it's plain text) will be recognized in Indigo.

Let me know if/when you have something to test and I will give it a whirl! :)

ArtPic, depending on Windy's feedback, I will make a copy available to you as well... and I think bbruck might be interested in this as well.  So 3 of us potentially could test.
« Last Edit: February 09, 2010, 05:09:10 PM by jmar »
iMac, 2 x Mac Mini, Mac OS X 10.6.7, Indigo integration, Web - WDL, Saratoga templates, Lightbox

Offline Weather Display

  • Posts: 64,538
Re: POST or GET data to a URL
« Reply #3 on: February 09, 2010, 05:38:24 PM »
the ability to set the URL and set to send a customfile with custom tags in it is already available in the windows version, see my post above
so I just need to create a cron program to send this data

Offline jmar

  • Posts: 1,405
  • Halifax, Canada
    • HRM Weather
Re: POST or GET data to a URL
« Reply #4 on: February 09, 2010, 07:28:11 PM »
Sweet! :)
also, the Indigo plugin is done and tested on my Indigo server. (credit to Jay, artpic, et al for the inspiration and advice)
All the best
Jim

PS - Windy, I don't know if you have had comments on your webcam, but I have been collecting some of the most perfect sky views of your webcam from your avatar here on the forum (just dragging to the desktop. Simply the best I've seen for clarity and vistas. Will post them over in the weather talk forum. What kind of camera is that?
iMac, 2 x Mac Mini, Mac OS X 10.6.7, Indigo integration, Web - WDL, Saratoga templates, Lightbox

Offline Weather Display

  • Posts: 64,538
Re: POST or GET data to a URL
« Reply #5 on: February 09, 2010, 07:41:50 PM »
its a logitech 9000 pro
working great

I have it so that when I move the mouse over the WD graphs it shows a movie animation from the time stamped files
great feature that

Offline jmar

  • Posts: 1,405
  • Halifax, Canada
    • HRM Weather
Re: POST or GET data to a URL
« Reply #6 on: February 10, 2010, 02:44:23 PM »
This on the 3rd... as well as last night at dusk. Spectacular views!  ... and also one in January, that contrasted the cloudcover so well (my favorite)
« Last Edit: February 10, 2010, 02:46:16 PM by jmar »
iMac, 2 x Mac Mini, Mac OS X 10.6.7, Indigo integration, Web - WDL, Saratoga templates, Lightbox