Announcement

Collapse
No announcement yet.

Daily Rainfall figure doesn't match actual

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

    Daily Rainfall figure doesn't match actual

    Hi Michael. The rain figures in my system don't match what has really fallen on the ground. They always seem to be about 1/10 of actual. Consequently, the system doesn't properly take rain into account for irrigating.

    I'm using:
    HS4
    McsSprinklers Pro 2.22.0.7
    Rain data comes from Weatherstack
    Measurements are set to metric

    Here's an example from yesterday (data is from Environment Canada):
    Click image for larger version

Name:	Screenshot 2022-06-13 111454.png
Views:	103
Size:	154.6 KB
ID:	1551903
    Actual rainfall yesterday was 17.9 mm.


    And yet rainfall for yesterday only shows as 2 mm.

    Click image for larger version

Name:	Screenshot 2022-06-13 110640.png
Views:	106
Size:	209.6 KB
ID:	1551902


    And in this screen it shows as zero rainfall yesterday.

    Click image for larger version

Name:	Screenshot 2022-06-13 110732.png
Views:	114
Size:	60.5 KB
ID:	1551901

    You did some work on this last season to get rainfall from Weatherstack which was one of the last to provide it free. Is it possible you've got the metric conversion off by a factor of 10 or something? Thanks!

    #2
    Did you have debug enabled during this period? That will be the easiest to investigate. Weatherstack does have an 8 download per day constraint. Is that consistent with the daily download limit in your setup? I suspect if more downloads are attempted then Weatherstack will not return data.

    Comment


      #3
      Yes, Weatherstack is set to 8 downloads per day. While debugging today I realized debug was not turned on so unfortunately I don't have any logs for yesterday. It is turned on now.

      Comment


        #4
        I looked at the code and it appears that a conversion to metric was not done for this provider current weather. I would expect to see the temperature and windspeed also having similar issue. Do you have Weatherstack selected for Temp and Wind and if so can you confirm the numbers are skewed too?

        Comment


          #5
          I only have WeatherStack providing rain data, so can't say about wind and temperature. But looking at the WS website, it seems that the rain is sent in mm so is a conversion required? Maybe not.

          Comment


            #6
            The attached contains the conversion. Unzip into \bin\mcsSprinklers folder. When downloading via API the request contains metric vs. non-metric parameter. I do non-metric to try to standardize all provider's data. For rainfall, some do CM and other do MM so a conversion process may still be needed.
            Attached Files

            Comment


              #7
              22.2.0.7 is the same version # that I downloaded and in stalled from a different thread a few days ago. Is that right or did the wrong one get posted here?

              Comment


                #8
                And one more thing that seems odd. The hourly rain amounts don't add up to the total that is shown for the day. It seems like it takes the first non-zero amount and uses it for the daily total. For example, the chart on the right came from clicking May 28 on the chart on the left:

                Click image for larger version

Name:	Screenshot 2022-06-14 165924.png
Views:	86
Size:	220.5 KB
ID:	1552182

                Comment


                  #9
                  I am on the verge of submitting an upate to HS for mcsSprinklers so I do not want to change the version number as this would ripple into many things and likely I would miss one of them. While the version number of the attached did not change, it was updated. I am assuming that this is a very localized variance.

                  Weatherstack API does not specify the interval of time for which the reported precipitation applies. It is really a mess with the various providers. Some give hourly, some over last three hours, some give for the day. mcsSprinklers logic is based upon daily rainfall so I suspect the annual data is queried as the max rainfall for a specific day. This should be the same as the last hour rainfall accumulation for the day or the MAX for the day.

                  I did not look, but I suspect that the hourly numbers are based upon what has been recorded from queries of the site. Since only eight queries are allowed in a day on the free plan there will be no change between queries. If Weatherstack is giving hourly data and prohibiting free access except every three hours, then there will be significant issues with the validity of the data. Obviously, they are in the business of making money rather than providing data for free. It has been quite a while since I did the analysis of the current internet weather data providers, but whatever I discovered then had been documented in mcsSprinklers.pdf.

                  What do you have setup for rainfall interval being reported from Weatherstack?

                  Comment


                    #10
                    That all makes sense - thank you!


                    Originally posted by Michael McSharry View Post
                    What do you have setup for rainfall interval being reported from Weatherstack?

                    I'm not sure I understand your question, but if you mean how often does Weatherstack update, I have it set to max 8 downloads per day, so once every 3 hours.

                    You've probably seen that Dark Sky is shutting down on March 31, 2023 and being replaced by Apple WeatherKit which they claim to be global coverage and 50k free downloads per month. Knowing how apple does things, it might be a nice reliable platform to base irrigation on. More details here: WeatherKit Overview - Apple Developer

                    Comment


                      #11
                      When I look at my rainfall sensor for the current day I see an accumulation of 0.58 inches at this time. The hourly values are incremental. This implies to me that your setup for Weatherstack is expecting daily rainfall and it is providing hourly (or some other interval). This being the case, with only 8 updates in the day, you do not have the opportunity to determine the daily rainfall from this source. You will just get 8 updates that look to be hourly amounts. While the option is available in the setup of mcsSprinklers, it is not a viable one. Suggest reviewing mcsSprinklers.pdf to see if a better rain-only provider is available.

                      My setup is below, but uses a local rain sensor. mcsSprinklers uses Daily totals and tries to convert whatever input is provide to a daily total amount. In my case the sensor reports the rainfall since the sensor was installed so mcsSprinklers looks for the delta amount since each midnight.

                      I will look into the provider you referenced for a future update.

                      Click image for larger version

