Page 5 of 6
Re: Weather Underground Upload script
Posted: Saturday 10 March 2018 14:45
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?
Re: Weather Underground Upload script
Posted: Wednesday 11 April 2018 17:34
by remember
Toulon7559 this code ready to work as a rain gauge?
Re: Weather Underground Upload script
Posted: Sunday 15 April 2018 10:18
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:
Re: Weather Underground Upload script
Posted: Monday 02 July 2018 19:34
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
Re: Weather Underground Upload script
Posted: Friday 06 July 2018 13:57
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
Re: Weather Underground Upload script
Posted: Tuesday 10 July 2018 21:40
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
Re: Weather Underground Upload script
Posted: Wednesday 11 July 2018 9:32
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!

Re: Weather Underground Upload script
Posted: Monday 06 August 2018 13:05
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.
Re: Weather Underground Upload script
Posted: Monday 06 August 2018 21:13
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 ........
Re: Weather Underground Upload script
Posted: Wednesday 22 August 2018 9:57
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.
Re: Weather Underground Upload script
Posted: Thursday 23 August 2018 12:30
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.
Re: Weather Underground Upload script [also for Sylphide]
Posted: Thursday 13 September 2018 17:17
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.
Re: Weather Underground Upload script
Posted: Saturday 16 March 2019 21:30
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
Re: Weather Underground Upload script
Posted: Sunday 17 March 2019 7:37
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
Re: Weather Underground Upload script
Posted: Sunday 17 March 2019 10:08
by Doudy
I do not understand ...
I have a PWS station how to adapt Domoticz?
Thank you
Re: Weather Underground Upload script
Posted: Monday 25 March 2019 13:30
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).
Re: Weather Underground Upload script
Posted: Monday 25 March 2019 17:15
by Doudy
We will wait

Re: Weather Underground Upload script
Posted: Monday 08 April 2019 8:40
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
Re: Weather Underground Upload script
Posted: Monday 23 March 2020 10:49
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)
Re: Weather Underground Upload script
Posted: Monday 23 March 2020 11:02
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.