A processing unit for controlling a programmable electrical system of a building, said electrical system comprising a plurality of addressable elements , the processing unit comprising: - a storage medium comprising a library of scenarios, each scenario being a data construct or a combined data and software construct, said construct combining program logic and configurable properties, wherein each scenario comprises a definition of a plurality of types of elements required for said scenario, wherein each scenario further comprises a plurality of interrelated actions defining behaviors of elements of said types, each action defining a behavior of at least one of said elements acting as an output node as a function of a status of at least one of said elements acting as an input node; and - an interaction interface for presenting an overview of at least a part of the scenarios in said library to a user and adapted for receiving an input from said user to select one of the presented scenarios and for configuring an instance of said selected scenario by interactively presenting said user with choices and/or options relating to said scenario, characterized in that : for each scenario, said plurality of types of elements comprises at least two of a virtual input node, a virtual output node and/or a type of addressable element of said programmable electrical system that is capable of acting as an input node and/or an output node, and in that : the interaction interface is adapted for configuring at least one link between at least one virtual output node and at least one virtual input node for routing state information between the instance of the selected scenario and another instance of one of said scenarios. - a storage medium comprising a library of scenarios, each scenario being a data construct or a combined data and software construct, said construct combining program logic and configurable properties, wherein each scenario comprises a definition of a plurality of types of elements required for said scenario, wherein each scenario further comprises a plurality of interrelated actions defining behaviors of elements of said types, each action defining a behavior of at least one of said elements acting as an output node as a function of a status of at least one of said elements acting as an input node; and - an interaction interface for presenting an overview of at least a part of the scenarios in said library to a user and adapted for receiving an input from said user to select one of the presented scenarios and for configuring an instance of said selected scenario by interactively presenting said user with choices and/or options relating to said scenario, for each scenario, said plurality of types of elements comprises at least two of a virtual input node, a virtual output node and/or a type of addressable element of said programmable electrical system that is capable of acting as an input node and/or an output node, and in that : the interaction interface is adapted for configuring at least one link between at least one virtual output node and at least one virtual input node for routing state information between the instance of the selected scenario and another instance of one of said scenarios. <EOS>