commandArray = {} if (devicechanged['Interrupteur 2 boutons Xiaomi zigbee'] == 'B1') then if (otherdevices['UneLampe'] == "On") then commandArray['UneLampe']='Off' else commandArray['UneLampe']='On' end end return commandArray