Name:	0.png
Views:	106
Size:	49.5 KB
ID:	1552195

                      Click image for larger version

Name:	1.png
Views:	92
Size:	10.2 KB
ID:	1552196

                      Comment


                        #12
                        I did take a quick look at Apple's takeover of Dark Sky.

                        Support for the Dark Sky weather service will end March 31, 2023. To transition to WeatherKit and continue accessing weather data for your apps, webs apps, websites, and services, you’ll need to be a member of the Apple Developer Program, review special considerations, and map fields to their appropriate names.

                        If you’re a nonprofit organization, accredited educational institution, or government entity, you may qualify for an Apple Developer Program membership fee waiver.
                        I started to go down the path to see what was involved in the Apple Developer Program but decided I did not want to become involved. Not that I disagree with what Apple is doing, but just more hoops that I want to jump. I never got to the point of knowing what the fee would be to join in the Apple Developer Program. It may be good for somebody who wants to get revenue with the Apple affiliation, but I just want to help those who have a common interest and do not have any institutional affiliation to get the fee waived.

                        Comment


                          #13
                          Ok, thanks for checking it out. Too bad its not going to work.

                          When I went through this last year, WeatherStack was the only provider (that you connect to) that had free rain data for Canada. I'm looking at AKWeather to replace my WeatherXML plugin that will die with Dark Sky. It has access to Environment Canada which does have rainfall data for me. If that works, I can connect it to your plugin via a HS device. So that might resolve it for me. I could also just get a local weather station, but I know it's presence would not be welcome in the yard...

                          Any Canadians listening who have found a solution to getting valid rainfall data to McsSprinklers?

                          Comment


                            #14
                            A simple approach is to pull the data from the Canadian site. I just picked Edmonton. The URL is the first line and the report follows Total Precipitation. You could populate a HS device using a simple script. I can do the script for you if you are interested. It means the soil moisture adjustment would occur once per day at the hour you ran the script. In this case it shows 41.4 mm.

                            Code:
                            https://weather.gc.ca/city/pages/ab-50_metric_e.html
                            
                            Total Precipitation:
                            
                            <span class="wxo-metric-hide">41.4<abbr title="millimetres">mm</abbr></span>

                            Comment


                              #15
                              Originally posted by Michael McSharry View Post
                              A simple approach is to pull the data from the Canadian site. I just picked Edmonton. The URL is the first line and the report follows Total Precipitation. You could populate a HS device using a simple script. I can do the script for you if you are interested. It means the soil moisture adjustment would occur once per day at the hour you ran the script. In this case it shows 41.4 mm.

                              Code:
                              https://weather.gc.ca/city/pages/ab-50_metric_e.html
                              
                              Total Precipitation:
                              
                              <span class="wxo-metric-hide">41.4<abbr title="millimetres">mm</abbr></span>
                              Michael, this is awesome! That would be a great way to resolve my last issue to making your plugin work perfectly for me. I have written several elementary vb.net scripts, but have never done anything with URL's. You've always been so helpful so I hate to make more work for you, but if you could help me with a script, I would be forever grateful!

                              Comment

                              Working...
                              X