Can't toggle microphoneEnabled off via ecobee API

52 Views Asked by At

I’m trying to toggle the microphone with an API call by setting microphoneEnabled to false or true but it doesn't seem to be having any effect.

It's listed in the docs but can't seem to get it to work.

Here's an example call I'm making

curl --request POST \
  --url https://api.ecobee.com/1/thermostat \
  --header 'Authorization: Bearer eyJ......' \
  --header 'Content-Type: application/json' \
  --data '{
  "selection": {
    "selectionType": "registered",
    "selectionMatch": ""
  },
  "thermostat": {
        "audio": {
            "microphoneEnabled": true
        },
    "settings": {
      "autoAway": true,
      "followMeComfort": true
    }
  }
}'

Any tips would be most appreciated!

1

There are 1 best solutions below

0
On

Looking at the API doc link, it looks like "audio" is its own object. Your json shows "audio" under the "thermostat" object. Try the following:

{
    "selection": {
        "selectionType": "registered",
        "selectionMatch": ""
    },
    "audio": {
        "microphoneEnabled": true
    },
    "thermostat": {
        "settings": {
            "autoAway": true,
            "followMeComfort": true
        }
    }
}

Well ... the API Doc is crap ... Looks like your original json seems to be valid

{
    "selection": {
        "selectionType": "registered",
        "selectionMatch": ""
    },
    "thermostat": {
        "audio": {
            "microphoneEnabled": true
        },
        "settings": {
            "autoAway": true,
            "followMeComfort": true
        }
    }
}

The only other thing is that "audio" is only valid on Ecobee v4 thermostats.

You can query the audio settings from the following request:

{"selection":{"selectionType":"registered","selectionMatch":null,"includeAudio":true}}

and the curl with percent-encoding the json"

curl -s  'https://api.ecobee.com/1/thermostat?json=%7B%22selection%22%3A%7B%22selectionType%22%3A%22registered%22%2C%22selectionMatch%22%3Anull%2C%22includeAudio%22%3Atrue%7D%7D' -H 'Authorization: Bearer ACCESS_TOKEN'