Documentation ¶
Index ¶
- Variables
- func SaveToken(clientID string, cacheFile string, code string) error
- func TokenSource(clientID, cacheFile string) oauth2.TokenSource
- type Alert
- type Client
- func (c *Client) GetThermostat(thermostatID string) (*Thermostat, error)
- func (c *Client) GetThermostatSummary(selection Selection) (map[string]ThermostatSummary, error)
- func (c *Client) GetThermostats(selection Selection) ([]Thermostat, error)
- func (c *Client) HoldTemp(thermostat string, heat, cool float64, d time.Duration) error
- func (c *Client) ResumeProgram(id string, resumeAll bool) error
- func (c *Client) RunFan(id string, duration time.Duration) error
- func (c *Client) SendMessage(thermostat, message string) error
- func (c *Client) UpdateThermostat(utr UpdateThermostatRequest) error
- type Climate
- type EquipmentStatus
- type Event
- type ExtendedRuntime
- type Function
- type GetThermostatSummaryRequest
- type GetThermostatSummaryResponse
- type GetThermostatsRequest
- type GetThermostatsResponse
- type Page
- type PinResponse
- type Program
- type RemoteSensor
- type RemoteSensorCapability
- type ResumeProgramParams
- type Runtime
- type Selection
- type SendMessageParams
- type SetHoldParams
- type Settings
- type Status
- type Thermostat
- type ThermostatSummary
- type ThermostatSummaryMap
- type UpdateThermostatRequest
- type UpdateThermostatResponse
- type Weather
- type WeatherForecast
Constants ¶
This section is empty.
Variables ¶
var Scopes = []string{"smartRead", "smartWrite"}
Scopes defines the scopes we request from the API.
Functions ¶
func SaveToken ¶
SaveToken retreives a new token from ecobee and saves it to the auth cache after a pin/code combination has been added by an ecobee user.
func TokenSource ¶
func TokenSource(clientID, cacheFile string) oauth2.TokenSource
Types ¶
type Alert ¶
type Alert struct { // AcknowledgeRef string `json:"acknowledgeRef"` // Date string `json:"date"` // Time string `json:"time"` // Severity string `json:"severity"` Text string `json:"text"` // AlertNumber int `json:"alertNumber"` AlertType string `json:"alertType"` IsOperatorAlert bool `json:"isOperatorAlert"` }
type Client ¶
Client represents the Ecobee API client.
func NewClient ¶
NewClient creates a Ecobee API client for the specific clientID (Application Key). Use the Ecobee Developer Portal to create the Application Key. (https://www.ecobee.com/consumerportal/index.html#/dev)
func (*Client) GetThermostat ¶
func (c *Client) GetThermostat(thermostatID string) (*Thermostat, error)
func (*Client) GetThermostatSummary ¶
func (c *Client) GetThermostatSummary(selection Selection) (map[string]ThermostatSummary, error)
func (*Client) GetThermostats ¶
func (c *Client) GetThermostats(selection Selection) ([]Thermostat, error)
func (*Client) SendMessage ¶
func (*Client) UpdateThermostat ¶
func (c *Client) UpdateThermostat(utr UpdateThermostatRequest) error
type Climate ¶
type Climate struct { Name string `json:"name"` ClimateRef string `json:"climateRef"` IsOccupied bool `json:"isOccupied"` IsOptimized bool `json:"isOptimized"` CoolFan string `json:"coolFan"` HeatFan string `json:"heatFan"` Vent string `json:"vent"` VentilatorMinOnTime int `json:"ventilatorMinOnTime"` Owner string `json:"owner"` Type string `json:"type"` Colour int `json:"colour"` CoolTemp int `json:"coolTemp"` HeatTemp int `json:"heatTemp"` Sensors []RemoteSensor `json:"sensors"` }
type EquipmentStatus ¶
type EquipmentStatus struct {
HeatPump, HeatPump2, HeatPump3, CompCool1, CompCool2, AuxHeat1, AuxHeat2, AuxHeat3, Fan, Humidifier, Dehumidifier, Ventilator, Economizer, CompHotWater, AuxHotWater bool
}
Not part of the API
func (*EquipmentStatus) Set ¶
func (es *EquipmentStatus) Set(field string, state bool)
type Event ¶
type Event struct { Type string `json:"type"` Name string `json:"name"` Running bool `json:"running"` StartDate string `json:"startDate"` StartTime string `json:"startTime"` EndDate string `json:"endDate"` EndTime string `json:"endTime"` IsOccupied bool `json:"isOccupied"` IsCoolOff bool `json:"isCoolOff"` IsHeatOff bool `json:"isHeatOff"` CoolHoldTemp int `json:"coolHoldTemp"` HeatHoldTemp int `json:"heatHoldTemp"` Fan string `json:"fan"` Vent string `json:"vent,omitempty"` VentilatorMinOnTime int `json:"ventilatorMinOnTime,omitempty"` IsOptional bool `json:"isOptional"` IsTemperatureRelative bool `json:"isTemperatureRelative"` CoolRelativeTemp int `json:"coolRelativeTemp"` HeatRelativeTemp int `json:"heatRelativeTemp"` IsTemperatureAbsolute bool `json:"isTemperatureAbsolute"` DutyCyclePercentage int `json:"dutyCyclePercentage"` FanMinOnTime int `json:"fanMinOnTime"` OccupiedSensorActive bool `json:"occupiedSensorActive,omitempty"` UnoccupiedSensorActive bool `json:"unoccupiedSensorActive"` DrRampUpTemp int `json:"drRampUpTemp"` DrRampUpTime int `json:"drRampUpTime"` LinkRef string `json:"linkRef,omitempty"` HoldClimateRef string `json:"holdClimateRef,omitempty"` }
type ExtendedRuntime ¶
type ExtendedRuntime struct { LastReadingTimestamp string `json:"lastReadingTimestamp"` RuntimeDate string `json:"runtimeDate"` RuntimeInterval int `json:"runtimeInterval"` ActualTemperature []int `json:"actualTemperature"` ActualHumidity []int `json:"actualHumidity"` DesiredHeat []int `json:"desiredHeat"` DesiredCool []int `json:"desiredCool"` DesiredHumidity []int `json:"desiredHumidity"` DesiredDehumidity []int `json:"desiredDehumidity"` DmOffset []int `json:"dmOffset"` HvacMode []string `json:"hvacMode"` HeatPump1 []int `json:"heatPump1"` HeatPump2 []int `json:"heatPump2"` AuxHeat1 []int `json:"auxHeat1"` AuxHeat2 []int `json:"auxHeat2"` AuxHeat3 []int `json:"auxHeat3"` Cool1 []int `json:"cool1"` Cool2 []int `json:"cool2"` Fan []int `json:"fan"` Humidifier []int `json:"humidifier"` Dehumidifier []int `json:"dehumidifier"` Economizer []int `json:"economizer"` Ventilator []int `json:"ventilator"` CurrentElectricityBill int `json:"currentElectricityBill"` ProjectedElectricityBill int `json:"projectedElectricityBill"` }
type Function ¶
type Function struct { Type string `json:"type"` Params interface{} `json:"params"` }
type GetThermostatSummaryRequest ¶
type GetThermostatSummaryRequest struct {
Selection Selection `json:"selection"`
}
type GetThermostatsRequest ¶
type GetThermostatsResponse ¶
type GetThermostatsResponse struct { Page Page ThermostatList []Thermostat `json:"thermostatList"` Status Status `json:"status"` }
type PinResponse ¶
func Authorize ¶
func Authorize(clientID string) (*PinResponse, error)
Authorize retrieves an ecobee Pin and Code, allowing calling code to present them to the user outside of the ecobee request context. This is useful when non-interactive authorization is required. For example: an app being deployed and authorized using ansible, which does not support interacting with commands.
type RemoteSensor ¶
type RemoteSensorCapability ¶
type ResumeProgramParams ¶
type ResumeProgramParams struct {
ResumeAll bool `json:"resumeAll"`
}
type Runtime ¶
type Runtime struct { RuntimeRev string `json:"runtimeRev"` Connected bool `json:"connected"` FirstConnected string `json:"firstConnected"` ConnectDateTime string `json:"connectDateTime"` DisconnectDateTime string `json:"disconnectDateTime"` LastModified string `json:"lastModified"` LastStatusModified string `json:"lastStatusModified"` RuntimeDate string `json:"runtimeDate"` RuntimeInterval int `json:"runtimeInterval"` ActualTemperature int `json:"actualTemperature"` ActualHumidity int `json:"actualHumidity"` DesiredHeat int `json:"desiredHeat"` DesiredCool int `json:"desiredCool"` DesiredHumidity int `json:"desiredHumidity"` DesiredDehumidity int `json:"desiredDehumidity"` DesiredFanMode string `json:"desiredFanMode"` DesiredHeatRange []int `json:"desiredHeatRange"` DesiredCoolRange []int `json:"desiredCoolRange"` }
type Selection ¶
type Selection struct { SelectionType string `json:"selectionType"` SelectionMatch string `json:"selectionMatch"` IncludeRuntime bool `json:"includeRuntime"` IncludeExtendedRuntime bool `json:"includeExtendedRuntime"` IncludeElectricity bool `json:"includeElectricity"` IncludeSettings bool `json:"includeSettings"` IncludeLocation bool `json:"includeLocation"` IncludeProgram bool `json:"includeProgram"` IncludeEvents bool `json:"includeEvents"` IncludeDevice bool `json:"includeDevice"` IncludeTechnician bool `json:"includeTechnician"` IncludeUtility bool `json:"includeUtility"` IncludeManagement bool `json:"includeManagement"` IncludeAlerts bool `json:"includeAlerts"` IncludeWeather bool `json:"includeWeather"` IncludeHouseDetails bool `json:"includeHouseDetails"` IncludeOemCfg bool `json:"includeOemCfg"` IncludeEquipmentStatus bool `json:"includeEquipmentStatus"` IncludeNotificationSettings bool `json:"includeNotificationSettings"` IncludePrivacy bool `json:"includePrivacy"` IncludeVersion bool `json:"includeVersion"` IncludeSecuritySettings bool `json:"includeSecuritySettings"` IncludeSensors bool `json:"includeSensors"` IncludeAudio bool `json:"includeAudio"` }
type SendMessageParams ¶
type SetHoldParams ¶
type SetHoldParams struct { Event CoolHoldTemp int `json:"coolHoldTemp"` HeatHoldTemp int `json:"heatHoldTemp"` HoldClimateRef string `json:"holdClimateRef,omitempty"` StartDate string `json:"startDate,omitempty"` StartTime string `json:"startTime,omitempty"` EndDate string `json:"endDate,omitempty"` EndTime string `json:"endTime,omitempty"` HoldType string `json:"holdType,omitempty"` HoldHours int `json:"holdHours,omitempty"` }
type Thermostat ¶
type Thermostat struct { Identifier string `json:"identifier"` Name string `json:"name"` ThermostatRev string `json:"thermostatRev"` IsRegistered bool `json:"isRegistered"` ModelNumber string `json:"modelNumber"` Brand string `json:"brand"` Features string `json:"features"` LastModified string `json:"lastModified"` ThermostatTime string `json:"thermostatTime"` UtcTime string `json:"utcTime"` //Alerts []Alert `json:"alerts"` Settings Settings `json:"settings"` Runtime Runtime `json:"runtime"` ExtendedRuntime ExtendedRuntime `json:"extendedRuntime"` /// ... Events []Event `json:"events"` Program Program `json:"program"` /// ... RemoteSensors []RemoteSensor `json:"remoteSensors"` Weather Weather `json:"weather"` }
type ThermostatSummary ¶
type ThermostatSummary struct { Identifier string `json:"Identifier"` Name string `json:"Name"` Connected bool `json:"Connected"` ThermostatRevision string `json:"ThermostatRevision"` AlertsRevision string `json:"AlertsRevision"` RuntimeRevision string `json:"RuntimeRevision"` IntervalRevision string `json:"IntervalRevision"` EquipmentStatus }
type ThermostatSummaryMap ¶
type ThermostatSummaryMap map[string]ThermostatSummary
type UpdateThermostatRequest ¶
type UpdateThermostatResponse ¶
type UpdateThermostatResponse struct {
Status Status `json:"status"`
}
type Weather ¶
type Weather struct { Timestamp string `json:"timestamp"` WeatherStation string `json:"weatherStation"` Forecasts []WeatherForecast `json:"forecasts"` }
type WeatherForecast ¶
type WeatherForecast struct { WeatherSymbol int `json:"weatherSymbol"` DateTime string `json:"dateTime"` Condition string `json:"condition"` Temperature int `json:"temperature"` Pressure int `json:"pressure"` RelativeHumidity int `json:"relativeHumidity"` Dewpoint int `json:"dewpoint"` Visibility int `json:"visibility"` WindSpeed int `json:"windSpeed"` WindGust int `json:"windGust"` WindDirection string `json:"windDirection"` WindBearing int `json:"windBearing"` Pop int `json:"pop"` TempHigh int `json:"tempHigh"` TempLow int `json:"tempLow"` Sky int `json:"sky"` }