I just started my first LUA script and I love it !
But I've got 1 question (for the moment!) : I'd like to create a script with all my PIR devices and if one of them is active so a dummy switch will be active. But I've got a lot of PIR devices names PIR_kitchen, PIR_garage,... and I like to know if in a LUA script you can call a group like PIR instead of all individual PIR devices, hope I'm understandable ^^
For the moment I've got :
Code: Select all
commandArray = {}
if (devicechanged['PIR_kitchen'] == 'On' ) or (devicechanged['PIR_garage'] == 'On' ) then
commandArray['Capteurs']='On'
end
if (devicechanged['PIR_kitchen'] == 'Off' ) or (devicechanged['PIR_garage'] == 'Off' ) then
commandArray['Capteurs']='Off'
end
return commandArray