Open Weather map

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
Derik
Posts: 1605
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Open Weather map

Post by Derik »

See something new[ for me than ] Open Weather map:
ScreenShot078.jpg
ScreenShot078.jpg (94.38 KiB) Viewed 7013 times
Only is there some one that can explane this thing to me.

I now that i need a account.
Only i do not understand how i get this script to work..
It is not a time or a device .lua.
Do i need a Crontab?

And do i need for all device a new IDX or can i get all the data in 1 sensor? [ what type? ]
ScreenShot079.jpg
ScreenShot079.jpg (29.71 KiB) Viewed 7013 times
Or do some one have a example script with all the [ max ] options.

Thanks
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
gizmocuz
Posts: 2712
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Open Weather map

Post by gizmocuz »

Hi Derik,

We now have
- AccuWeather (new)
- Weather Underground
- Forcast.IO

this is not sufficient ? or is there data on the openweathermap that is not available in the above 3 ?

As you can see in your last screenshot, it update a temp+hum+baro device, but not correct, as the forecast is always set to 0
You would like to have the forecast as well
This can be created with the 'weather number' value i see in your first screenshot
Quality outlives Quantity!
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Open Weather map

Post by Toulon7559 »

Perhaps this way into OWM is a bit easier: http://bigl.es/using-python-to-get-weather-data/
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Open Weather map

Post by Toulon7559 »

@Gizmocuz

Somewhere for the new Accuweather-entry an instruction/hint how to fill-in the fields for Dashboard/Hardware?
API-key is clear, but what for Name and for Location?
Last edited by Toulon7559 on Wednesday 06 July 2016 12:20, edited 1 time in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Open Weather map

Post by Toulon7559 »

;-) 'Borrowing an example' is easier than 're-invention'.
The OWM-elements in this python script work for extraction of information, and could be used for copy-paste towards another python-script.
[Take care that the attachment is a txt-file, not a python-file!]
Attachments
pvout_upload_from_whzforum.py.txt
Python-file from WHZ-forum
(2.18 KiB) Downloaded 127 times
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Derik
Posts: 1605
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Open Weather map

Post by Derik »

@ Rob,

Almost vacation so sorry for my late response, but when I have vacation ... [busy]
I make up for it.

The reason I want to get OWM working ....
The buienradar is not actual. [ you have seen it... :-) ]
AccuWeather is paid
Weather Underground is not always up to date..
My rain sensor is not accurate enough
Forecast.io is also not always correct.

So my sunshade has been once filled with water .. :-(

And finally because it can ... :-)

And I was hoping for the UV OWM but paid unfortunately ..
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Derik
Posts: 1605
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Open Weather map

Post by Derik »

Toulon7559 wrote:@Gizmocuz

Somewhere for the new Accuweather-entry an instruction/hint how to fill-in the fields for Dashboard/Hardware?
API-key is clear, but what for Name and for Location?
ScreenShot087.jpg
ScreenShot087.jpg (25.71 KiB) Viewed 6924 times
Or:
http://openweathermap.org/api
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Open Weather map

Post by Egregius »

I don't think OWM gives rain prediction.

Code: Select all

{"coord":{"lon":5.85,"lat":51.84},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"base":"stations","main":{"temp":15.24,"pressure":1020,"humidity":93,"temp_min":12.8,"temp_max":20.6},"visibility":10000,"wind":{"speed":3.6,"deg":300},"clouds":{"all":40},"dt":1467787298,"sys":{"type":1,"id":5219,"message":0.0451,"country":"NL","sunrise":1467775584,"sunset":1467834962},"id":2750053,"name":"Nijmegen","cod":200}
I grab outside temperature from OWM, wind speed from OWM and forecast.io, rain predection from buienradar and forecast.io.
The biggest value of both API's is stored in a virtual sensor.
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Open Weather map

Post by Toulon7559 »

Forecast is available in OWM, even with 2 predictionperiods at choice: http://openweathermap.org/forecast5 and http://openweathermap.org/forecast16
Last edited by Toulon7559 on Sunday 14 August 2016 23:11, edited 1 time in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
User avatar
gizmocuz
Posts: 2712
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Open Weather map

Post by gizmocuz »

Toulon7559 wrote:Forecast is avaible in OWM, even with 2 predictionperiods at choice: http://openweathermap.org/forecast5 and http://openweathermap.org/forecast16
I dont think we said that it did not do this ? :D
But the rest of the information is very limited, and as we support 3 other big weather sites, i do not see a reason for the 4th
Quality outlives Quantity!
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Open Weather map

Post by Egregius »

It was I that stated that there's no precipitation prediction at OWM but it appears to be that it's only available in the forecast, not in the actual weather call.
Anyway, stuff like this is easy to handle with a small script and a dummy sensor. Even better, it works as you expect, at the refresh time you want, with only the data you find interesting. Therefore I also don't see the need to implemented this in the core of Domoticz.
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Open Weather map

Post by Toulon7559 »

In my opinion Wunderground and Forecast.io was already more than sufficient for the basic needs for upload and download of weather information.
The limitation to 6 months of use for the Accuweather-API does not speak in favour for that organisation.
;-) OWM itself and the internet offer so many examples that a Domoticz-user should easily find from OWM something applicable for his/her use, to be adapted and implemented by own work.
And for the diehards, plenty more is available for own initiatives .........

Would only be nice, that if somebody makes a nice, working script, that as example it is made available in this forum and/or as part of the Wiki.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Open Weather map

Post by Egregius »

