Documentation

← Back to site

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 device
  • extra_data - a place to store application-specific JSON data
  • device_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/list endpoint

Optional parameters for timers

  • timer1_enabled - whether to enable timer #1 - a boolean
  • timer1_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 boolean
  • timer1_tuesday - whether timer #1 should apply on Tuesday - a boolean
  • timer1_wednesday - whether timer #1 should apply on Wednesday - a boolean
  • timer1_thursday - whether timer #1 should apply on Thursday - a boolean
  • timer1_friday - whether timer #1 should apply on Friday - a boolean
  • timer1_saturday - whether timer #1 should apply on Saturday - a boolean
  • timer1_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": {}
}