A method for controlling a plurality of electronic devices using a virtual assistant on a user device having one or more processors and memory, the method comprising: at the user device: receiving an audio input comprising a user speech representing a user intent to set a state of each of a plurality of electronic devices (128, 130, 132) based on a stored configuration; transmitting data corresponding to the audio input to one or more servers; receiving, from the one or more servers: a plurality of commands to set the state of each of a plurality of electronic devices determined by the one or more servers based on the stored configuration, wherein the stored configuration defines a state of each of the plurality of electronic devices to use in response to a command that references the configuration; and identifications associated with each of the plurality of commands, wherein the identifications identify each of the plurality of electronic devices for performing each of the plurality of commands; transmitting the plurality of commands to the plurality of electronic devices based on the identifications associated with each of the plurality of commands; after transmitting the plurality of commands, receiving an updated state of each of the plurality of electronic devices from the plurality of electronic devices; and transmitting the updated state of each of the plurality of electronic devices to the one or more servers for updating a state of one or more of the plurality of electronic devices in a database included in the one or more servers based on the received updated state of each of the plurality of electronic devices, wherein the user device comprises a database for storing a current state of each of the plurality of electronic devices (128, 130, 132), and wherein the current state of each of the plurality of electronic devices is updated based at least in part on the updated state of each of the plurality of electronic devices received from the plurality of electronic devices; and outputting an audio or visual indication of a result of the plurality of commands based on the plurality of commands and the updated state of each of the plurality of electronic devices that are received from the plurality of electronic devices (128, 130, 132). receiving an audio input comprising a user speech representing a user intent to set a state of each of a plurality of electronic devices (128, 130, 132) based on a stored configuration; transmitting data corresponding to the audio input to one or more servers; receiving, from the one or more servers: a plurality of commands to set the state of each of a plurality of electronic devices determined by the one or more servers based on the stored configuration, wherein the stored configuration defines a state of each of the plurality of electronic devices to use in response to a command that references the configuration; and identifications associated with each of the plurality of commands, a plurality of commands to set the state of each of a plurality of electronic devices determined by the one or more servers based on the stored configuration, wherein the stored configuration defines a state of each of the plurality of electronic devices to use in response to a command that references the configuration; and identifications associated with each of the plurality of commands, wherein the identifications identify each of the plurality of electronic devices for performing each of the plurality of commands; transmitting the plurality of commands to the plurality of electronic devices based on the identifications associated with each of the plurality of commands; after transmitting the plurality of commands, receiving an updated state of each of the plurality of electronic devices from the plurality of electronic devices; and transmitting the updated state of each of the plurality of electronic devices to the one or more servers for updating a state of one or more of the plurality of electronic devices in a database included in the one or more servers based on the received updated state of each of the plurality of electronic devices, wherein the user device comprises a database for storing a current state of each of the plurality of electronic devices (128, 130, 132), and wherein the current state of each of the plurality of electronic devices is updated based at least in part on the updated state of each of the plurality of electronic devices received from the plurality of electronic devices; and outputting an audio or visual indication of a result of the plurality of commands based on the plurality of commands and the updated state of each of the plurality of electronic devices that are received from the plurality of electronic devices (128, 130, 132).