Weather Underground Upload script Topic is solved

Moderator: leecollings

remember
Posts: 20
Joined: Tuesday 27 February 2018 1:16
Target OS: Windows
Domoticz version:
Contact:

Re: Weather Underground Upload script

Post by remember »

Good afternoon, it seems to have returned to normal ... I did not know what happened ...

wanted to take another question, is there any way to run this Lua script on Android?
remember
Posts: 20
Joined: Tuesday 27 February 2018 1:16
Target OS: Windows
Domoticz version:
Contact:

Re: Weather Underground Upload script

Post by remember »

Toulon7559 this code ready to work as a rain gauge?
mayyam
Posts: 47
Joined: Saturday 14 January 2017 11:29
Target OS: Linux
Domoticz version: 4.11333
Location: Poland
Contact:

Re: Weather Underground Upload script

Post by mayyam »

I'm also getting"

Code: Select all

2018-04-15 10:14:00.384 Error: EventSystem: in /home/may/domoticz/scripts/lua/script_time_wu.lua: /home/may/domoticz/scripts/lua/script_time_wu.lua:21: attempt to perform arithmetic on local 'C' (a nil value)
My Outside_Temp_Hum is:

Code: Select all

-- Weatherunderground PWS upload script
-- (C)2013 GizMoCuz - upgraded with pressure by epierre

Outside_Temp_Hum = 'KUCHNIA_out2_temp'
Sensor is getting data every 25sec, and looks like that on the Device page:
159 RFLink433 5308 0 KUCHNIA_out2_temp Temp + Humidity WTGR800 16.7 C, 58 %

I've already tried to re add lines to be sure i don't have strange characters in them. Also tried to put "--" in front of

Code: Select all

WU_URL = WU_URL .. "&tempf=" .. string.format("%3.1f", CelciusToFarenheit(otherdevices_temperature[Outside_Temp_Hum]))
and

Code: Select all

WU_URL = WU_URL .. "&dewptf=" .. string.format("%3.1f", CelciusToFarenheit(otherdevices_dewpoint[Outside_Temp_Hum]))
The error always shows line 21:

Code: Select all

return (C * (9/5)) + 32
_______________
- Dell FX-160 / Ubuntu 16.04
- RFLink 433Mhz / NRF 2.4GHz
- 2x Xiaomi Gateway
- different species of ESP8266
remember
Posts: 20
Joined: Tuesday 27 February 2018 1:16
Target OS: Windows
Domoticz version:
Contact:

Re: Weather Underground Upload script

Post by remember »

Hello everyone, I have a netatmo station that uses domoticz to send the data, in the portal of the station I get data every 5 minutes, what should be the ideal update time? At the moment I have the domoticz to send data every 5 minutes to the WU, but I noticed that I miss some readings or repeat themselves.

Thank you for your help
remember
Posts: 20
Joined: Tuesday 27 February 2018 1:16
Target OS: Windows
Domoticz version:
Contact:

Re: Weather Underground Upload script

Post by remember »

Hello everyone,

I hope that they can help me, I have noticed that the data is repeated, as I had explained previously, I have a netatmo that updates every 5 minutes in the portal of the brand and so I have the sript to update every 5 minutes.

I have noticed these mistakes!

What could it be?

Code: Select all

2018-07-06 12:22:00.255 Error: EventSystem: in Pws: [string "-- Weatherunderground PWS upload script ..."]:54: attempt to concatenate global 'WU_URL' (a nil value) 
2018-07-06 12:22:00.789 Error: Netatmo hardware (2) nothing received for more than 5 Minutes!.... 
2018-07-06 12:22:01.798 Error: Restarting: Netatmo 
Toulon7559
Posts: 849
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Weather Underground Upload script

Post by Toulon7559 »

@remember

A late response to your question of april 2018:
this script can handle rain gauge.
Line 08 to be set according to your configuration:
you have to insert the compatible identifier-link.

Code: Select all

Rainmeter = '<your rain-gauge-name>'
Check that your rain-gauge separately reports rain and rain_lasthour,
because otherwise you get an error at the following scriptlines further down in the script

Code: Select all

if RainMeter ~= '' then
   WU_URL = WU_URL .. "&dailyrainin=" .. string.format("%2.2f", mmtoInches(otherdevices_rain[RainMeter]))
   WU_URL = WU_URL .. "&rainin=" .. string.format("%2.2f", mmtoInches(otherdevices_rain_lasthour[RainMeter]))
end
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.
remember
Posts: 20
Joined: Tuesday 27 February 2018 1:16
Target OS: Windows
Domoticz version:
Contact:

Re: Weather Underground Upload script

Post by remember »

Toulon7559 wrote: Tuesday 10 July 2018 21:40 @remember

