Announcement

Collapse
No announcement yet.

New OpenSprinkler Plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #46
    Originally posted by frankc View Post
    wow... grass looks great, but how in the world would you figure the ET for that? If the angle of the sun is an issue in figuring the solar radiation, what happens when the land is angled away from or toward the sun. Seems like there would be an effect.
    I too would think that there would need to be an adjustment to the solar radiation figure based on not just the slope angle but also the direction of the slope. The slope in the photo above is about 20 degrees downward in a north easterly direction. So, if anything, a solar radiation measurement would effectively be even lower, similar to how it would be for solar panels mounted at the same angle and facing the same direction:

    http://www.pveducation.org/pvcdrom/p...ation-and-tilt

    Comment


      #47
      Originally posted by frankc View Post
      I used ActivePython-2.5.5.7-win32-x86.msi. I put that and other information in the script. (you also need simple json). I had read on this board that was the only version that would work. So that is the only version I tried. And as of a week ago, I had never messed with python. But it is very similar to visual basic I think. I think you will find it easy to learn. I've learned enough in a week to do enough.

      I need to get a raspberry pi. They look interesting. I've messed with an arduino a little. My sprinklers are controlled from a webControl board.
      Where exactly do I put the simplejson files so that activePython will be sure to find them? There's no simplejson installer. It's just a bunch of files.

      BTW, ActivePython version 2.5.5.7 (community edition) is no longer available on the activePython website because it is no longer the current version. Are you using the community version or one of the paid-for versions? Or is there a secret location where it can still be downloaded? I did download the current 32-bit community version, version 2.7.8.10. I updated your script to use my free weatherunderground key (which allegedly does have historical data access), but unfortunately your script choked when I tried running it:

      ActivePython 2.7.8.10 (ActiveState Software Inc.) based on
      Python 2.7.8 (default, Jul 2 2014, 19:50:44) [MSC v.1500 32 bit (Intel)] on win32
      Type "copyright", "credits" or "license()" for more information.
      >>> ================================ RESTART ================================
      >>>

      Traceback (most recent call last):
      File "C:\Users\David\Downloads\homeseer python script\ET-master\ET-master\et4a_v001.py", line 391, in <module>
      getHistoricalData(forecast)
      File "C:\Users\David\Downloads\homeseer python script\ET-master\ET-master\et4a_v001.py", line 161, in getHistoricalData
      cachefile = open("data/" + datestring, 'w')
      IOError: [Errno 2] No such file or directory: 'data/20141005'
      >>>

      Not sure if it's choking because I'm using more current version of ActivePython than 2.5.5.7, or whether that's unrelated. I also tried running the same script using the 64-bit ActivePython, but the result was the same. I also tried running the original poster's python script, and it choked in the same spot (although on a different date).

      Just to confirm my assumptions: are you also running Python under Windows? I'm assuming so, if only because the ActivePython reference you gave me was for a windows version. I could try running Python on a raspberry pi to see if perhaps the "file or directory" problem above is because of my using a Windows rather than linux environment.
      Last edited by NeverDie; October 10, 2014, 12:23 PM.

      Comment


        #48
        Hi there ND.

        I am running the script on Windows XP. The reason I am using XP is I have a video capture card that only has drivers for XP.

        I did just find the Active Python file. I searched for:
        ActivePython-2.5.5.7-win32-x86.msi and found it. It is free. If the link below works (if not, let me know), you will need to click on "View raw file". It asked me whether I wanted to save it. It is 24 MB. You will also need SimpleJSON. I have entered that information in my script.

        https://code.google.com/p/common-cod...2-x86.msi?r=96

        I have made 100's of changes to my script. And it is much longer than before. Dave, the author, and I worked quite a bit two days ago calibrating the script. I used the data from Dallas to do that using one of the links you posted. I'll update the github thing today with mine. His would not run on my PC. It wasn't written for the version of Python that will run on Homeseer.

        I am hoping that HS3 will run Python, but haven't heard anything in that regard. Python version 2.5 is old!

        Again, per your link, I emailed the folks at A&M and asked for their script to calculate ET. They said it wasn't within their policy to do so. I plan to email them back and explain it seems odd to me that they have posted on their website that they want to increase the public's awareness of the need to use ET. How are people supposed to do that if they have no software?

        Comment


          #49
          Good news: it breaks in a different spot, and in a way that should be easy to fix, as this time around ActrivePython simply isn't finding the simplejson files it needs to import.

          PythonWin 2.5.5 (r255:77872, Jan 31 2010, 15:49:35) [MSC v.1310 32 bit (Intel)] on win32.
          Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information.
          Traceback (most recent call last):
          File "C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript
          exec codeObject in __main__.__dict__
          File "C:\Users\David\Downloads\homeseer python script\ET-master\ET-master\et4a_v001.py", line 21, in <module>
          import simplejson as json #simplejson needed for Pyton 2.5
          ImportError: No module named simplejson
          >>>

          Where exactly do I put the simplejson files so that activePython will be sure to find them? Or, more simply, where did you place yours? There's no simplejson installer. It's just a bunch of files. I'm not sure what filepath activePython might use when it tries to find them for the import.
          Last edited by NeverDie; October 10, 2014, 01:30 PM.

          Comment


            #50
            Originally posted by frankc View Post

            Again, per your link, I emailed the folks at A&M and asked for their script to calculate ET. They said it wasn't within their policy to do so. I plan to email them back and explain it seems odd to me that they have posted on their website that they want to increase the public's awareness of the need to use ET. How are people supposed to do that if they have no software?
            I take it as reason for hope that that they even replied to your query, even if it was only to officially slam the door. You might try pointing out that by posting the code they leverage the power of the internet by getting free eyeballs to scour their code for possible errors and, if there are any, they may even get the fixes for free without having to make any further effort on their own. As it stands, their code could be erroneous, but how would anyone even know? They could also avail themselves of any improvements that might similarly arise. That sort of thing happens all the time, and it's a large factor in what's driving open source to be such a big phenomenon. If they don't want to be bothered fielding questions, maybe they can just put it up on github and largely forget about it. If they don't know how to do that, you could offer to post it for them, as you've obviously figured it out. Also, their own students may find it to be of educational value, which is generally part of an academic institution's broader mission, especially in this case: ET is of obvious relevance to agricultural studies. If they read and understand these arguments and are open to reason, they will see how de-cloaking their code has potential benefits to them, and then perhaps they'll reconsider your request more favorably from that self-interested perspective, especially if it requires little to no effort on their end to make it happen. On the other hand, if their code is so poorly written that they're afraid of career suicide and/or massive embarrassment if it ever became in any way public....I'm not sure how to get past an unspoken concern like that, but it might also be their true reason for stonewalling.
            Last edited by NeverDie; October 10, 2014, 02:03 PM.

            Comment


              #51
              I didn't take notes when I installed SimpleJSON. Although it seems it happened easily. Perhaps I just clicked on setup.py from my downloads directory ? I hope that works. If so, let me know and I will add that info to my script.

              I agree with your assessment of A&M's policy. The odd thing is they wrote a 'friendly' explanation of ET and stated that it needs to be used more. I'll email them now. They had emailed me twice and the fact that they post that data is great!

              Comment


                #52
                I moved the simplyjson files to the c:\python25\lib directory, and ActivePython seems to find them now.

                However, it's back to square one, as it now breaks again where it did before before I downgraded to ActivePython 2.5.5.7:

                PythonWin 2.5.5 (r255:77872, Jan 31 2010, 15:49:35) [MSC v.1310 32 bit (Intel)] on win32.
                Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information.
                Traceback (most recent call last):
                File "C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript
                exec codeObject in __main__.__dict__
                File "C:\Users\David\Downloads\homeseer python script\ET-master\ET-master\et4a_v001.py", line 391, in <module>
                getHistoricalData(forecast)
                File "C:\Users\David\Downloads\homeseer python script\ET-master\ET-master\et4a_v001.py", line 161, in getHistoricalData
                cachefile = open("data/" + datestring, 'w')
                IOError: [Errno 2] No such file or directory: 'data/20141005'
                >>>

                I'm running on Windows 7 Ultimate. I'm running simplejson 3.6.4 instead of the 3.6.3 that you referenced, again because that's what's available because it's what's current.

                I just now tried adding a "data" directory under Python25. It now runs without the above error, but now ActivePython just vaguely says "failed to run script - syntax error - invalid syntax." It doesn't say where.

                Argh.. It's probably something obvious to anyone with python experience, but at the moment I have none. Therefore, I may have to return to this at a later date to get it sorted, as presently I'm just spinning my wheels without getting traction.
                Last edited by NeverDie; October 10, 2014, 04:13 PM.

                Comment


                  #53
                  Originally posted by NeverDie View Post
                  Argh..
                  I don't recall why I downloaded the version of SimpleJSON I downloaded, but it is available - I just got it a week or so ago. So you might try to go to that version, although, I doubt that is the issue.

                  Are you using the original script aka Dave's? I'm thinking that one also needs the directory 'Water' in the Scripts subdirectory.

                  Also, I can run the script from the command line at the Scripts directory just as easily as from Homeseer. Well, if you are using his, you won't be able to run it from Homeseer. Actually, without modifications to his, you can't run his from anywhere with Python 2.5.

                  I don't recall ever getting an error that Python didn't elaborate on.

                  Comment


                    #54
                    Originally posted by frankc View Post

                    Are you using the original script aka Dave's?
                    It gives the same error, but in addition it also says ">>> C:\Users\David\Downloads\ET python script\versions\getWeather_v001.py:111: Warning: 'with' will become a reserved keyword in Python 2.6" That may at least partly the explain the problem with running that python script on a later version of python.

                    I believe the line it may be referring to is:
                    with open("water/" + datestring) as f:
                    because it parks a flashing cursor on that line when the error occurs.

                    Comment


                      #55
                      Originally posted by frankc View Post
                      I don't recall why I downloaded the version of SimpleJSON I downloaded, but it is available - I just got it a week or so ago. .
                      Version 3.6.4 was uploaded on 9/29/2014, so I'm guessing shortly after you downloaded 3.4.3. It does claim though that it "maintains backwards compatibility with Python 2.5." (
                      https://pypi.python.org/pypi/simplejson/)

                      Comment


                        #56
                        With open does not work with 2.5. I learned last night that it actually will with another module import. but not without that import.


                        But I too had that problem when I first tried run dave's script. I just rem'd that section out. More recently, I replaced that section completely. That was where his controller updated that day's watering. My controller sends An email to report its watering. So my script gets that email and saves the data to a directory.

                        It's difficult getting this stuff to work while you learn python. A week ago or so, I thought a python was something that slithered.

                        Comment


                          #57
                          I notice that weatherunderground has added quantified precipitation predictions to its forecasts:

                          Click image for larger version

