https://github.com/rspier/go-ecobee
A go library for the Ecobee Thermostat API
https://github.com/rspier/go-ecobee
ecobee home-automation thermostat
Last synced: over 1 year ago
JSON representation
A go library for the Ecobee Thermostat API
- Host: GitHub
- URL: https://github.com/rspier/go-ecobee
- Owner: rspier
- License: apache-2.0
- Created: 2017-05-13T22:14:59.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-06-30T05:31:32.000Z (almost 2 years ago)
- Last Synced: 2025-02-27T19:03:36.051Z (over 1 year ago)
- Topics: ecobee, home-automation, thermostat
- Language: Go
- Homepage:
- Size: 52.7 KB
- Stars: 18
- Watchers: 2
- Forks: 15
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# go-ecobee
A go library and simple tools for accessing the
[Ecobee Thermostat API](https://www.ecobee.com/home/developer/api/documentation/v1/index.shtml).
The go-ecobee CLI is built with the underlying go-ecobee API, and
serves as it's primary example.
## Setup
### Install
```
go install -u github.com/rspier/go-ecobee`
```
### Build
```
go build main.go
# fully static binary
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o main
```
### Application ID
[Enable your developer dashboard](https://www.ecobee.com/home/developer/loginDeveloper.jsp), if you have not already.
Create an Ecobee API Application ID (API key) by going to the
[consumer portal](https://www.ecobee.com/consumerportal/index.html), clicking the "Developer" option in the menu, and clicking the "Create New" button.
You probably want to use the `ecobee PIN` authorization method for non-web based
tools.
### Thermostat ID
You'll need to know the serial number (Thermostat ID) of your
thermostat. You can find it on the About page of the
[Ecobee portal](https://www.ecobee.com/consumerportal/index.html).
### Config
You can store your default thermostat id and appid in
`~/.go-ecobee.yaml` or you can use the `--thermostat` and `--appid`
flags to the CLI.
```yaml
thermostat:
appid:
```
## CLI Usage
### Status
```shell
$ go-ecobee --command=status
Current Settings (Home): 68.0 - 75.0. Fan: auto
Holding at 68.0 - 75.0 (Fan: auto) until 2017-04-22 00:00:00
Temperature: 75.0
Bedroom\*: 74.7
My ecobee3\*: 76.2
```
### Hold Temperature
```shell
$ go-ecobee hold --heat 70 --cool 76 --duration 10m
Successfully Held Temperature
```
### Message
```shell
$ go-ecobee message --message="Hi there!"
Successfully sent message: "Hi there!"
```
### Fan
```shell
$ go-ecobee fan --duration=5m
Running fan for 5 minutes"
```
### List
```shell
$ go-ecobee list
${THERMID}: My ecobee3
```
## Development
## Lint
Use [golangci-lint](https://golangci-lint.run/):
```shell
docker run --rm -v $(pwd):/app -w /app \
golangci/golangci-lint:v1.35.2 golangci-lint run \
-E golint,goimports,misspell
```
## Ideas for future development
### Sensor Failure Test
Use includeSensors on the thermostat endpoint to analyze sensors where
the presence sensor may have failed -- i.e. present all the time.
## Disclaimer
This is not an official Google project.