You should prepare this in such way:
- event-based script for every pushbutton with such script:
- event-based script for every pushbutton with such script:
Code:
value = event.getvalue()
magnet = grp.getvalue('Magnet sensor') -- when magnet disconnected room is divided
if magnet then
grp.write('Light 1 on/off', value)
else
grp.write('Light 1a on/off', value)
end