https://github.com/ecobee/python_api_sdk
A pythonic way to interface with the ecobee api
https://github.com/ecobee/python_api_sdk
Last synced: 9 months ago
JSON representation
A pythonic way to interface with the ecobee api
- Host: GitHub
- URL: https://github.com/ecobee/python_api_sdk
- Owner: ecobee
- Created: 2018-04-30T21:43:31.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-04-07T15:44:51.000Z (about 4 years ago)
- Last Synced: 2025-06-16T11:06:53.603Z (about 1 year ago)
- Language: Python
- Size: 30.3 KB
- Stars: 11
- Watchers: 3
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Ecobee API Python SDK
This project provides a simple python interface to interact with the ecobee Web REST API.
Overview
It provides the following functionality
- Manage Tokens Operations like regestering and refreshing
- Format boilerplate api requests.
- Provide simple functions to perform common api operations
Install Guide
Before you begin Register as an ecobee Developer Here https://www.ecobee.com/developers/
Note: lines with $ mean execute this command in bash
``` bash
Clone the Repository
$ git clone https://github.com/ecobee/python_api_sdk.git
Navigate inside the root directory
$ cd python_api_sdk
Install the Repository
$ pip install .
#Run the interactive enviornment setup note this only works for mac / linux
$ python setup_scripts/env_setup.py
```
User Guide
Note: Bolded Lines with >>> mean execute this command in python
Adding Users
``` python
>>> # Create an ApiInterface object
>>> from ebapi.api_interface import ApiInterface
>>> interface = ApiInterface()
>>>
>>> #Add a user
>>> interface.add_user()
Enter the PIN '<4-digit-pin>' into the Add Application window and click Add Application
waiting press enter to continue...
>>>
```
Adding an 3rd Party Application
- Navigate to www.ecobee.com and login with you username and password
- My Account (Top right)
- My Apps (Bottom Left)
- Add application (Bottom Left)
- Enter the <4-digit-pin> into the text box
- Click Validate (Bottom Right)
- Click Add Application
Return to you python session and press Enter
The SDK will have stored access and refresh tokens for the user accout
It will also store a all the thermostats that the user has
Making Requests
Requests are made by sepecifying a method of the ApiInterface Object
and a 12 digit Thermostat Identifier.
These can be found on the About My Thermostat (Bottom Right of a Thermostat Page)
All Requests Reutrn Dictionaries from the Ecobee API's JSON format.
Reference Documentation: https://www.ecobee.com/home/developer/api/introduction/index.shtml
Object Defitions: https://www.ecobee.com/home/developer/api/documentation/v1/auth/auth-intro.shtml
``` python
>>> # will dispay the Thermostat ID that are stored
>>> thermostat_identifier.show_users()
>>>
>>> #12 digit thermostat ID
>>> thermostat_identifier = "123456789012"
>>>
>>> # Return a Dictionary of the thermostats settings
>>> interface.get_settings(thermostat_identifier)
>>>
```