View unanswered posts | View active topics It is currently Thu Apr 24, 2014 6:40 am



Reply to topic  [ 60 posts ]  Go to page: Previous  1, 2, 3, 4  Next
 Getting weather data from Weather Display 
Author Message
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 8357
Location: Austin, Texas
Post Re: Getting weather data from Weather Display
jimM wrote:Do you think it could be configured either at the WD end (via POST) or in Indigo as I'm sure users would have many different reasons as I for wanting different intervals. Also, just for my own info, WD does a lot of posting to other websites both through file transfer and through a URL which the user actually selects some parameters as well as the timing, so could the plugin be like a "listener" that once active, just listens for posts from WD to a port (tcp or otherwise) then sets and or creates/sets the variable? or am I way off base here.


That's exactly how the LWC plugin works. It's just a URL in IWS that receives a POST or GET, takes the values from the HTTP request, and populates Indigo variables with the value. So no polling because it's passive until something else (LWC, WD, etc) hits the URL with data. If WD's generic POST/GET mechanism can be set up to post once a minute, then that's great.

I don't believe I made it completely general (like the AppleScript for instance - to autocreate variables), but a bit of work could probably do something like that. That plugin, in fact, could be made into a general purpose POST/GET catcher - anything posted to the plugin could get autopopulated - although I think I'd rather have only specific values inserted rather than random values updated.

BTW, since IWS plugins are really just Python code, anyone can write them - and any of the plugins you download will have the source clearly visible/editable (including LWC) so it doesn't take us doing anything - rename and update the LWC plugin as you (or anyone else) sees fit.

_________________
Jay (Indigo Support)
Image


Tue Feb 09, 2010 10:37 am
Profile WWW

Joined: Jun 16, 2008
Posts: 46
Location: Canada
Post Re: Getting weather data from Weather Display
I downloaded the plugin. If I edited it, would it be just the reqhandler to localize to WD and save? I would like to offer to test it with WD if the developer offers a solution. Looks like just changing the param = "LWC_" , the llogmessage = "LWC ... and the self._log method, EDIT - &change the folder name (port) to WD and the url from the sender to the new port, and save? It can't be that easy? :) Then I would resubmit it to you for review if that is acceptable?


Tue Feb 09, 2010 11:14 am
Profile WWW
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 8357
Location: Austin, Texas
Post Re: Getting weather data from Weather Display
jimM wrote:I downloaded the plugin. If I edited it, would it be just the reqhandler to localize to WD and save? I would like to offer to test it with WD if the developer offers a solution. Looks like just changing the param = "LWC_" , the llogmessage = "LWC ... and the self._log method, and save? It can't be that easy? :) Then I would resubmit it to you for review if that is acceptable?


LOL - it's been a really long time (>1 week) so I had to go refresh my memory. Apparently, I did make it quite generic. Pretty much any post/get that comes into the plugin will result in a new variable created with "LWC_" prepended to the name or if it exists the value updated. I did it this way so that I could easily add more values as LWC introduces them without having to rev the plugin.

So, yes, I'd change lines 13, 39, 56, and 61 in reqhandler.py. Everything else should just work, and those lines are only changing strings. Be sure to rename the folder from lwc to something else (no need to mess with ports - from IWS perspective it's just another document in the tree). So, if you named the plugin folder "wd", then your url would be:

Code: Select all
http://host:port/wd/importData?...


same host:port as you use to connect to IWS to begin with.

Once you're satisfied it works, then package it up just like the LWC zip file that you downloaded and submit it to the library for anyone to use - it'll be a very welcome addition. This type of mechanism is a wonderful way of getting data into Indigo - no scripts or anything else to muck about with - just install the plugin. The rest is left up to configuring the other end.

If you check out the ReadMe that comes with the LWC plugin, you'll see an example of what a GET would look like. Cherrypy makes it so that it will work for either GET parameters OR POST parameters with no code change.

_________________
Jay (Indigo Support)
Image


Tue Feb 09, 2010 11:35 am
Profile WWW

Joined: Jun 16, 2008
Posts: 46
Location: Canada
Post Re: Getting weather data from Weather Display
Jay, got it. Wow.

Ok, I will go on over to the WD forum and see what might be done to get the url sent out with selected parms. I am metric so I think this will be a great test experience, as I believe WD can send out in the user's internal settings on all the data from seeing the Weather Underground and other urls.
EDIT - lol, just for my own sleep enhancement , IWS is Indigo Web Server right?
Talk soon.
Jim


Tue Feb 09, 2010 11:40 am
Profile WWW
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 8357
Location: Austin, Texas
Post Re: Getting weather data from Weather Display
jimM wrote:IWS is Indigo Web Server right?


Exactly.

_________________
Jay (Indigo Support)
Image


Tue Feb 09, 2010 11:55 am
Profile WWW

Joined: Jun 16, 2008
Posts: 46
Location: Canada
Post Re: Getting weather data from Weather Display
host:port - 127.0.0.1:8176? (I am getting auth failures)

EDIT - scratch that. I don't think I need the user id and pass, but the host and port should be localhost or 127.0.0.1 and port - 8176 right? (if default port is selected)


Tue Feb 09, 2010 12:43 pm
Profile WWW
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 8357
Location: Austin, Texas
Post Re: Getting weather data from Weather Display
jimM wrote:host:port - 127.0.0.1:8176? (I am getting auth failures)


