Any script for "from wind speed to wind gust"

Post Reply
tonbor
Posts: 44
Joined: Monday 17 February 2014 10:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

Any script for "from wind speed to wind gust"

Post by tonbor » Saturday 21 July 2018 10:42

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: 44
Joined: Monday 17 February 2014 10:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by tonbor » Sunday 22 July 2018 9:23

Well I sorted it out for meself thx.

User avatar
waaren
Posts: 1079
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post by waaren » Sunday 22 July 2018 11:40

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

Thx.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

tonbor
Posts: 44
Joined: Monday 17 February 2014 10:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by tonbor » Sunday 22 July 2018 14:25

I will

tonbor
Posts: 44
Joined: Monday 17 February 2014 10:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by tonbor » Sunday 22 July 2018 14:41

wind gust.jpg
wind gust.jpg (207.08 KiB) Viewed 450 times
Wind Speed and calculeted Wind Gust.

tonbor
Posts: 44
Joined: Monday 17 February 2014 10:12
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by tonbor » Sunday 22 July 2018 14:50

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: 1079
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post by waaren » Sunday 22 July 2018 20:43

Thanx. Good example and use of the historical function in dzVents data
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests