I have created several rain sensors that are updated with dzVents: updateRain(rate, counter)
I can see exactly my values updated for the rate, but others values for the counter (in the web page and in the log)
The script
Code: Select all
--[[
]]--
local DOMAIN = ':test'
local dev_rain = 314 -- dummy receive rain in mm / Type Rain
local dev_Rain1h = 311 -- dummy receive 1h expected rain in mm / Type Rain
local dev_Rain12h = 312 -- dummy receive 12h expected rain in mm / Type Rain
local dev_Rain24h = 313 -- dummy receive 24h expected rain in mm / Type Rain
return {
active = true,
logging = {
level = domoticz.LOG_DEBUG, -- Select one of LOG_DEBUG, LOG_INFO, LOG_ERROR, LOG_FORCE to override system log level
marker = DOMAIN},
on = {
devices = {206} -- a switch for testing w/o waiting minutes
},
execute = function(dz, triggerObject)
print('0 - rate: ' .. dz.devices(dev_rain).rainRate)
print('0 - rain: ' .. dz.devices(dev_rain).rain)
print('1 - rate: ' .. dz.devices(dev_Rain1h).rainRate)
print('1 - rain: ' .. dz.devices(dev_Rain1h).rain)
print('12 - rate: ' .. dz.devices(dev_Rain12h).rainRate)
print('12 - rain: ' .. dz.devices(dev_Rain12h).rain)
print('24 - rate: ' .. dz.devices(dev_Rain24h).rainRate)
print('24 - rain: ' .. dz.devices(dev_Rain24h).rain)
local RainPrecip = 150 -- in Rate divided by 100
local RainRate = 5 -- in Top
print('RainPrecip: ' .. RainPrecip .. ' RainRate: ' .. RainRate)
-- Rain meter: rain: Number / rainRate: Number / updateRain(rate, counter)
dz.devices(dev_rain).updateRain(RainPrecip, RainRate)
dz.devices(dev_Rain1h).updateRain(RainPrecip, RainRate)
dz.devices(dev_Rain12h).updateRain(RainPrecip, RainRate)
dz.devices(dev_Rain24h).updateRain(RainPrecip, RainRate)
end
}
- Spoiler: show
Thanks
Hestia