A system (1,21) for adjusting an execution of a routine in dependence on a determined state, said routine controlling one or more lighting devices, said system (1,21) comprising: at least one receiver (3,23), at least one transmitter (4,24); and characterised by at least one processor (5,25) configured to: - learn, in a learning mode, based on one or more signals received via said at least one receiver (3,23), one or more states of one or more portable devices (13-14,34) at a start time associated with said routine for a plurality of executions of said routine over a period of time, - determine, in said learning mode, one or more expected states of said one or more portable devices (13-14,34) at said start time associated with said routine based on said one or more learned states, - determine, in an adjustment mode, via said at least one receiver (3,23), one or more current states of said one or more portable devices (13-14,34) at said start time of said routine for a current execution of said routine, - if said one or more expected states have been determined, determine whether said one or more current states differ from said one or more expected states, and - adjust, in said adjustment mode, said current execution of said routine in dependence on a difference between said one or more current states and said one or more expected states, said current execution of said routine comprising transmission of at least one light command via said at least one transmitter (4,24). at least one receiver (3,23), at least one transmitter (4,24); and characterised by at least one processor (5,25) configured to: - learn, in a learning mode, based on one or more signals received via said at least one receiver (3,23), one or more states of one or more portable devices (13-14,34) at a start time associated with said routine for a plurality of executions of said routine over a period of time, - determine, in said learning mode, one or more expected states of said one or more portable devices (13-14,34) at said start time associated with said routine based on said one or more learned states, - determine, in an adjustment mode, via said at least one receiver (3,23), one or more current states of said one or more portable devices (13-14,34) at said start time of said routine for a current execution of said routine, - if said one or more expected states have been determined, determine whether said one or more current states differ from said one or more expected states, and - adjust, in said adjustment mode, said current execution of said routine in dependence on a difference between said one or more current states and said one or more expected states, said current execution of said routine comprising transmission of at least one light command via said at least one transmitter (4,24). - learn, in a learning mode, based on one or more signals received via said at least one receiver (3,23), one or more states of one or more portable devices (13-14,34) at a start time associated with said routine for a plurality of executions of said routine over a period of time, - determine, in said learning mode, one or more expected states of said one or more portable devices (13-14,34) at said start time associated with said routine based on said one or more learned states, - determine, in an adjustment mode, via said at least one receiver (3,23), one or more current states of said one or more portable devices (13-14,34) at said start time of said routine for a current execution of said routine, - if said one or more expected states have been determined, determine whether said one or more current states differ from said one or more expected states, and - adjust, in said adjustment mode, said current execution of said routine in dependence on a difference between said one or more current states and said one or more expected states, said current execution of said routine comprising transmission of at least one light command via said at least one transmitter (4,24).