Any script for "from wind speed to wind gust"

Moderator: leecollings

Post Reply
tonbor
Posts: 153
Joined: Monday 17 February 2014 9:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Any script for "from wind speed to wind gust"

Post 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?
tonbor
Posts: 153
Joined: Monday 17 February 2014 9:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by tonbor »

Well I sorted it out for meself thx.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post by waaren »

@tonbor, can you please share your solution ? It might help others on this forum.

Thx.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
tonbor
Posts: 153
Joined: Monday 17 February 2014 9:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by tonbor »

I will
tonbor
Posts: 153
Joined: Monday 17 February 2014 9:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by tonbor »

wind gust.jpg
wind gust.jpg (207.08 KiB) Viewed 1503 times
Wind Speed and calculeted Wind Gust.
tonbor
Posts: 153
Joined: Monday 17 February 2014 9:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
Last edited by tonbor on Tuesday 24 July 2018 10:21, edited 3 times in total.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post by waaren »

Thanx. Good example and use of the historical function in dzVents data
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