Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temperate Area Weather Adjustments - eg UK #180

Open
cebab54 opened this issue Jul 14, 2020 · 11 comments
Open

Temperate Area Weather Adjustments - eg UK #180

cebab54 opened this issue Jul 14, 2020 · 11 comments

Comments

@cebab54
Copy link

cebab54 commented Jul 14, 2020

Hi

The Weather adjustments appear to reflect Continental Weather Patterns like the USA or Europe, but do not work for Temperate Weather Regions such as the UK (latitude 51+), where our weather is influenced as an Island by the Seas around us.

The average Humidity of 30% and the Average temperature of 70F are too low and too high. In this respect the standard weather here in the UK adjustments are 'drastic' compared to what would be reasonable. ie yesterday the adjust was 24%, which meant that the soil dried out too much (especially in containers).

I see that in weather.h the 30% Humidity Baseline is defined on line 14. This is easily updated in weather.h

However the baseline temperature is hardcoded in weather.cpp. I have amended this by adding an additional line in weather.h (line 15) to read:
#define SUMMER_TEMP 63 // 63 is average summer temp in UK South East (June - August)
and in weather.cpp I amended line 45 to read:
const int temp_factor = (vals.meantempi - SUMMER_TEMP) * 4;

These amends create a much more meaningful adjustment on normal days here without any precipitation adjustment.

I will need to look at the adjustments when we have rain, which is relatively rare in the UK during summer, apart from heavy downpours during thunder storms.

Clearly the need for adjustments are also dependent upon soil type and permeability. For example London Clay when dried out will not absorb very much moisture when rain is light. At the moment this factor does not seem to be taken into account, but equally I accept that this is rather difficult to allow for!

Hope this helps

@cebab54
Copy link
Author

cebab54 commented Jul 14, 2020

Today these adjustments give me an 89% adjustment rather than the standard 26%, which otherwise leave the plants too dry here in the UK

@cebab54
Copy link
Author

cebab54 commented Jul 14, 2020

Even better would be to allow users to amend the base parameters for the weather adjustment formula in the Settings page please.

This would more easily allow latitudinal adjustments and Climate types to be readily accommodated by users that are not willing to delve into the coding.

Andrew

@nhorvath
Copy link
Collaborator

Thank you for the comments. I think for basic users the base seasonal adjust could work for them, but I will add your compile variable.

@cebab54
Copy link
Author

cebab54 commented Jul 14, 2020

Thank you.
I guess the only other suggestion would be to relocate the Weather Compile variables into settings.h rather than weather.h with other #defines that a user might want to adjust so that there is only one file to amend. It would also be easier to document in the WIKI?

By the way I looked into the Met Office weather data and the free data available from them does not include rainfall data. Although the UK Government does have an free to use API that provides hourly rainfall from a network of thousands of official Rain Gauges spread across the country. Having monitored this data and the output from OpenWeather, OW appear to use this data to populate their API, so I gave up on adding code to get the Met Office API data into Sprinklers_PI. That said I did get a much better understanding of a Weather JSON file!

One matter for the WIKI would be to add that when using OpenWeather the Location must be entered on the Settings page as Latitude, Longitude coordinates rather than the place name and country code that the native API allows. I thought that the API was failing first until I realised that Sprinklers_PI will not allow the Place Name and Country to be used. Works fine once I used the Latitude and Longitude coords.

Certainly for Open Weather, I have now amended settings.htm in the web folder to read:
Location (Latitude, Longitude):

Thanks again

Andrew

@cebab54
Copy link
Author

cebab54 commented Jul 14, 2020

Hi

I have just tried the Seasonal Adjustment slider on the Settings Page and it seems to have no effect whatsoever on the Weather Adjustment. Wherever I place the slider, the adjustment reported when the Weather data is queried stays stubbornly the same.

Looking at the code in weather.cpp I am not sure where this adjustment takes place. If it works, it certainly isnot reflected in the reported adjustment on the 'Weather Provider Check' page. Or am I missing something? I have never really understood the meaning of this slider adjustment (out of the box set at 100) and have only today tested it after your comment above. It also does not seem to be documented in the WIKI as far as I can see.

Andrew

@cebab54
Copy link
Author

cebab54 commented Jul 14, 2020

Interestingly, the OpenWeather Data returned from the Latitude, Longitude coords as follows is different, although the coordinates equate to the same position on google Maps:
51.394529, -0.001426
and
51°23'40.3"N 0°00'05.1"W

Now that I do not understand

@nhorvath
Copy link
Collaborator

Seasonal Adjustment is a static adjustment to the whole calculation. If after weather adjustment you come up with 10 mins of watering and you have seasonal adjust at 150% it will water for 15 mins.
The latitude/longitude is documented in the Readme (that shows on the main page of github). The wiki is probably written against wunderground and hasn't been updated in a while.

@cebab54
Copy link
Author

cebab54 commented Jul 18, 2020

Hi again

I haven't yet delved into the code, but using Open Weather, the reported weather from the API request is reported 24 hours out of synch. Today has been bone dry, yet the weather check is reporting yesterday as dry and today as 0.2"/5.2mm precipitation. In fact tomorrow is forecast on Open Weather as 5.2mm rain and today no rain recorded or forecast.

If nothing else the titles on the WCheck.htm page needs amending. However looking at the adjustment made I think the wrong data is being used to calculate the adjustment. Also if the factorisation is in the range 91-100% i have noticed no actual adjustment is made. Is the adjustment rounded to the nearest 10%? Or maybe the confusion has arisen from the fact that as I suspect the wrong days data is being permed from the JSON data?

I will post some screen grabs below when I get back to my PC

Thanks.

Andrew

@cebab54
Copy link
Author

cebab54 commented Jul 18, 2020

Please see below details of Weather Provider check and adjustment, which reports yesterdays info in detail, but that is more correctly today's weather, and today is tomorrow's forecast as noted in the comment above.

image

The following screen grab is from one of the local weather stations from which this data is derived and it clearly shows no rain today and approx 5mm rain tomorrow. Certainly it has been bone dry today and all the weather forecasts agree about that, as well as rain tomorrow:

image

Finally, here are the logs for the past week which show factorised adjustments against a normal 5 minute run time for this zone (shown on line 1).

Here the 24% gets rounded down to 20% whereas the 94% gets no adjustment and the 89% gets rounded down to roughly (a tad over) 80%. That said, the 109% adjustment is not applied at all and has defaulted to the standard schedule time of 5 minutes.

image

Can you please advise where in the code the adjustments are made to the schedule, so that I can see how the factorised adjustment is made?

Thanks

Andrew

@cebab54
Copy link
Author

cebab54 commented Aug 11, 2020

It seems that the term 'yesterday' is not quite correct? Through the day yesterdays results change as reported bu Sprinklers_pi. Does that mean it is in fact reporting on the last 24 hours rsther than strictly yesterday?

@nhorvath
Copy link
Collaborator

I'm pretty sure it's related to timezones. My available time to work on this project has been non existent for the past few months and I'm not sure when that will change. Sorry.
If you have an urgent need maybe try aeris weather. They do have a free tier, you just need to renew it occasionally. That implementation is more mature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants