Update a subdevice
Last updated on March 02, 2015 09:49
This method allows you to update the properties of a subdevices. Coming soon will be support for setting timers and changing which groups a subdevice belongs to.
URL
/api/v1/subdevices/update
Requiredparameters
id- the ID of the subdevice to modify
Optional parameters for general setup
label- a new friendly name for the deviceextra_data- a place to store application-specific JSON datadevice_group_ids- an array of IDs of device groups this subdevice should belong to. The list can be obtained from the/api/v1/device_groups/listendpoint
Optional parameters for timers
timer1_enabled- whether to enable timer #1 - a booleantimer1_on_time- the time at which timer #1 should switch on, specified as a datetime. The date and timeszone are ignored. eg:"2000-01-01T09:00:00.000Z"timer1_off_time- the time at which timer #1 should switch off, specified as a datetime. The date and timeszone are ignored. eg:"2000-01-01T20:00:00.000Z"timer1_monday- whether timer #1 should apply on Monday - a booleantimer1_tuesday- whether timer #1 should apply on Tuesday - a booleantimer1_wednesday- whether timer #1 should apply on Wednesday - a booleantimer1_thursday- whether timer #1 should apply on Thursday - a booleantimer1_friday- whether timer #1 should apply on Friday - a booleantimer1_saturday- whether timer #1 should apply on Saturday - a booleantimer1_sunday- whether timer #1 should apply on Sunday - a boolean
The same fields can be used replacing timer1 with timer2 and timer3.
Response
The server will respond with details of the updated subdevice.
{
  "id": 1,
  "label": "My Subdevice",
  "extra_data": {}
}