A late response to your question of april 2018:
this script can handle rain gauge.
Line 08 to be set according to your configuration:
you have to insert the compatible identifier-link.

Code: Select all

Rainmeter = '<your rain-gauge-name>'
Check that your rain-gauge separately reports rain and rain_lasthour,
because otherwise you get an error at the following scriptlines further down in the script

Code: Select all

if RainMeter ~= '' then
   WU_URL = WU_URL .. "&dailyrainin=" .. string.format("%2.2f", mmtoInches(otherdevices_rain[RainMeter]))
   WU_URL = WU_URL .. "&rainin=" .. string.format("%2.2f", mmtoInches(otherdevices_rain_lasthour[RainMeter]))
end
Good morning, thank you very much for the answer in terms of the "rainmeter" seems to be working very well! :)
remember
Posts: 20
Joined: Tuesday 27 February 2018 1:16
Target OS: Windows
Domoticz version:
Contact:

Re: Weather Underground Upload script

Post by remember »

Well, another thing that I have checked and I can not identify the problem is the WU receive wrong data from wind and speed directions, why will it happen? My station is a netatmo.
Toulon7559
Posts: 849
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Weather Underground Upload script

Post by Toulon7559 »

@remember

What is wrong with the wind-info?

The following piece of code prepares the winddata for upload to WUnderground.

Code: Select all

if WindMeter ~= '' then
   WU_URL = WU_URL .. "&winddir=" .. string.format("%.0f", otherdevices_winddir[WindMeter])
   WU_URL = WU_URL .. "&windspeedmph=" .. string.format("%.0f", (otherdevices_windspeed[WindMeter]/0.1)*0.223693629205)
   WU_URL = WU_URL .. "&windgustmph=" .. string.format("%.0f", (otherdevices_windgust[WindMeter]/0.1)*0.223693629205)
end
Wind direction should not be a problem (because straightforward extraction of the string from the Netatmo information), but the requirement of WUnderground to have windspeed and windgust in mph-value might be a trap.
For correct operation of that piece of code the Netatmo PWS should provide metric info, to be multiplied as shown.
If the Netatmo PWS is set to provide other type of info, you may have a puzzle to solve ........
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.
remember
Posts: 20
Joined: Tuesday 27 February 2018 1:16
Target OS: Windows
Domoticz version:
Contact:

Re: Weather Underground Upload script

Post by remember »

Toulon7559 wrote: Monday 06 August 2018 21:13 @remember

What is wrong with the wind-info?

The following piece of code prepares the winddata for upload to WUnderground.

Code: Select all

if WindMeter ~= '' then
   WU_URL = WU_URL .. "&winddir=" .. string.format("%.0f", otherdevices_winddir[WindMeter])
   WU_URL = WU_URL .. "&windspeedmph=" .. string.format("%.0f", (otherdevices_windspeed[WindMeter]/0.1)*0.223693629205)
   WU_URL = WU_URL .. "&windgustmph=" .. string.format("%.0f", (otherdevices_windgust[WindMeter]/0.1)*0.223693629205)
end
Wind direction should not be a problem (because straightforward extraction of the string from the Netatmo information), but the requirement of WUnderground to have windspeed and windgust in mph-value might be a trap.
For correct operation of that piece of code the Netatmo PWS should provide metric info, to be multiplied as shown.
If the Netatmo PWS is set to provide other type of info, you may have a puzzle to solve ........
Good Morning

I am currently using meteoware and I really notice the difference, wrong / repeated data in wind, pressure, wind direction and maybe in temperature as well.

The domoticz interval was 5 minutes, which is the update time on my netatmo portal, from which I was able to identify the data that is well received in Domoticz, the problem may be in the script that repeats data and I can not identify why.

Some data are perfectly noted that are repeated (namely the temperature and pressure), others wrong, such as change of wind direction, speed etc.
Toulon7559
Posts: 849
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Weather Underground Upload script

Post by Toulon7559 »

Perhaps try this: http://www.domoticz.com/forum/viewtopic ... 839#p47970
That extra print line will show in the Log the output of the previous scriptlines.
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: 849
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Weather Underground Upload script [also for Sylphide]

Post by Toulon7559 »

;-) More of the same, but slightly different.....

The WUnderground Upload script can also be basis for an HTTP-uploadscript for the Sylphide project of (Dutch organisation) VWK:
- applies UTC in the same way for building of header string with date&time (with small deviation), but
. different setup for IDs and for Software identification
- same compilation of URL-string is possible, but
. different labels for the components wind, rain, temperature, humidity, etc.
. all values are metric, and at most 1 decimal
. daily accumulated rain must be reset at UTC00:00, not at CET00:00 [if your PWS is not performing that reset, it must be done by the uploading script]

Because such HTTP-upload is reserved for members of VWK, no publishing of the scriptcode in this thread, but send a PM if you are a fellow VWK-member wanting to apply this Domoticz-script for HTTP-upload to Sylphide.
Last edited by Toulon7559 on Friday 20 November 2020 17:19, edited 3 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.
kaNor
Posts: 17
Joined: Tuesday 27 February 2018 23:12
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Norge
Contact:

Re: Weather Underground Upload script

Post by kaNor »

Hi

As WU has discontinued their API, and the buildtin support in Domoticz for wu as a hardware-device no longer work, i wonder if it is possible to rewrite this upload-script in this post to be used as an wu-dowloadscript based on their new API. Owners of PWS still can get free API-keys to get data from any station at https://api.weather.com/v2/pws/observat ... yourApiKey

API is described here:
https://docs.google.com/document/d/1KGb ... 8SWBs/edit
Toulon7559
Posts: 849
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Weather Underground Upload script

Post by Toulon7559 »

@kaNor

Updated/changed 25th of March:
In the morning of 23th of March also my WU-devices in Domoticz went on strike.
Being alerted a long time ago, probably the Domoticz' developers have a patch almost at hand, in case any 'twist' would be needed around/after 22nd March, but not seen yet. At your side just have the new API-key ready for application.
If you have such new API-key (identifying you as an 'uploading' WU_PWS) calling info uploaded by another PWS to WU is also possible, according to info meanwhile received from WU.

Your request for a dedicated download script requires a different kind of script than the upload scripts in this thread.
Actually not very difficult and some usable examples already around in this Forum for other applications.
'Somebody' just needs to glue the pieces in a suitable package and test it ..........
But considering the 1st section, why would you desire?

General setup for such dowload script
1. Preparation:
- make in Domoticz the virtual devices as required for your application
2. General structure of the new script:
- issue URL-call according to new layout from WU, incl. WU_ID + new API-key
- dissect the received JSON-file
- make upload of extracted data to the prepared Domoticz' virtual devices
Last edited by Toulon7559 on Monday 08 April 2019 8:36, edited 5 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.
Doudy
Posts: 246
Joined: Tuesday 09 August 2016 9:09
Target OS: -
Domoticz version:
Contact:

Re: Weather Underground Upload script

Post by Doudy »

:?:
I do not understand ...
I have a PWS station how to adapt Domoticz?
Thank you
RaspberryPi - RFLink - Zwave - WH2600
Domoticz : 2020.2 | Dashticz : V3.12 Master | dzvents : 3.0.2 | Python : 3.7.3
Toulon7559
Posts: 849
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Weather Underground Upload script

Post by Toulon7559 »

@Doudy

As described in my earlier message (my opinion):
as user of Domoticz, either you have to wait for a related update of Domoticz, or you must write your own script for data-extraction (or wait until somebody has written & published such script).
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.
Doudy
Posts: 246
Joined: Tuesday 09 August 2016 9:09
Target OS: -
Domoticz version:
Contact:

Re: Weather Underground Upload script

Post by Doudy »

We will wait
;)
RaspberryPi - RFLink - Zwave - WH2600
Domoticz : 2020.2 | Dashticz : V3.12 Master | dzvents : 3.0.2 | Python : 3.7.3
Toulon7559
Posts: 849
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: Weather Underground Upload script

Post by Toulon7559 »

The WU-upload-script(s) in this thread can continue to be applied without any problem, because not requiring an API-key, but only your WU-identification & WU-Password, which have not changed.

The built in WU-download of Domoticz is working again since version V4.10573 of Domoticz, but
under Setup/Hardware for the Domoticz-line(s)
- you have to change your current/old API key to your new one,
- for Location you have to remove the pws: and use only the station's name / identification
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.
Stimpy68
Posts: 40
Joined: Wednesday 09 May 2018 16:37
Target OS: Linux
Domoticz version:
Location: The Hague, The Netherlands
Contact:

Re: Weather Underground Upload script

Post by Stimpy68 »

Hi, upgraded to the latstest stable Domoticz version today, everything is working except the upload script, I get this error:

2020-03-23 10:47:00.246 Error: EventSystem: in script_time_wu.lua: [string "-- Weatherunderground PWS upload script..."]:80: bad argument #2 to 'format' (number has no integer representation)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Weather Underground Upload script

Post by waaren »

Stimpy68 wrote: Monday 23 March 2020 10:49 Hi, upgraded to the latstest stable Domoticz version today, everything is working except the upload script, I get this error:

2020-03-23 10:47:00.246 Error: EventSystem: in script_time_wu.lua: [string "-- Weatherunderground PWS upload script..."]:80: bad argument #2 to 'format' (number has no integer representation)
Please share the script (or at least line 80 of it) as you are using it now.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest