[Solved] DzVents scripts not working anymore after upgrade
Posted: Saturday 30 May 2020 19:31
The 2 different scripts below worked perfectly in
Raspbian Stretch 9.8
Domoticz 4.9700
But after an upgrade / new installation to:
Raspbian Buster 10
Domoticz 2020.2 (build 12067)
Both scripts are dead.
Can somebody help us with the solution?
Thanks in advance.
Power available Script:
Max temperature to Text Device script:
Raspbian Stretch 9.8
Domoticz 4.9700
But after an upgrade / new installation to:
Raspbian Buster 10
Domoticz 2020.2 (build 12067)
Both scripts are dead.
Can somebody help us with the solution?
Thanks in advance.
Power available Script:
Code: Select all
return {
on = {
timer = { 'every minute' }},
execute = function( dz )
local voltage = dz.devices('Voltage')
local power= dz.variables('Power')
local function setvar(var, to)
if var.value ~= to and dz.startTime.secondsAgo > 120 then var.set(to) end
end
if voltage.lastUpdate.secondsAgo > 120 then
setvar(power,'Off')
else
setvar(power,'On')
end
endMax temperature to Text Device script:
Code: Select all
local temperatureDevice = 'Temp+HumOutside -- change to name of your Temperature device
local temperatureTextDevice = 'TempOutside Max' -- change to name of your text device
local temperatureVariable = 'TempOutsideMax' -- change to name of your variable
return {
on = {
devices = { temperatureDevice },
timer = { 'at 00:03' }, -- time to reset variable and text device
},
execute = function(dz, item)
temperatureVariable = dz.variables(temperatureVariable)
temperatureTextDevice = dz.devices(temperatureTextDevice)
if item.isTimer then
temperatureVariable.set(-55)
temperatureTextDevice.updateText('max temp today: notset yet' .. dz.time.rawTime)
elseif item.temperature > temperatureVariable.value then
temperatureVariable.set(dz.utils.round(item.temperature,1))
temperatureTextDevice.updateText('max temp today: ' .. dz.utils.round(item.temperature,1) .. '° C om ' .. dz.time.rawTime)
end
end
}