Name:	precip.png
Views:	1
Size:	73.1 KB
ID:	1174994

                          As you can see in the picture, WU thinks there will be 0.25" of rain on Monday.

                          For irrigation planning purposes, that's obviously much more useful than only knowing the chance of rain (which is defined as the probability of 0.01" of rain or greater).

                          Anyone happen to know if this quantified precipitatio forecast is available through the free WU api? Accuweather has had these quantified precipitation predictions for some time now, although I don't know whether Acuweather has a free api like WU does.

                          Once I get up to speed on python, it will be interesting to start tracking WU predictions (and, if easy, those made by other weather sites too) against what actually happens. That way, for automated irrigation planing purposes, I'll know better what the accuracy is and which website is the most accurate forecaster.
                          Last edited by NeverDie; October 13, 2014, 07:45 AM.

                          Comment


                            #58
                            I bet you are right. The Python script does get this figure from WU and assigns the figure to a variable "forecast". Also gets the chances of precipitation for today and tomorrow. I have the script set such that if either chance is 40% or more, there will be no irrigation. But, I am not using the qpf figure. I need to fix that. Maybe reduce the amount of irrigation by that qpf figure? I hadn't realized the significance of it.

                            I now have the Python script telling Homeseer which of 10 schedules to use. I created 10 events: 1 mm, 2 mm, 3 mm... up to 10 mm. The actual number of minutes range from 15 to 146. So Python has Homeseer enable one of those and disables the rest. I think that should work. Things are set up to have it work tomorrow.

                            Comment


                              #59
                              Here is what I don't understand about pop and qpf:

                              This is for tomorrow:
                              "pop":0,
                              "qpf_allday": {
                              "in": 0.51,
                              "mm": 13
                              so there is a 0% chance of precip. But prediction is half an inch of rain.

                              For the next day:
                              "pop":90,
                              "qpf_allday": {
                              "in": 1.57,
                              "mm": 40
                              That makes more sense to me: 90% chance and 1.57" predicted.
                              ??

                              Comment


                                #60
                                Originally posted by frankc View Post
                                Here is what I don't understand about pop and qpf:

                                This is for tomorrow:
                                "pop":0,
                                "qpf_allday": {
                                "in": 0.51,
                                "mm": 13
                                so there is a 0% chance of precip. But prediction is half an inch of rain.
                                I agree it doesn't make sense. i.e. it would seem to be self-contradictory. Are those actual numbers that currently appear on the WU website?

                                pop = probability of precipitation
                                qpf = quantified precipitation forecast

                                Just a wild guess, but I suppose it might come about as an infrequent glitch if WU used one model/methodology to compute pop and a completely different model/methodology to compute qpf. Maybe then, because the two models don't completely agree with each other, you could get anomalies like this. However, I don't see how it could happen if pop and qpf were derived from the same forecast model.

                                I haven't myself run across an anomaly like the one you posted, but I had been looking at accuweather, not WU, because until today I didn't notice WU having a qpf.
                                Last edited by NeverDie; October 11, 2014, 10:10 PM.

                                Comment

                                Working...
                                X