Sign inSign up

rraboy/go-ecobee

By rraboy

•Updated about 6 years ago

https://github.com/rraboy/go-ecobee

Image
0

6.2K

rraboy/go-ecobee repository overview

⁠go-ecobee

A go library and simple tools for accessing the Ecobee Thermostat API⁠.

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

Obtain an Ecobee API Application ID at https://www.ecobee.com/consumerportal/index.html#/dev⁠

⁠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⁠.

⁠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.

thermostat: <Thermostat ID>
appid: <App ID>
⁠Docker
make
⁠Kubernetes

Create config.yaml in the current directory. Follow the Config section above.

Create authcache by registering your application:

./go-ecobee status --config config.yaml --authcache authcache

Now, apply the kube.yaml

kubectl apply -f <(./gen-kube.yaml.sh)

⁠CLI Usage

⁠Status
$ 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
$ go-ecobee hold --heat 70 --cool 76 --duration 10m
Successfully Held Temperature
⁠Message
$ go-ecobee message --message="Hi there!"
Successfully sent message: "Hi there!"
⁠Fan
$ go-ecobee fan --duration=5m
Running fan for 5 minutes"
⁠List
$ go-ecobee list
${THERMID}: My ecobee3

⁠Development

⁠Staticcheck

https://github.com/dominikh/go-tools⁠

staticcheck ./ecobee/ ./cmd/ .

⁠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.

Tag summary

Content type

Image

Digest

Size

10.1 MB

Last updated

about 6 years ago

docker pull rraboy/go-ecobee