Ecobee change participating sensor in comfort settings
Issue
When you manually adjust the temperature and put the thermostat on Hold, your sensors will follow the sensor participation rules you've set up for your Home Comfort Setting. If we hold the temperature, the participating sensors change to the Home Comfort settings. In my case, I use the living room sensors during the day and the bedroom sensors at night. The result is that if we set a hold during the night, the HVAC sets the correct temperature in the Living room. Instead of changing the comfort setting from Home to Sleep, I change the Home comfort settings with the temperature and the sensors for the night.
Get token with Ecobee
Create app in ecobee in Developer tab
Get the API key.
Request an Ecobee PIN
curl "https://api.ecobee.com/authorize?response_type=ecobeePin&client_id=${API_KEY}&scope=smartWrite" { "ecobeePin": "XXXX-XXXX", "code": "${APP_CODE}", "interval": 5, "expires_in": 900, "scope": "openid,offline_access,smartWrite" }
Create the app in Ecobee with the ecobeePin received
Request an access token with the App code and the API Key.
curl -d "grant_type=ecobeePin" -d "code=${APP_CODE}" -d "client_id=${API_KEY}" https://api.ecobee.com/token { "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlJFWXhNVEpDT0Rnek9UaERRelJHTkRCRlFqZEdNVGxETnpaR1JUZzRNalEwTmtWR01UQkdPQSJ9.eyJodHRwczovL2NsYWltcy5lY29iZWUuY29tL21mYV9hY3RpdmUiOnRydWUsImlzcyI6Imh0dHBzOi8vYXV0aC5lY29iZWUuY29tLyIsInN1YiI6ImF1dGgwfDlkMThmNzA5LTY2YjktNDQzNC04NWZmLTAxNGM0ZGIzNWFlNyIsImF1ZCI6WyJodHRwczovL2RldmVsb3Blci1hcHBzLmVjb2JlZS5jb20vYXBpL3YxIiwiaHR0cHM6Ly9lY29iZWUtcHJvZC5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNzEwNDMzOTAyLCJleHAiOjE3MTA0Mzc1MDIsImF6cCI6ImRKY2ZuczhCbjY2a09SS3NDYzNMbEswOXQwelAxVzdzIiwic2NvcGUiOiJvcGVuaWQgc21hcnRXcml0ZSBvZmZsaW5lX2FjY2VzcyJ9.VnNs05Hw-jslSGfQfW8dzSuz7SuEt2aanwPfdAgz6qadClimJHuDEJ_aM5Pyw4vGIHsmBUMinuyUURMB0PLT7raM1WYnPzUVk_cAo22O8uEfbcRWNxKBKJ6Wk5-5ByrSOJM4CHNmqtC2vpELmZAykAUJIfcC9p0ysdu-ChDeM33-Jhq0ODrLdsY8_8FxJMujys0sUEk7JGvlN0pqqVNEjgx4Afpt3m0QUg3NrOCOgpFk7zuRjk1Gkgmic9Tm_y4Ghibt_6aizE6diFeXWyGikIkcQSK4xNg3IoKLxmsYL06fRL22Q7XrRqTXqzVH__pP4YdzWjPIPOgjP21p7ieoVA", "token_type": "Bearer", "expires_in": 3600, "scope": "openid,smartWrite,offline_access", "refresh_token": "${REFRESH_TOKEN}" }
The access token is valid for 1 hour. The refresh token is valid during one year.
Refresh Token:
curl -d "grant_type=refresh_token" -d "code=${REFRESH_TOKEN}" -d "client_id=${API_KEY}" https://api.ecobee.com/token { "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlJFWXhNVEpDT0Rnek9UaERRelJHTkRCRlFqZEdNVGxETnpaR1JUZzRNalEwTmtWR01UQkdPQSJ9.eyJodHRwczovL2NsYWltcy5lY29iZWUuY29tL21mYV9hY3RpdmUiOnRydWUsImlzcyI6Imh0dHBzOi8vYXV0aC5lY29iZWUuY29tLyIsInN1YiI6ImF1dGgwfDlkMThmNzA5LTY2YjktNDQzNC04NWZmLTAxNGM0ZGIzNWFlNyIsImF1ZCI6WyJodHRwczovL2RldmVsb3Blci1hcHBzLmVjb2JlZS5jb20vYXBpL3YxIiwiaHR0cHM6Ly9lY29iZWUtcHJvZC5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNzEwNDM0MDcyLCJleHAiOjE3MTA0Mzc2NzIsImF6cCI6ImRKY2ZuczhCbjY2a09SS3NDYzNMbEswOXQwelAxVzdzIiwic2NvcGUiOiJvcGVuaWQgc21hcnRXcml0ZSBvZmZsaW5lX2FjY2VzcyJ9.dh9Jfq35Dw7mYkbrFiEgabH-bMlAFX59YdKzBqZ5qDAPWk9lVLqDyXmRj51ojG7xpckxuWDG7L6exATb-w140oVnk9N_M5V0HzpFrLHNBD4dKLTYPR8YFUqCMkZecYgEnFkmHOyDXff4KautL33crgblscJnUPsuZd5RirtK26BWSpvTrQXKxDOnxE2nxFpGBo76cs4Mwpk5DWVaDyRUhMyxFrZaDMz6OF7Bq1pindU6eLGLqSDeIpmVAgs_7OqZUzDJ3-hQc9u7fjQ9eP67G1UniuRAauZQxZAw5SacR8Fr_VOTi_6hGIZk8XwrBl8k9p940oxyaJ64eWxR1aZdMw", "token_type": "Bearer", "refresh_token": "${REFRESH_TOKEN}", "expires_in": 3600, "scope": "openid,smartWrite,offline_access" }
Or to store it in a variable
TOKEN=`curl -s -d "grant_type=refresh_token" -d "code=${REFRESH_TOKEN}" -d "client_id=${API_KEY}" https://api.ecobee.com/token | jq -r .access_token`
References
Daniel Simao 17:18, 14 March 2024 (EDT)