Page 1 of 1

Any script for "from wind speed to wind gust"

Posted: Saturday 21 July 2018 10:42
by tonbor
My weather station has no wind gust. Domoticz uses wind speed for wind gust. Any script made by any one to calculate over time from wind speed to wind gust?

Re: Any script for "from wind speed to wind gust"

Posted: Sunday 22 July 2018 9:23
by tonbor
Well I sorted it out for meself thx.

Re: Any script for "from wind speed to wind gust"

Posted: Sunday 22 July 2018 11:40
by waaren
@tonbor, can you please share your solution ? It might help others on this forum.

Thx.

Re: Any script for "from wind speed to wind gust"

Posted: Sunday 22 July 2018 14:25
by tonbor
I will

Re: Any script for "from wind speed to wind gust"

Posted: Sunday 22 July 2018 14:41
by tonbor
wind gust.jpg
wind gust.jpg (207.08 KiB) Viewed 1510 times
Wind Speed and calculeted Wind Gust.

Re: Any script for "from wind speed to wind gust"

Posted: Sunday 22 July 2018 14:50
by tonbor
return {
active = true,
on = {
devices = {'Wind ws2357'} -- global windsensor & update trigger
},
data = {
windGust = { history = true, maxItems = 10, maxMinutes = 10 } -- declare list

},
execute = function(domoticz)
local windDev = domoticz.devices('Wind ws2357') --declares your wind device
local windUpdate = domoticz.devices('Windsnelheid') -- local = global Windspeed
local windGustUpdate = domoticz.devices('Wind vlaag') -- local = global Wind Gust
local windSpeed = windDev.speed --read only windspeed value from wind device
windUpdate.updateCustomSensor(windSpeed) -- update global windsnelheid
domoticz.data.windGust.add(windSpeed) -- add windspeed to list
windGustUpdate.updateCustomSensor(domoticz.data.windGust.maxSince('00:10:00')) -- update wind vlaag with max of list of latest 10 minutes

Re: Any script for "from wind speed to wind gust"

Posted: Sunday 22 July 2018 20:43
by waaren
Thanx. Good example and use of the historical function in dzVents data