Code : Tout sélectionner
commandArray={}
--SI etat l'Alarme change
if devicechanged ['Alarme'] then
--SI l'Alarme passe à ON ALORS
--if devicechanged['Alarme']=='ON' then
if otherdevices['Alarme']=='ON' then
--ETEINDRE LES LUMIERES
if otherdevices['Façade arrière']=='On' then
commandArray[#commandArray + 1]={['Façade arrière']='Off'}
end
if otherdevices['Appoint salon']=='On' then
commandArray[#commandArray + 1]={['Appoint salon']='Off'}
end
if otherdevices['Façade avant']=='On' then
commandArray[#commandArray + 1]={['Façade avant']='Off'}
end
-- SI l'Alarme passe à ON et SI ECLAIRAGE PISCINE état ON ALORS
if otherdevices['A1-Eclairage piscine']=='On' then
--PASSER A OFF
commandArray[#commandArray + 1]={['A1-Eclairage piscine']='Off'}
end
end
print ("Alarme activée --> extinction des éclairages allumés.")
end
return commandArray