Reference API App returns no thermostats on thermostatSummary request

Hello, we just started learning the EcoBee system and trying to get the Reference API App working. However, it always returns thermostatCount: 0 and we can't access the list of devices. There are more than 30 thermostats installed on this EMS, and they are all visible on the web on via the Android app. Authorization and token refresh process return no errors. Could it be related to the account privileges, access rules, etc...? Thank you for you time!
Example reply:

GET Thermostats:

curl -s -H 'Content-Type: text/json' -H 'Authorization: Bearer CODE' 'https://api.ecobee.com/1/thermostat?j...'

Reply:
{
"status": {
"code": 2,
"message": "Not authorized. Selection criteria \u0027registered\u0027 is not permitted for this user."
}
}

/home//api/1/thermostatSummary?json=%7B%22selection%22%3A%7B%22selectionType%22%3A%22registered%22%2C%22selectionMatch%22%3Anull%7D%7D&token=TOKEN
{ thermostatCount: 0,
revisionList: [],
statusList: [],
status: { code: 0, message: '' } }
200
{ thermostatCount: 0,
revisionList: [],
statusList: [],
status: { code: 0, message: '' } }
GET /thermostats 200 666ms - 1.71kb
GET /css/bootstrap.min.css 304 2ms
GET /js/bootstrap.min.js 304 4ms
GET /css/bootstrap-responsive.min.css 304 10ms
GET /img/glyphicons-halflings.png 304 1ms
2 people have
this problem
+1
Reply
  • Andy,

    The problem is returned in the error message from the API: Not authorized. Selection criteria \u0027registered\u0027 is not permitted for this user.

    The selection criteria "registered" is not permitted for EMS accounts. Registered is documented to return thermostats registered to an end user. EMS companies don't have thermostats registered to an individual user, they have them managed in Management Sets. You need to use "thermostats" or "managementSet" selection types.

    If you want all of them, type="managementSet" with match="/" will give you all thermostats added to your EMS portal.
    • In addition to what Mark said, I also noticed that you said you were using the reference API App. That app is configured to use the 'smartWrite' scope which is only applicable to residential accounts. You need to have your app use the 'ems' scope in order to perform EMS operations on an EMS user that has granted access to your App. See https://www.ecobee.com/home/developer... for more details.
    • Hesham, thank you for the comment. We did change the scope to 'ems' both in config.js and in login.js. Currently, all tests are done with curl only and we still don't get the list of thermostats. I believe, we should give very detailed instructions to our customer (he is non-tech at all), on what to ask their EcoBee account manager. Could you point me to a doc or something, so we could formulate it in a clear way?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Mark, thank you very much for the help. Some information in the online documentation does not catch attention immediately, so obvious steps do take some extra time. I have a few more questions:

    When we run the list command:

    https://api.eobee.com/1/hierarchy/set...
    the reply is:
    {
    "sets": [
    {
    "setName": "My Sets",
    "setPath": "/",
    "children": [],
    "thermostats": []
    }
    ],
    "status": {
    "code": 0,
    "message": ""
    }
    }

    Does it mean that there are no registered thermostats for this EMS account or the app does not have sufficient access privileges?
    Also, as per you suggestion in the previous post, here is modified "GET thermostats" requests and it reply:
    https://api.ecobee.com/1/thermostat?j...
    {
    "status": {
    "code": 4,
    "message": "Serialization error. Malformed json. Check your request and parameters are valid."
    }
    }

    or GET List Demand response:
    https://api.eobee.com/1/demandRespons...'
    {
    "status": {
    "code": 2,
    "message": "Not authorized."
    }
    }

    On the web however, we see a tree of thermostats with the root like "Floor 1" and branches "Study room1", "StudyRoom 2", etc...

    We are afraid that our customer simply did not configure our account properly along with our API credentials. Also, apparently the thermostat hierarchy has not been configured and that is why all requests for "managementSet, scope "\" fail. Is there any document guide or an instruction set we could forward to our customer, so they can get our account created and configured properly? Our customer is not a tech person at all, and we are afraid to overwhelm him with multiple requests...

    Thank you in advance!
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • See my comment above regarding the application Scope your App is using. I think you are using the wrong application scope.

    Regarding the malformed json error, your request is indeed malformed. The selection parameter of your /thermostat request is as follows:

    \{
    "selection": \ {
    "includeAlerts": "true",
    "selectionType": "managementSet",
    "selectionMatch": "\",
    "includeEvents ":"true ",
    "includeSettings ":"true ",
    "includeRuntime ":"true"
    \}
    \}

    There seems to be an unecessary backslash in front of each brace in your json.

    Finally, the GET List Demand Response is only allowed for utility accounts as explained in the documentation.

    Hope this helps.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Sorry for the confusion, the extra backslashes were result of a copy from the terminal window.

    Just re-ran the sample app:

    200
    { ecobeePin: 'XXXX',
    code: 'XXXXX',
    scope: 'ems',
    expires_in: 9,
    interval: 30
    }

    /home//api/1/thermostatSummary?json=%7B%22selection%22%3A%7B%22selectionType%22%3A%22managementSet%22%2C%22selectionMatch%22%3A%22%2F%22%7D%7D&token=XXXX
    { thermostatCount: 0,
    revisionList: [],
    statusList: [],
    status: { code: 0, message: '' } }
    200
    { thermostatCount: 0,
    revisionList: [],
    statusList: [],
    status: { code: 0, message: '' } }
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited

  • Gents, we are still trying to understand why we are having only web access to the ems account. This account has been intentionally created with limited access to only one floor of one building, and we do see all thermostats from there on the website. The scope has been specified as 'ems' and authorization, pin, access token all pass just fine.

    However, request using curl return 0 thermostats:

    curl -s -H 'Content-Type: text/json' -H 'Authorization: Bearer XXXXXXXXXXXXXX' 'https://api.ecobee.com/1/thermostatSu...'
    {
    "thermostatCount": 0,
    "revisionList": [],
    "statusList": [],
    "status": {
    "code": 0,
    "message": ""
    }
    }

    Another failure:
    curl -s -H 'Content-Type: text/json' -H 'Authorization: Bearer XXXXXXXXXXXXX' 'https://api.ecobee.om/1/thermostat?js...'
    {
    "status": {
    "code": 2,
    "message": "Not authorized. Management set does not exist or is not permitted: /"
    }
    }

    Is there anything which was not set by our customer with regard to our access privileges, which prevents us from getting access? We ultimately, need to be able to read each thermostat readings and settings.

    Thank you for your time,
    Andy
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated indifferent, undecided, unconcerned kidding, amused, unsure, silly happy, confident, thankful, excited