updateWeatherSensors (yet another buienradar script) [SOLVED]
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
New version available (bugfix) ; see first post here Latest version 0.20180424
20180423 Some additional user specific settings. Both files (main code and user settings) are in the attached zip
20180423 Added experimental Lux (based on Solar Power) this one still need a lot of work so do not rely on it.
20180423 Execution frequency controlled by user settings. Read the comments in the usersetting file
20180424 Rainforecast bugfix and improved lux forecast
20180423 Some additional user specific settings. Both files (main code and user settings) are in the attached zip
20180423 Added experimental Lux (based on Solar Power) this one still need a lot of work so do not rely on it.
20180423 Execution frequency controlled by user settings. Read the comments in the usersetting file
20180424 Rainforecast bugfix and improved lux forecast
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 667
- Joined: Wednesday 08 March 2017 9:42
- Target OS: Linux
- Domoticz version: 3.8993
- Location: Amsterdam
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
Nice !!! we gonna install it, test it, be happy with it !
waaren wrote: ↑Monday 23 April 2018 18:40 New version available; see first post here Latest version 0.20180423
Some additional user specific settings. Both files (main code and user settings) are in the attached zip
Added experimental Lux (based on Solar Power) this one still need a lot of work so do not rely on it.
Execution frequency controlled by user settings. Read the comments in the usersetting file
History
========
20180408 Start coding
20180411 First version active and shared on forum
20180412 Added check on text fields (do not overwrite same text)
20180413 Added more checks and logs
20180413 Corrected rain forecast formulas
20180413 Adjusted rain forecast devices
20180413 Added Alert,text and switch rain forecast devices (all optional)
20180414 User adjustable interval for Info logging to domoticz logfile
20180414 User adjustable interval for updating unchanged sensors/switches
20180414 Shortened long forecast string to 240 chars because of bug in domoticz
20180415 Separated user specific settings from main codefile
20180416 Improved layout text to logfile
20180420 Day-/night frequency now controlled by user-setting
20180423 Added experimental lux based on Solar Power
20180423 Added checks on empty returns
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
-
- Posts: 4
- Joined: Thursday 10 November 2016 21:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
Version 2018-04-24 works fine for me! Thanks!
Re: updateWeatherSensors (yet another buienradar script)
I can not figure out why this does NOT work.
But only this WORKS!
Anybody any idea 
Code: Select all
local function getUservars()
require ('weatherSettings')
end
if not(pcall(getUservars)) then
Code: Select all
require ('weatherSettings')

- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
Hi EddyG,
It works with my version of dzVents (2.4.5) and on my OS (Debian stretch)
Could you add this
directly after
And check if you see any message in the domoticz log ? If not standard then after switch the script and dzVents into debug mode ?
Don't forget to remove this code afterwards
It works with my version of dzVents (2.4.5) and on my OS (Debian stretch)
Could you add this
Code: Select all
if true then
local status, err = pcall(getUservars)
print(err)
return
end
Code: Select all
local function getUservars()
require ('weatherSettings')
end
Don't forget to remove this code afterwards

Last edited by waaren on Saturday 28 April 2018 8:35, edited 2 times in total.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 667
- Joined: Wednesday 08 March 2017 9:42
- Target OS: Linux
- Domoticz version: 3.8993
- Location: Amsterdam
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
Here latest script is also working dzVents 2.4.4 / Rasbian Stretch
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
Re: updateWeatherSensors (yet another buienradar script)
I raised dzVents logging to debug and put in:
The logging only shows:
So the codes gets to the OK, but the return of the pcall seems to be nothing. I am using lua 5.2
Code: Select all
err = pcall(getUservars)
print(err)
print("OK")
Code: Select all
2018-04-28 09:44:00.667 dzVents: Info: WUS: ------ Start external script: updateWeatherSensors.lua:, trigger: every minute
2018-04-28 09:44:00.668 dzVents: OK
2018-04-28 09:44:00.682 dzVents: Info: WUS: ------ Finished updateWeatherSensors.lua
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
@EddyG,EddyG wrote: ↑Saturday 28 April 2018 9:47 I raised dzVents logging to debug and put in:The logging only shows:Code: Select all
err = pcall(getUservars) print(err) print("OK")
So the codes gets to the OK, but the return of the pcall seems to be nothing. I am using lua 5.2Code: Select all
2018-04-28 09:44:00.667 dzVents: Info: WUS: ------ Start external script: updateWeatherSensors.lua:, trigger: every minute 2018-04-28 09:44:00.668 dzVents: OK 2018-04-28 09:44:00.682 dzVents: Info: WUS: ------ Finished updateWeatherSensors.lua
what you have put in, is something different than what I proposed. The pcall can return two values and you interpret only one.
Can you please put in the code snippet I proposed ?
What do you mean with Lua 5.2 ?
As far as I understand dzVents use the Lua integrated with domoticz but I could be wrong (Would not be the first time either

Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: updateWeatherSensors (yet another buienradar script)
I tried everything, including your code, but the pcall returns nothing.
Code:
Result:
This is some code I found on the Internet about pcall
About Lua version. I thought it was external.
Code:
Code: Select all
print(tostring(status).." - "..tostring(err))
Code: Select all
2018-04-28 13:07:01.318 dzVents: true - nil
2018-04-28 13:07:01.318 dzVents: OK
Code: Select all
function f()
return 'some text'
end
local status, res = pcall(f)
if pcall succeeded, status is true and res is the return value of f().
if pcall failed, status is false and res is the error message.
-
- Posts: 667
- Joined: Wednesday 08 March 2017 9:42
- Target OS: Linux
- Domoticz version: 3.8993
- Location: Amsterdam
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
I was scream to fast. I see now 3 times a fatal error pop up. Don't know if this is because of last release of script or just 1 plugin i installed.
Im now testing some things....
Im now testing some things....
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
@poudenes,
can you please post the fatal errors. If possible I will try to catch these and handle them gracefully in later versions .
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 667
- Joined: Wednesday 08 March 2017 9:42
- Target OS: Linux
- Domoticz version: 3.8993
- Location: Amsterdam
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
EDIT: removed the lines myself
Last edited by poudenes on Saturday 28 April 2018 22:09, edited 1 time in total.
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
Re: updateWeatherSensors (yet another buienradar script)
Is not this the same crash from the latest beta. See section Bugs.
-
- Posts: 667
- Joined: Wednesday 08 March 2017 9:42
- Target OS: Linux
- Domoticz version: 3.8993
- Location: Amsterdam
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
Yes i see it also. Sorry for the post ... 

RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
@poudenes,
this segmentation fault is caused by one of the pull requests from github that were merged into Beta earlier today. It has already been reported at this forum and on github here .
Nothing related to dzVents or my script.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: updateWeatherSensors (yet another buienradar script)
It might be an idea to separate the "Wind+Temp+Chill" device in 2 devices "Wind" and "Chill Temp"
The "Wind+Temp+Chill" is also separated in 2 devices but those have the same name.
So if I call it "Wind" then that device is present on the Temperature an Weather tab with the same name.
Just an idea.
The "Wind+Temp+Chill" is also separated in 2 devices but those have the same name.
So if I call it "Wind" then that device is present on the Temperature an Weather tab with the same name.
Just an idea.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
Hi EddyG,
not quite sure what you propose. The "wind" device is already shown on both the temperature and the weather tab. If I mis-interpret your suggestion please let me know.
not quite sure what you propose. The "wind" device is already shown on both the temperature and the weather tab. If I mis-interpret your suggestion please let me know.
- Attachments
-
- Device screen filtered on text Rotetrdam
- devicesScreen.PNG (102.44 KiB) Viewed 3091 times
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
New versions posted here Latest version 0.20180430
Use of setting file mandatory now.
Please find detailed information / explanation in files
History since last posting
======================
20180425 Bug in updating rain-rate after forcedUpdateMinutes fixed (did not update when equal)
20180425 Prepared language choice
20180427 Added more translations
20180427 Added 5 and 10 day forecast device and information
20180429 Setting file mandatory now
20180429 Finished translations
20180429 Added location retrieval from domoticz settings
20180430 Adjusted Lux calculation
Have Fun !
Use of setting file mandatory now.
Please find detailed information / explanation in files
History since last posting
======================
20180425 Bug in updating rain-rate after forcedUpdateMinutes fixed (did not update when equal)
20180425 Prepared language choice
20180427 Added more translations
20180427 Added 5 and 10 day forecast device and information
20180429 Setting file mandatory now
20180429 Finished translations
20180429 Added location retrieval from domoticz settings
20180430 Adjusted Lux calculation
Have Fun !
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- EdwinK
- Posts: 1820
- Joined: Sunday 22 January 2017 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Rhoon
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
Thanks. Trying out again 

Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
-
- Posts: 3
- Joined: Tuesday 17 April 2018 22:43
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: updateWeatherSensors (yet another buienradar script)
Looks / works great
Who is online
Users browsing this forum: No registered users and 1 guest