I update a wind sensor with data from weerlive.nl from a bash script like this
Code: Select all
/usr/bin/curl "http://127.0.0.1:8080/json.htm?type=command¶m=udevice&idx="$domidx2"&nvalue=0&svalue="$_wb";"$_wd";"$_ws";"0";22;24"
Wind
/json.htm?type=command¶m=udevice&idx=IDX&nvalue=0&svalue=WB;WD;WS;WG;22;24
IDX = id of your device (This number can be found in the devices tab in the column "IDX")
WB = Wind bearing (0-359)
WD = Wind direction (S, SW, NNW, etc.)
WS = 10 * Wind speed [m/s]
WG = 10 * Gust [m/s]
22 = Temperature
24 = Temperature Windchill
the temperature and temperature windchill do not show up anywhere in the sensor, so i ignore them for now.
The data comes from weerlive.nl. Weerlive does not provide windgusts, so i want to update that value from DzVents using the DzVents data option like this during the update of the sensor.
Code: Select all
return {
on = {
devices = {
'Buitenstation Wind KNMI' -- KNMI data, no wind gust info
}
},
data = {
windGust = { history = true, maxItems = 10, maxMinutes = 10 } -- declare list
},
execute = function(domoticz, device)
-- store current windspeed
domoticz.data.windGust.add(device.speed)
**********Here i want to update ONLY the wind gust value of the sensor************
domoticz.log('windGust Max is ' .. tostring(domoticz.data.windGust.maxSince('00:10:00') .. 'm/s'), domoticz.LOG_INFO)
domoticz.log('Device ' .. device.name .. ' was updated with wind gust information', domoticz.LOG_INFO)
end
}
Wind
chill: Number.
direction: Number. Degrees.
directionString: String. Formatted wind direction like N, SE.
gust: Number. ( in meters / second, might change in future releases to Meters/Counters settings for Wind Meter )
gustMs: Number. Gust ( in meters / second ) 2.4.9
temperature: Number
speed: Number. Windspeed ( in the unit set in Meters/Counters settings for Wind Meter )
speedMs: Number. Windspeed ( in meters / second ) 2.4.9
updateWind(bearing, direction, speed, gust, temperature, chill): Function. Bearing in degrees, direction in N, S, NNW etc, speed in m/s, gust in
m/s, temperature and chill in Celsius. Use domoticz.toCelsius() to convert a Fahrenheit temperature to Celsius. Supports command options.
i could not find how to update only the gust or gustMs value with the value domoticz.data.windGust.maxSince('00:10:00')
Any help will be greatly appreciated
thanks for reading,
Rob