This is my code:
grabs outside temperature from OWM.
And rain prediction from buienradar and forecast.io and stores highest value
Same for wind, from OWM and forecast.io store highest value.
Executed every minute (that's why forecast.io is only pulled from 7:30 till 23:59).

Code: Select all

$owwind=0;$forecastwind=0;$forecastbuien=0;$buienradar=0;
        $openweathermap=json_decode(curl('http://api.openweathermap.org/data/2.5/weather?id=2740729&APPID=ac3485c0bf1a02c81d2525dc6515021d&units=metric'),true);
        if(isset($openweathermap['main']['temp'])) {
            $owtemp=number_format((($s['buiten_temp']*3)+$openweathermap['main']['temp'])/4,1,".",".");
            if($s['buiten_temp']!=$owtemp && $owtemp!=0) {
                print stamp."  --- UPDATE BUITEN_TEMP --- Current = ".$s['buiten_temp']." |  openweather = ".number_format($openweathermap['main']['temp'],1,".",".")." |  new = $owtemp
";
                ud($i['buiten_temp'],0,$owtemp,'buiten_temp');
            }
        }
        if(isset($openweathermap['wind']['speed'])) $owwind=number_format($openweathermap['wind']['speed'],2,".",".");
        if(time>=strtotime('7:30') && time<=strtotime('23:59')) {
            $forecast=json_decode(curl('https://api.forecast.io/forecast/2ee3cxed64ff39afc86fx29285x03310/50.7925552,3.0140885'),true);
            if(isset($forecast['currently'])){
                $forecastbuien = number_format($forecast['currently']['precipProbability']*20,0,".",".");
                $forecastwind = number_format($forecast['currently']['windSpeed'],0,".",".");
            }
        }
        $rains=curl('http://gps.buienradar.nl/getrr.php?lat=50.7925552&lon=3.0140885');
        $rains=str_split($rains,11);$totalrain=0;$aantal=0;
        foreach($rains as $rain){$aantal=$aantal+1;$totalrain=$totalrain+substr($rain,0,3);$buienradar=number_format($totalrain/$aantal,0,".",".");if($aantal==7)break;}
        $newbuienradar = number_format((($s['buienradar'] * 4) + max($forecastbuien, $buienradar)) /5,0,".",".");
        $wind = number_format((($s['wind'] * 4) + max($forecastwind, $owwind)) /5,0,".",".");
        if(number_format($s['buienradar'],0) != $newbuienradar) {
            $msg = stamp."  --- UPDATE BUIENRADAR ---    Current = ".number_format($s['buienradar'],0,".",".");
            if($buienradar) $msg .= "    | buienradar = $buienradar";else $msg .= "            ";
            if($forecast['currently']['precipProbability']) $msg .= "    | forecastbuien = ".number_format($forecastbuien,0,".",".");else $msg .= "            ";
            if($newbuienradar) $msg .= "    | new = $newbuienradar";
            $msg .= "
";
            ud($i['buienradar'],0,$newbuienradar,'buienradar');
            print $msg;
        }
        if($s['wind'] != $wind) {
            $msg = stamp."  --- UPDATE WIND ---        Current = ".number_format($s['wind'],0);
            if($owwind) $msg .= "    | owwind = $owwind    ";else $msg .= "            ";
            if($forecastwind) $msg .= "    | forecastwind = $forecastwind";else $msg .= "            ";
            $msg .= "    | new = $wind
";
            ud($i['wind'],0,$wind,'wind');
            print $msg;
        }
 
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Open Weather map

Post by Toulon7559 »

This discussion triggered me to look in Domoticz to the values/loggings for info coming from forecast.io.
Resemblance with the actual, local measuments is 'doubtful'.
Especially looking at SolarRadiation, I am puzzled, because even at midnight the value is >300W/m^2, and in the logging I see 'hicks' every 4 hours.
Can somebody give a simple explanation for the values and diagrams based on info from forecast.io?
Last edited by Toulon7559 on Wednesday 20 July 2016 23:03, edited 1 time in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Open Weather map

Post by Egregius »

There are even hicks in the temperature. One minute it's 16.2 degrees, a minute later 17.2, and another minute later again 16.2.
It are just sites that provide data, it's up to us to handle upon it.
Like for termperature I recently changed my script so that I don't take changes bigger than 0,1 degree. Since the script runs every minute that's enough.
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Open Weather map

Post by Toulon7559 »

@Egregius

A forecast with a temperature-jump of 1 degree is something you can filter, but in Domoticz a SolarRadiation-value of >300W/m^2 at midnight is just 'strange'.
Looking further, also a max. value in the actual 7day-logging for 8th of July, 19:00hours of 345W/m^2 is far from reality, because peak-radiation should be at each mid-day, and probably a (much) higher value.
Therefore the question: what is forecast.io predicting for SolarRadiation?
Any hint where to find descriptions for parameters and for prediction-context?
Last edited by Toulon7559 on Wednesday 20 July 2016 23:03, edited 2 times in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Open Weather map

Post by Egregius »

I have no clue where they get their data. I use my own solar panels as giant lightmeter.
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Open Weather map

Post by Toulon7559 »

;-) Chicken & Egg
Would like to see from forecast how many W/m^2 to be expected, and then compare with actual solar production.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
fantom
Posts: 269
Joined: Thursday 26 March 2015 10:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Poland
Contact:

Re: Open Weather map

Post by fantom »

I implemented OpenWeatherMap a few days ago (as normal hardware).
But there is a bug (reported from forum). I will found and fix it (maybe today).

Fantom
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest