Documentation ¶
Index ¶
- Constants
- Variables
- func Oauth2ConfigForRealm(realm string) *oauth2.Config
- func ReadBody(resp *http.Response) ([]byte, error)
- func RefreshTokenSource(token *oauth2.Token, refresher TokenRefresher) oauth2.TokenSource
- func ResponseError(resp *http.Response) error
- type ConfigurationCircuit
- type ConfigurationDhw
- type ConfigurationDomesticHotWater
- type ConfigurationZone
- type Connection
- func (c *Connection) GetHomes() (Homes, error)
- func (c *Connection) GetSystem(systemId string) (SystemStatus, error)
- func (c *Connection) StartHotWaterBoost(systemId string, hotwaterIndex int) error
- func (c *Connection) StartZoneQuickVeto(systemId string, zone int, setpoint float32, duration float32) error
- func (c *Connection) StopHotWaterBoost(systemId string, hotwaterIndex int) error
- func (c *Connection) StopZoneQuickVeto(systemId string, zone int) error
- type CredentialsStruct
- type Helper
- type Homes
- type Identity
- type MetaInfo
- type PropertiesCircuit
- type PropertiesDhw
- type PropertiesDomesticHotWater
- type PropertiesZone
- type Setpoint
- type StateCircuit
- type StateDhw
- type StateDomesticHotWater
- type StateZone
- type StatusError
- type SystemStatus
- type TimeProgram
- type TimeSlot
- type TokenRefresher
- type TokenRequestStruct
- type TokenSource
Constants ¶
View Source
const ( CLIENT_ID = "myvaillant" AUTH_BASE_URL = "https://identity.vaillant-group.com/auth/realms" LOGIN_URL = AUTH_BASE_URL + "/%s/login-actions/authenticate" TOKEN_URL = AUTH_BASE_URL + "/%s/protocol/openid-connect/token" AUTH_URL = AUTH_BASE_URL + "/%s/protocol/openid-connect/auth" API_URL_BASE = "https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1" )
View Source
const ( HOTWATERBOOST_URL = "/systems/%s/tli/domestic-hot-water/%01d/boost" ZONEQUICKVETO_URL = "/systems/%s/tli/zones/%01d/quick-veto" // SYSTEM_URL = "/systemcontrol/tli/v1" // FACILITIES_URL = "not to be used" // LIVEREPORT_URL = "/livereport/v1" HOTWATERINDEX_DEFAULT = 255 )
View Source
const REALM_GERMANY = "vaillant-germany-b2c"
Variables ¶
View Source
var ( JSONContent = "application/json" // JSONEncoding specifies application/json JSONEncoding = map[string]string{ "Content-Type": JSONContent, "Accept": JSONContent, } // AcceptJSON accepting application/json AcceptJSON = map[string]string{ "Accept": JSONContent, } )
View Source
var Oauth2Config = Oauth2ConfigForRealm(REALM_GERMANY)
Functions ¶
func Oauth2ConfigForRealm ¶
func ReadBody ¶
ReadBody reads HTTP response and returns error on response codes other than HTTP 2xx. It closes the request body after reading.
func RefreshTokenSource ¶
func RefreshTokenSource(token *oauth2.Token, refresher TokenRefresher) oauth2.TokenSource
func ResponseError ¶
ResponseError turns an HTTP status code into an error
Types ¶
type ConfigurationCircuit ¶
type ConfigurationCircuit struct { Index int `json:"index"` HeatingCurve float64 `json:"heatingCurve"` HeatingFlowTemperatureMinimumSetpoint float64 `json:"heatingFlowTemperatureMinimumSetpoint"` HeatingFlowTemperatureMaximumSetpoint float64 `json:"heatingFlowTemperatureMaximumSetpoint"` HeatDemandLimitedByOutsideTemperature float64 `json:"heatDemandLimitedByOutsideTemperature"` HeatingCircuitFlowSetpointExcessOffset float64 `json:"heatingCircuitFlowSetpointExcessOffset"` SetBackModeEnabled bool `json:"setBackModeEnabled"` RoomTemperatureControlMode string `json:"roomTemperatureControlMode"` }
type ConfigurationDhw ¶
type ConfigurationDhw struct { Index int `json:"index"` OperationModeDhw string `json:"operationModeDhw"` TappingSetpoint float64 `json:"tappingSetpoint"` HolidayStartDateTime time.Time `json:"holidayStartDateTime"` HolidayEndDateTime time.Time `json:"holidayEndDateTime"` TimeProgramDhw TimeProgram `json:"timeProgramDhw"` TimeProgramCirculationPump TimeProgram `json:"timeProgramCirculationPump"` }
type ConfigurationDomesticHotWater ¶
type ConfigurationDomesticHotWater struct { Index int `json:"index"` OperationModeDomesticHotWater string `json:"operationModeDomesticHotWater"` TappingSetpoint float64 `json:"tappingSetpoint"` HolidayStartDateTime time.Time `json:"holidayStartDateTime"` HolidayEndDateTime time.Time `json:"holidayEndDateTime"` TimeProgramDomesticHotWater TimeProgram `json:"timeProgramDomesticHotWater"` TimeProgramCirculationPump TimeProgram `json:"timeProgramCirculationPump"` }
type ConfigurationZone ¶
type ConfigurationZone struct { Index int `json:"index"` General struct { Name string `json:"name"` HolidayStartDateTime time.Time `json:"holidayStartDateTime"` HolidayEndDateTime time.Time `json:"holidayEndDateTime"` HolidaySetpoint float64 `json:"holidaySetpoint"` } `json:"general"` Heating struct { OperationModeHeating string `json:"operationModeHeating"` SetBackTemperature float64 `json:"setBackTemperature"` ManualModeSetpointHeating float64 `json:"manualModeSetpointHeating"` TimeProgramHeating TimeProgram `json:"timeProgramHeating"` } `json:"heating"` }
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection is the Sensonet connection
func NewConnection ¶
func NewConnection(client *http.Client, credentials *CredentialsStruct, token *oauth2.Token) (*Connection, *oauth2.Token, error)
NewConnection creates a new Sensonet device connection.
func (*Connection) GetHomes ¶
func (c *Connection) GetHomes() (Homes, error)
Returns all "homes" that belong to the current user under the myVaillant portal
func (*Connection) GetSystem ¶
func (c *Connection) GetSystem(systemId string) (SystemStatus, error)
Returns the system report (state, properties and configuration) for a specific systemId
func (*Connection) StartHotWaterBoost ¶
func (c *Connection) StartHotWaterBoost(systemId string, hotwaterIndex int) error
func (*Connection) StartZoneQuickVeto ¶
func (*Connection) StopHotWaterBoost ¶
func (c *Connection) StopHotWaterBoost(systemId string, hotwaterIndex int) error
func (*Connection) StopZoneQuickVeto ¶
func (c *Connection) StopZoneQuickVeto(systemId string, zone int) error
type CredentialsStruct ¶
type Helper ¶
Helper provides utility primitives
type Homes ¶
type Homes []struct { HomeName string `json:"homeName"` Address struct { Street string `json:"street"` Extension any `json:"extension"` City string `json:"city"` PostalCode string `json:"postalCode"` CountryCode string `json:"countryCode"` } `json:"address"` SerialNumber string `json:"serialNumber"` SystemID string `json:"systemId"` ProductMetadata struct { ProductType string `json:"productType"` ProductionYear string `json:"productionYear"` ProductionWeek string `json:"productionWeek"` ArticleNumber string `json:"articleNumber"` } `json:"productMetadata"` State string `json:"state"` MigrationState string `json:"migrationState"` MigrationFinishedAt time.Time `json:"migrationFinishedAt"` OnlineState string `json:"onlineState"` Firmware struct { Version string `json:"version"` UpdateEnabled bool `json:"updateEnabled"` UpdateRequired bool `json:"updateRequired"` } `json:"firmware"` Nomenclature string `json:"nomenclature"` Cag bool `json:"cag"` CountryCode string `json:"countryCode"` ProductInformation string `json:"productInformation"` FirmwareVersion string `json:"firmwareVersion"` }
type Identity ¶
type Identity struct {
// contains filtered or unexported fields
}
func NewIdentity ¶
func NewIdentity(client *Helper, credentials *CredentialsStruct) (*Identity, error)
func (*Identity) RefreshToken ¶
func (*Identity) TokenSource ¶
type PropertiesCircuit ¶
type PropertiesDhw ¶
type PropertiesZone ¶
type StateCircuit ¶
type StateCircuit struct { Index int `json:"index"` CircuitState string `json:"circuitState"` CurrentCircuitFlowTemperature float64 `json:"currentCircuitFlowTemperature,omitempty"` HeatingCircuitFlowSetpoint float64 `json:"heatingCircuitFlowSetpoint"` CalculatedEnergyManagerState string `json:"calculatedEnergyManagerState"` }
type StateDomesticHotWater ¶
type StateZone ¶
type StateZone struct { Index int `json:"index"` DesiredRoomTemperatureSetpointHeating float64 `json:"desiredRoomTemperatureSetpointHeating"` DesiredRoomTemperatureSetpoint float64 `json:"desiredRoomTemperatureSetpoint"` CurrentRoomTemperature float64 `json:"currentRoomTemperature,omitempty"` CurrentRoomHumidity float64 `json:"currentRoomHumidity,omitempty"` CurrentSpecialFunction string `json:"currentSpecialFunction"` HeatingState string `json:"heatingState"` }
type StatusError ¶
type StatusError struct {
// contains filtered or unexported fields
}
StatusError indicates unsuccessful http response
func (StatusError) Error ¶
func (e StatusError) Error() string
func (StatusError) Response ¶
func (e StatusError) Response() *http.Response
Response returns the response with the unexpected error
func (StatusError) StatusCode ¶
func (e StatusError) StatusCode() int
StatusCode returns the response's status code
type SystemStatus ¶
type SystemStatus struct { State struct { System struct { OutdoorTemperature float64 `json:"outdoorTemperature"` OutdoorTemperatureAverage24H float64 `json:"outdoorTemperatureAverage24h"` SystemFlowTemperature float64 `json:"systemFlowTemperature"` SystemWaterPressure float64 `json:"systemWaterPressure"` EnergyManagerState string `json:"energyManagerState"` SystemOff bool `json:"systemOff"` } `json:"system"` Zones []StateZone `json:"zones"` Circuits []StateCircuit `json:"circuits"` Dhw []StateDhw `json:"dhw"` DomesticHotWater []StateDomesticHotWater `json:"domesticHotWater"` } `json:"state"` Properties struct { System struct { ControllerType string `json:"controllerType"` SystemScheme int `json:"systemScheme"` BackupHeaterType string `json:"backupHeaterType"` BackupHeaterAllowedFor string `json:"backupHeaterAllowedFor"` ModuleConfigurationVR71 int `json:"moduleConfigurationVR71"` EnergyProvidePowerCutBehavior string `json:"energyProvidePowerCutBehavior"` SmartPhotovoltaicBufferOffset float64 `json:"smartPhotovoltaicBufferOffset"` ExternalEnergyManagementActivation bool `json:"externalEnergyManagementActivation"` } `json:"system"` Zones []PropertiesZone `json:"zones"` Circuits []PropertiesCircuit `json:"circuits"` Dhw []PropertiesDhw `json:"dhw"` DomesticHotWater []PropertiesDomesticHotWater `json:"domesticHotWater"` } `json:"properties"` Configuration struct { System struct { ContinuousHeatingStartSetpoint float64 `json:"continuousHeatingStartSetpoint"` AlternativePoint float64 `json:"alternativePoint"` HeatingCircuitBivalencePoint float64 `json:"heatingCircuitBivalencePoint"` DhwBivalencePoint float64 `json:"dhwBivalencePoint"` AdaptiveHeatingCurve bool `json:"adaptiveHeatingCurve"` DhwMaximumLoadingTime int `json:"dhwMaximumLoadingTime"` DhwHysteresis float64 `json:"dhwHysteresis"` DhwFlowSetpointOffset float64 `json:"dhwFlowSetpointOffset"` ContinuousHeatingRoomSetpoint float64 `json:"continuousHeatingRoomSetpoint"` HybridControlStrategy string `json:"hybridControlStrategy"` MaxFlowSetpointHpError float64 `json:"maxFlowSetpointHpError"` DhwMaximumTemperature float64 `json:"dhwMaximumTemperature"` MaximumPreheatingTime int `json:"maximumPreheatingTime"` ParalellTankLoadingAllowed bool `json:"paralellTankLoadingAllowed"` } `json:"system"` Zones []ConfigurationZone `json:"zones"` Circuits []ConfigurationCircuit `json:"circuits"` Dhw []ConfigurationDhw `json:"dhw"` DomesticHotWater []ConfigurationDomesticHotWater `json:"domesticHotWater"` } `json:"configuration"` }
type TimeProgram ¶
type TimeProgram struct { MetaInfo MetaInfo `json:"metaInfo"` Monday []Setpoint `json:"monday"` Tuesday []Setpoint `json:"tuesday"` Wednesday []Setpoint `json:"wednesday"` Thursday []Setpoint `json:"thursday"` Friday []Setpoint `json:"friday"` Saturday []Setpoint `json:"saturday"` Sunday []Setpoint `json:"sunday"` }
type TokenRefresher ¶
type TokenRequestStruct ¶
type TokenSource ¶
type TokenSource struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.