Documentation

← Back to site

Power a socket on/off

Last updated on February 12, 2015 15:58

This pair of methods allow a socket to be switched on or off.

URL

/api/v1/subdevices/power_on
/api/v1/subdevices/power_off

Parameters

  • id - the ID of the subdevice to power on of off
  • socket - for multiplug devices, the index of the individual socket to power on or off (0-3)

Response

This method returns information about the subdevice being powered on or off.

[
  {
    "id": 1,
    "device_id": 1,
    "label": "My Radio Socket",
    "power_state": 1,
    "startup_mode": 0,
    "aggregated_hourly_at": "2014-10-09T11:58:18.000Z",
    "aggregated_daily_at": "2014-10-09T11:58:18.000Z",
    "device_type": "ecalm",
    "remote_id": 1,
    "today_wh": 1500
    "today_wh_range": "medium"
    "last_data_instant": 100
    "unknown_state?": false
    "device_groups": [
      {
        "id": 1,
        "name": "My Devices",
        "user_id": 1
      }
    ] 
  }

]