Code: Select all
-- Automatische keukenverlichting
now=os.time()
tijd=(os.date("%X", now))
commandArray = {}
if tijd > '19:00:00' and otherdevices['Schemersensor']== 'On'
then if otherdevices['$keuken']== 'On' and otherdevices['Keuken-auto-uit']== 'Off' and otherdevices['Keukenverlichting']== 'Off'
then
commandArray['Keukenverlichting']= 'Set Level 10'
commandArray['Variable:var_keuken_auto']= 'On'
end
end
if otherdevices['$keuken']== 'Off' and uservariables['var_keuken_auto']== 'On'
then
commandArray['Keukenverlichting']= 'Off'
commandArray['Variable:var_keuken_auto']= 'Off'
end
if devicechanged['Keukenverlichting']== 'Off'
then
commandArray['$keuken']= 'Off'
commandArray['Variable:var_keuken_auto']= 'Off'
end
return commandArray