setHold does not create Event as expected

42 Views Asked by At

I am all authenticated, and send this request to https://api.ecobee.com/1/thermostat:

{"selection":{"selectionType":"registered","selectonMatch":""},"functions":[{"type":"setHold","params":{"holdType":"indefinite","heatHoldTemp":716,"coolHoldTemp":716}}]}

I get as answer:

{
  "page": {
    "page": 1,
    "totalPages": 1,
    "pageSize": 1,
    "total": 1
  },
  "thermostatList": [
    {
      "identifier": "--hidden--",
      "name": "Thermostat",
      "thermostatRev": "230212020022",
      "isRegistered": true,
      "modelNumber": "nikeSmart",
      "brand": "ecobee",
      "features": "Home,HomeKit",
      "lastModified": "2023-02-12 02:00:22",
      "thermostatTime": "2023-02-13 11:36:30",
      "utcTime": "2023-02-13 16:36:30"
    }
  ],
  "status": {
    "code": 0,
    "message": ""
  }
}

But there is no Events in my thermostat:

 "events": [
    {
      "type": "template",
      "name": "_Default_",
      "running": false,
      "startDate": "2037-01-01",
      "startTime": "01:01:01",
      "endDate": "2037-01-01",
      "endTime": "02:01:01",
      "isOccupied": false,
      "isCoolOff": false,
      "isHeatOff": false,
      "coolHoldTemp": 788,
      "heatHoldTemp": 644,
      "fan": "auto",
      "vent": "off",
      "ventilatorMinOnTime": 5,
      "isOptional": true,
      "isTemperatureRelative": false,
      "coolRelativeTemp": 40,
      "heatRelativeTemp": 40,
      "isTemperatureAbsolute": true,
      "dutyCyclePercentage": 255,
      "fanMinOnTime": 20,
      "occupiedSensorActive": false,
      "unoccupiedSensorActive": false,
      "drRampUpTemp": 0,
      "drRampUpTime": 3600,
      "linkRef": "",
      "holdClimateRef": "",
      "fanSpeed": "low"
    }
  ]

I am expecting, following the guide, that a Hold event is present. I do not see either a change on my thermostat UI.

1

There are 1 best solutions below

0
On

Found it.

  1. I was using HTTP GET instead of POST.
  2. There was some typos in my JSON (selecton)
  3. I was appending payload to URL, not as POST payload.