Post the relevant Event Log entries (and, if you're trying it from Safari, what Safari says). Try this URL in Safari:

Code: Select all
http://127.0.0.1:8176/lwc/importData?&stuff=fun


If it works, Safari will show "OK" and the variable will be created. Note, you'll get an error in the log that looks like this:

Error variable "LWC_stuff" not in database -- adding

But that's OK - we really should make that information rather than an error.

_________________
Jay (Indigo Support)
Image


Tue Feb 09, 2010 12:52 pm
Profile WWW

Joined: Feb 24, 2009
Posts: 182
Location: Calabasas CA
Post Re: Getting weather data from Weather Display
jimM wrote:Jay, got it. Wow.

Ok, I will go on over to the WD forum and see what might be done to get the url sent out with selected parms. I am metric so I think this will be a great test experience, as I believe WD can send out in the user's internal settings on all the data from seeing the Weather Underground and other urls.
EDIT - lol, just for my own sleep enhancement , IWS is Indigo Web Server right?
Talk soon.
Jim


i have made a post on WD "windy" the programer is going to install the get post url into the mac version soon. :D


Tue Feb 09, 2010 1:16 pm
Profile WWW

Joined: Jun 16, 2008
Posts: 46
Location: Canada
Post Re: Getting weather data from Weather Display
jay wrote:
jimM wrote:host:port - 127.0.0.1:8176? (I am getting auth failures)


Post the relevant Event Log entries (and, if you're trying it from Safari, what Safari says). Try this URL in Safari:

Code: Select all
http://127.0.0.1:8176/lwc/importData?&stuff=fun


If it works, Safari will show "OK" and the variable will be created. Note, you'll get an error in the log that looks like this:

Error variable "LWC_stuff" not in database -- adding

]But that's OK - we really should make that information rather than an error.

Code: Select all
 2010-02-09 3:13:03 PM
  WebServer          undefined page requested "http://localhost:8176/wd/importData" from 127.0.0.1

2010-02-09 3:19:49 PM
  WebServer          undefined page requested "http://127.0.0.1:8176/wd/importData" from 127.0.0.1


That's all I get. Checked the default port is selected 8176. (Safari 4.04) I changed the namee of the folder to wd, and edited all the lines as directed, using WD.


Tue Feb 09, 2010 1:25 pm
Profile WWW

Joined: Jun 16, 2008
Posts: 46
Location: Canada
Post Re: Getting weather data from Weather Display
I figured it out. If I do all the changes and rename the folder to wd and place it in plugins, it won't work. BUT if I rename the folder back to lwc, everything works fine. Is there something hard coded in Indigo about the lwc folder?

EDIT - this HAD to be a finder issue. After renaming back to wd, deleting the vars and restarting the server again, everything worked! added 4 more vars just for good measure.

I am going to put it on another mac here and run the url test again but as it now stands we do have a working plugin!

:)


Tue Feb 09, 2010 1:57 pm
Profile WWW
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 8357
Location: Austin, Texas
Post Re: Getting weather data from Weather Display
Excellent. Now to get it added to WD and you're good to go.

_________________
Jay (Indigo Support)
Image


Tue Feb 09, 2010 2:10 pm
Profile WWW
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 13241
Location: Texas
Post Re: Getting weather data from Weather Display
jimM wrote:I figured it out. If I do all the changes and rename the folder to wd and place it in plugins, it won't work. BUT if I rename the folder back to lwc, everything works fine. Is there something hard coded in Indigo about the lwc folder?

You might just need to tell the IndigoWebServer to restart. You can do that without restarting Indigo by requesting this URL from IWS::

http://127.0.0.1:8176/indigocommand?name=restart

That URL will probably return an error because it restarts the Web server, but you can watch the Indigo Event Log window to see if it worked. It can take a few seconds for it to shutdown before it restarts.

_________________
Image


Tue Feb 09, 2010 8:04 pm
Profile WWW

Joined: Jun 16, 2008
Posts: 46
Location: Canada
Post Re: Getting weather data from Weather Display
Hi all, I know it's been a while. Just wanted to give a progress report.

The Indigo-Weather Display Mac plugin is complete and ready for prime time! :) . Also the Weather Display developer (Brian Hamilton) has added the feature to WD Mac and it has been running smoothly here for a few days now on one minute updates. During the initial testing not only was the Indigo-Weather Display plugin able to accept WD data locally, but testing on the feature allowed regular updates to the variable on my server from the test site in NewZealand (Nova Scotia to NZ - 9500 miles) with just a change in the url and the Indigo server accepted it using it's built in authorization.

The plugin will allow the user to select any of the more than 2,000 data points/fields in Weather Display and communicate them to Indigo variables live , either running on the same machine or remotely (across the LAN or WAN) to another Indigo equipped server, at intervals ranging from one minute, to 5 10, 15, 60 minute cycles, or at custom times selected by the user. Again any field from temp, to rain, to records, to FWI to days since last rain/rain this week/solar percent (using your solar sensor to tell if it's cloudy or sunny for drapery controls or if it's really dusk versus timed dusk in cloudy weather) right on down the line, can be added to customize the environmental data required to trigger events with Indigo. I tested with 15 data points at a time so there is lots of room for multiple parameters (both real time and historical data) to be monitored so it is very flexible and open to customization.

Will get the plugin polished up in the next day or so and submit for your approval and posting.

All the best
Jim


Sat Mar 06, 2010 4:27 pm
Profile WWW

Joined: Feb 24, 2009
Posts: 182
Location: Calabasas CA
Post Re: Getting weather data from Weather Display
Thanks Jim,

And brian for writing the code into WD indigo now has it's own tab :D
also since this thread was started WD has quite a few improvement it now runs using only 91mb of ram compared to 1 month ago it took 380mb.

Brian just like Matt and Jay are programers that listen. Thanks


Sat Mar 06, 2010 8:30 pm
Profile WWW
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 13241
Location: Texas
Post Re: Getting weather data from Weather Display
That is great news. Thanks for working on this and coordinating with Brian!

_________________
Image


Sun Mar 07, 2010 10:05 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 60 posts ]  Go to page: Previous  1, 2, 3, 4  Next

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.