After adapting to my wishes the following script:
Code: Select all
return
{
on =
{
devices =
{
'Status',
'Neerslag verwacht',
'Wind',
},
variables = {
'Windstoten'
},
},
logging =
{
level = domoticz.LOG_DEBUG,
},
execute = function(dz)
local status = dz.devices('Status').state -- Selector switch levels "Off", "Spaarstand", "Afwezig" and "Afwezig +"
local shutter = dz.devices('Zonnescherm').state -- Selector switch levels Op, Stop And Neer
local possibleRain = dz.devices('Neerslag verwacht').state
local wind = dz.devices('Wind').speedMs
local windstoten = tonumber(dz.variables('Windstoten').svalue)
dz.log('Status, state: ' .. tostring(status.state ) , dz LOG_DEBUG)
dz.log('Zonnescherm, state: ' .. tostring(shutter.state) , dz.LOG_DEBUG)
dz.log('Neerslag verwacht, state: ' .. tostring(possibleRain.state) , dz.LOG_DEBUG)
dz.log('Wind, value: ' .. tostring(wind) , dz.LOG_DEBUG)
dz.log('Windstoten, value: ' .. tostring(windstoten) , dz.LOG_DEBUG)
if shutter.state == 'Neer' and status == 'Spaarstand' and possibleRain == 'On' and wind > 20 and windstoten > 20 then
shutter.switchSelector(Op)
end
end
}Thanks in advance!