go-vitotrol: github.com/maxatome/go-vitotrol Index | Files

package vitotrol

import "github.com/maxatome/go-vitotrol"

Index

Package Files

attributes.go device.go result.go time.go timesheets.go timeslot.go types.go vitotrol.go

Variables

var (
    // WriteDataWaitDuration defines the duration to wait in
    // WriteDataWait after the WriteData call before calling
    // RequestWriteStatus for the first time. After that first call, the
    // next pause duration will be divided by 4 and so on.
    WriteDataWaitDuration = 4 * time.Second
    // WriteDataWaitMinDuration defines the minimal duration of pauses
    // between RequestWriteStatus calls.
    WriteDataWaitMinDuration = 1 * time.Second
    // WriteDataWaitTimeout is the max amount of time to wait during
    // WriteDataWait method call before returning a ErrTimeout error.
    WriteDataWaitTimeout = 60 * time.Second
)
var (
    // RefreshDataWaitDuration defines the duration to wait in
    // RefreshDataWait after the RefreshData call before calling
    // RequestRefreshStatus for the first time. After that first call, the
    // next pause duration will be divided by 4 and so on.
    RefreshDataWaitDuration = 8 * time.Second
    // RefreshDataWaitMinDuration defines the minimal duration of pauses
    // between RequestRefreshStatus calls.
    RefreshDataWaitMinDuration = 1 * time.Second
    // RefreshDataWaitTimeout is the max amount of time to wait during
    // RefreshDataWait method call before returning a ErrTimeout error.
    RefreshDataWaitTimeout = 60 * time.Second
)
var (
    // WriteTimesheetDataWaitDuration defines the duration to wait in
    // WriteTimesheetDataWait after the WriteTimesheetData call before
    // calling RequestWriteStatus for the first time. After that first
    // call, the next pause duration will be divided by 4 and so on.
    WriteTimesheetDataWaitDuration = 8 * time.Second
    // WriteTimesheetDataWaitMinDuration defines the minimal duration of pauses
    // between RequestWriteStatus calls.
    WriteTimesheetDataWaitMinDuration = 1 * time.Second
    // WriteTimesheetDataWaitTimeout is the max amount of time to wait
    // during WriteTimesheetDataWait method call before returning a
    // ErrTimeout error.
    WriteTimesheetDataWaitTimeout = 60 * time.Second
)
var (
    TypeDouble    = (*VitodataDouble)(nil)
    TypeInteger   = (*VitodataInteger)(nil)
    TypeDate      = (*VitodataDate)(nil)
    TypeString    = (*VitodataString)(nil)
    TypeOnOffEnum = NewEnum([]string{
        "off",
        "on",
    })
    TypeEnabledEnum = NewEnum([]string{
        "disabled",
        "enabled",
    })

    TypeNames = map[string]VitodataType{
        TypeDouble.Type():  TypeDouble,
        TypeInteger.Type(): TypeInteger,
        TypeDate.Type():    TypeDate,
        TypeString.Type():  TypeString,
    }
)

Singletons matching Vitodata™ types.

var AccessToStr = map[AttrAccess]string{
    ReadOnly:  "read-only",
    WriteOnly: "write-only",
    ReadWrite: "read/write",
}

AccessToStr map allows to translate AttrAccess values to strings.

var Attributes = computeAttributes()

Attributes lists the AttrIDs for all available attributes.

var AttributesNames2IDs = computeNames2IDs()

AttributesNames2IDs maps the attributes names to their AttrID counterpart.

var AttributesRef = map[AttrID]*AttrRef{
    IndoorTemp: {
        Type:   TypeDouble,
        Access: ReadOnly,
        Doc:    "Indoor temperature",
        Name:   "IndoorTemp",
    },
    OutdoorTemp: {
        Type:   TypeDouble,
        Access: ReadOnly,
        Doc:    "Outdoor temperature",
        Name:   "OutdoorTemp",
    },
    SmokeTemp: {
        Type:   TypeDouble,
        Access: ReadOnly,
        Doc:    "Smoke temperature",
        Name:   "SmokeTemp",
    },
    BoilerTemp: {
        Type:   TypeDouble,
        Access: ReadOnly,
        Doc:    "Boiler temperature",
        Name:   "BoilerTemp",
    },
    HotWaterTemp: {
        Type:   TypeDouble,
        Access: ReadOnly,
        Doc:    "Hot water temperature",
        Name:   "HotWaterTemp",
    },
    HotWaterOutTemp: {
        Type:   TypeDouble,
        Access: ReadOnly,
        Doc:    "Hot water outlet temperature",
        Name:   "HotWaterOutTemp",
    },
    HeatWaterOutTemp: {
        Type:   TypeDouble,
        Access: ReadOnly,
        Doc:    "Heating water outlet temperature",
        Name:   "HeatWaterOutTemp",
    },
    HeatNormalTemp: {
        Type:   TypeDouble,
        Access: ReadWrite,
        Doc:    "Setpoint of the normal room temperature",
        Name:   "HeatNormalTemp",
    },
    PartyModeTemp: {
        Type:   TypeDouble,
        Access: ReadWrite,
        Doc:    "Party mode temperature",
        Name:   "PartyModeTemp",
    },
    HeatReducedTemp: {
        Type:   TypeDouble,
        Access: ReadWrite,
        Doc:    "Setpoint of the reduced room temperature",
        Name:   "HeatReducedTemp",
    },
    HotWaterSetpointTemp: {
        Type:   TypeDouble,
        Access: ReadWrite,
        Doc:    "Setpoint of the domestic hot water temperature",
        Name:   "HotWaterSetpointTemp",
    },
    BurnerHoursRun: {
        Type:   TypeDouble,
        Access: ReadOnly,
        Doc:    "Burner hours run",
        Name:   "BurnerHoursRun",
    },
    BurnerHoursRunReset: {
        Type:   TypeDouble,
        Access: WriteOnly,
        Doc:    "Reset the burner hours run",
        Name:   "BurnerHoursRunReset",
    },
    BurnerState: {
        Type:   TypeOnOffEnum,
        Access: ReadOnly,
        Doc:    "Burner status",
        Name:   "BurnerState",
    },
    BurnerStarts: {
        Type:   TypeDouble,
        Access: ReadWrite,
        Doc:    "Burner starts",
        Name:   "BurnerStarts",
    },
    InternalPumpStatus: {
        Type: NewEnum([]string{
            "off",
            "on",
            "off2",
            "on2",
        }),
        Access: ReadOnly,
        Doc:    "Internal pump status",
        Name:   "InternalPumpStatus",
    },
    HeatingPumpStatus: {
        Type:   TypeOnOffEnum,
        Access: ReadOnly,
        Doc:    "Heating pump status",
        Name:   "HeatingPumpStatus",
    },
    CirculationPumpState: {
        Type:   TypeOnOffEnum,
        Access: ReadOnly,
        Doc:    "Statut pompe circulation",
        Name:   "CirculationPumpState",
    },
    PartyMode: {
        Type:   TypeEnabledEnum,
        Access: ReadWrite,
        Doc:    "Party mode status",
        Name:   "PartyMode",
    },
    EnergySavingMode: {
        Type:   TypeEnabledEnum,
        Access: ReadWrite,
        Doc:    "Energy saving mode status",
        Name:   "EnergySavingMode",
    },
    DateTime: {
        Type:   TypeDate,
        Access: ReadWrite,
        Doc:    "Current date and time",
        Name:   "DateTime",
    },
    CurrentError: {
        Type:   TypeString,
        Access: ReadOnly,
        Doc:    "Current error",
        Name:   "CurrentError",
    },
    HolidaysStart: {
        Type:   TypeDate,
        Access: ReadWrite,
        Doc:    "Holidays begin date",
        Name:   "HolidaysStart",
    },
    HolidaysEnd: {
        Type:   TypeDate,
        Access: ReadWrite,
        Doc:    "Holidays end date",
        Name:   "HolidaysEnd",
    },
    HolidaysStatus: {
        Type:   TypeEnabledEnum,
        Access: ReadOnly,
        Doc:    "Holidays program status",
        Name:   "HolidaysStatus",
    },
    Way3ValveStatus: {
        Type: NewEnum([]string{
            "undefined",
            "heating",
            "middle position",
            "hot water",
        }),
        Access: ReadOnly,
        Doc:    "3-way valve status",
        Name:   "3WayValveStatus",
    },
    OperatingModeRequested: {
        Type: NewEnum([]string{
            "off",
            "DHW only",
            "heating+DHW",
            "continuous reduced",
            "continuous normal",
        }),
        Access: ReadWrite,
        Doc:    "Operating mode requested",
        Name:   "OperatingModeRequested",
    },
    OperatingModeCurrent: {
        Type: NewEnum([]string{
            "stand-by",
            "reduced",
            "normal",
            "continuous normal",
        }),
        Access: ReadOnly,
        Doc:    "Operating mode",
        Name:   "OperatingModeCurrent",
    },
    FrostProtectionStatus: {
        Type:   TypeEnabledEnum,
        Access: ReadOnly,
        Doc:    "Frost protection status",
        Name:   "FrostProtectionStatus",
    },
}

AttributesRef lists the reference for each attribute ID.

var ErrEnumInvalidValue = errors.New("Invalid Enum value")

ErrEnumInvalidValue is returned when trying to convert to an enum a value that cannot match any value of this enum.

var (
    // ErrTimeout is the error returned by WriteDataWait,
    // RefreshDataWait and WriteTimesheetDataWait methods when the
    // response wait times out.
    ErrTimeout = errors.New("Timeout")
)
var MainURL = `http://www.viessmann.com/app_vitodata/VIIWebService-1.16.0.0/iPhoneWebService.asmx`

MainURL is the Viessmann Vitodata API URL.

var TimesheetsNames2IDs = func() map[string]TimesheetID {
    ret := make(map[string]TimesheetID, len(TimesheetsRef))
    for timesheetID, pTimesheetRef := range TimesheetsRef {
        ret[pTimesheetRef.Name] = timesheetID
    }
    return ret
}()

TimesheetsNames2IDs maps the timesheet names to their TimesheetID counterpart.

var TimesheetsRef = map[TimesheetID]*TimesheetRef{
    HotWaterLoopTimesheet: {
        Name: "HotWaterLoopTimesheet",
        Doc:  "Time program for domestic hot water recirculation pump",
    },
    HotWaterTimesheet: {
        Name: "HotWaterTimesheet",
        Doc:  "Time program for domestic hot water heating",
    },
    HeatingTimesheet: {
        Name: "HeatingTimesheet",
        Doc:  "Time program for central heating",
    },
}

TimesheetsRef lists the reference for each timesheet ID.

func AddAttributeRef Uses

func AddAttributeRef(attrID AttrID, ref AttrRef)

AddAttributeRef adds a new attribute to the "official" list. This new attribute will only differ from others by its Custom field set to true.

No check is done to avoid overriding existing attributes.

type AttrAccess Uses

type AttrAccess uint8

An AttrAccess defines attributes access rights.

const (
    ReadOnly AttrAccess = 1 << iota
    WriteOnly
    ReadWrite AttrAccess = ReadOnly | WriteOnly
)

Availables access rights.

type AttrID Uses

type AttrID uint16

An AttrID defines an attribute ID

const (
    IndoorTemp             AttrID = 5367   // temp_rts_r
    OutdoorTemp            AttrID = 5373   // temp_ats_r
    SmokeTemp              AttrID = 5372   // temp_agt_r
    BoilerTemp             AttrID = 5374   // temp_kts_r
    HotWaterTemp           AttrID = 5381   // temp_ww_r
    HotWaterOutTemp        AttrID = 5382   // temp_auslauf_r
    HeatWaterOutTemp       AttrID = 6052   // temp_vts_r
    HeatNormalTemp         AttrID = 82     // konf_raumsolltemp_rw
    PartyModeTemp          AttrID = 79     // konf_partysolltemp_rw
    HeatReducedTemp        AttrID = 85     // konf_raumsolltemp_reduziert_rw
    HotWaterSetpointTemp   AttrID = 51     // konf_ww_solltemp_rw
    BurnerHoursRun         AttrID = 104    // anzahl_brennerstunden_r
    BurnerHoursRunReset    AttrID = 106    // anzahl_brennerstunden_w
    BurnerState            AttrID = 600    // zustand_brenner_r
    BurnerStarts           AttrID = 111    // anzahl_brennerstart_r
    InternalPumpStatus     AttrID = 245    // zustand_interne_pumpe_r
    HeatingPumpStatus      AttrID = 729    // zustand_heizkreispumpe_r
    CirculationPumpState   AttrID = 7181   // zustand_zirkulationspumpe_r
    PartyMode              AttrID = 7855   // konf_partybetrieb_rw
    EnergySavingMode       AttrID = 7852   // konf_sparbetrieb_rw
    DateTime               AttrID = 5385   // konf_uhrzeit_rw
    CurrentError           AttrID = 7184   // aktuelle_fehler_r
    HolidaysStart          AttrID = 306    // konf_ferien_start_rw
    HolidaysEnd            AttrID = 309    // konf_ferien_ende_rw
    HolidaysStatus         AttrID = 714    // zustand_ferienprogramm_r
    Way3ValveStatus        AttrID = 5389   // info_status_umschaltventil_r
    OperatingModeRequested AttrID = 92     // konf_betriebsart_rw
    OperatingModeCurrent   AttrID = 708    // aktuelle_betriebsart_r
    FrostProtectionStatus  AttrID = 717    // zustand_frostgefahr_r
    NoAttr                 AttrID = 0xffff // Used in error cases
)

Attribute IDs currently supported by the library. For each, the Vitotrol™ name.

type AttrRef Uses

type AttrRef struct {
    Type   VitodataType
    Access AttrAccess
    Name   string
    Doc    string
    Custom bool
}

An AttrRef describes an attribute reference: its type, access and name.

func (*AttrRef) String Uses

func (r *AttrRef) String() string

String returns all information contained in this attribute reference.

type AttributeInfo Uses

type AttributeInfo struct {
    AttributeInfoBase
    AttributeID AttrID
    EnumValues  map[uint32]string // only if AttributeType == "ENUM"
}

AttributeInfo defines an attribute.

type AttributeInfoBase Uses

type AttributeInfoBase struct {
    AttributeName      string `xml:"DatenpunktName"` // German one, more funny :)
    AttributeType      string `xml:"DatenpunktTyp"`
    AttributeTypeValue uint32 `xml:"DatenpunktTypWert"` // ???
    MinValue           string `xml:"MinimalWert"`
    MaxValue           string `xml:"MaximalWert"`
    DataPointGroup     string `xml:"DatenpunktGruppe"`
    HeatingCircuitID   uint32 `xml:"HeizkreisId"`
    DefaultValue       string `xml:"Auslieferungswert"`
    Readable           bool   `xml:"IstLesbar"`
    Writable           bool   `xml:"IstSchreibbar"`
}

AttributeInfoBase defines the base information the GetTypeInfo request returns.

type Device Uses

type Device struct {
    LocationID   uint32 // Vitotrol™ ID of location (AnlageId field)
    LocationName string // location name (AnlageName field)
    DeviceID     uint32 // Vitotrol™ ID of device (GeraetId field)
    DeviceName   string // device name (GeraetName field)
    HasError     bool   // ORed HatFehler field of Device & Location
    IsConnected  bool   // IstVerbunden field of Device

    // cache of last read attributes values (filled by GetData)
    Attributes map[AttrID]*Value
    // cache of last read timesheets data (filled by GetTimesheetData)
    Timesheets map[TimesheetID]map[string]TimeslotSlice
    // cache of last read errors (filled by GetErrorHistory)
    Errors []ErrorHistoryEvent
}

Device represents one Vitotrol™ device (a priori a boiler)

func (*Device) FormatAttributes Uses

func (d *Device) FormatAttributes(attrs []AttrID) string

FormatAttributes displays informations about selected attributes. Displays information about all known attributes when a nil slice is passed.

func (*Device) GetData Uses

func (d *Device) GetData(v *Session, attrIDs []AttrID) error

GetData launches the Vitotrol™ GetData request. Populates the internal cache before returning (see Attributes field).

func (*Device) GetErrorHistory Uses

func (d *Device) GetErrorHistory(v *Session) error

GetErrorHistory launches the Vitotrol™ GetErrorHistory request. Populates the internal cache before returning (see Errors field).

func (*Device) GetTimesheetData Uses

func (d *Device) GetTimesheetData(v *Session, id TimesheetID) error

GetTimesheetData launches the Vitotrol™ GetTimesheetData request. Populates the internal cache before returning (see Timesheets field).

func (*Device) GetTypeInfo Uses

func (d *Device) GetTypeInfo(v *Session) ([]*AttributeInfo, error)

GetTypeInfo launches the Vitotrol™ GetTypeInfo request.

func (*Device) RefreshData Uses

func (d *Device) RefreshData(v *Session, attrIDs []AttrID) (string, error)

RefreshData launches the Vitotrol™ RefreshData request and returns the "refresh ID" sent back by the server. Use RefreshDataWait instead.

func (*Device) RefreshDataWait Uses

func (d *Device) RefreshDataWait(v *Session, attrIDs []AttrID) (<-chan error, error)

RefreshDataWait launches the Vitotrol™ RefreshData request and returns a channel on which the final error (asynchronous one) will be received (nil if the data has been correctly written).

If an error occurs during the RefreshData call (synchronous one), a nil channel is returned with an error.

func (*Device) WriteData Uses

func (d *Device) WriteData(v *Session, attrID AttrID, value string) (string, error)

WriteData launches the Vitotrol™ WriteData request and returns the "refresh ID" sent back by the server. Use WriteDataWait instead.

func (*Device) WriteDataWait Uses

func (d *Device) WriteDataWait(v *Session, attrID AttrID, value string) (<-chan error, error)

WriteDataWait launches the Vitotrol™ WriteData request and returns a channel on which the final error (asynchronous one) will be received (nil if the data has been correctly written).

If an error occurs during the WriteData call (synchronous one), a nil channel is returned with an error.

func (*Device) WriteTimesheetData Uses

func (d *Device) WriteTimesheetData(v *Session, id TimesheetID, data map[string]TimeslotSlice) (string, error)

WriteTimesheetData launches the Vitotrol™ WriteTimesheetData request and returns the "refresh ID" sent back by the server. Does not populate the internal cache before returning (Timesheets field), use WriteTimesheetDataWait instead.

func (*Device) WriteTimesheetDataWait Uses

func (d *Device) WriteTimesheetDataWait(v *Session, id TimesheetID, data map[string]TimeslotSlice) (<-chan error, error)

WriteTimesheetDataWait launches the Vitotrol™ WriteTimesheetData request and returns a channel on which the final error (asynchronous one) will be received (nil if the data has been correctly written).

If an error occurs during the WriteTimesheetData call (synchronous one), a nil channel is returned with an error.

type ErrorHistoryEvent Uses

type ErrorHistoryEvent struct {
    Error    string `xml:"FehlerCode"`
    Message  string `xml:"FehlerMeldung"`
    Time     Time   `xml:"Zeitstempel"`
    IsActive bool   `xml:"FehlerIstAktiv"`
}

ErrorHistoryEvent represents a timestamped history event generally found in a GetErrorHistoryResponse.

func (*ErrorHistoryEvent) String Uses

func (e *ErrorHistoryEvent) String() string

type GetDataResponse Uses

type GetDataResponse struct {
    GetDataResult struct {
        ResultHeader
        Values []getDataValue `xml:"DatenwerteListe>WerteListe"`
    } `xml:"Body>GetDataResponse>GetDataResult"`
}

GetDataResponse is a response to a GetData request.

func (*GetDataResponse) ResultHeader Uses

func (r *GetDataResponse) ResultHeader() *ResultHeader

ResultHeader returns the ResultHeader address in the response.

type GetDevicesResponse Uses

type GetDevicesResponse struct {
    GetDevicesResult struct {
        ResultHeader
        Locations []getDevicesLocation `xml:"AnlageListe>AnlageV2"`
    } `xml:"Body>GetDevicesResponse>GetDevicesResult"`
}

GetDevicesResponse is a response to a GetDevices request.

func (*GetDevicesResponse) ResultHeader Uses

func (r *GetDevicesResponse) ResultHeader() *ResultHeader

ResultHeader returns the ResultHeader address in the response.

type GetErrorHistoryResponse Uses

type GetErrorHistoryResponse struct {
    GetErrorHistoryResult struct {
        ResultHeader
        Events []ErrorHistoryEvent `xml:"FehlerListe>FehlerHistorie"`
    } `xml:"Body>GetErrorHistoryResponse>GetErrorHistoryResult"`
}

GetErrorHistoryResponse is a response to a GetErrorHistory request.

func (*GetErrorHistoryResponse) ResultHeader Uses

func (r *GetErrorHistoryResponse) ResultHeader() *ResultHeader

ResultHeader returns the ResultHeader address in the response.

type GetTimesheetDataResponse Uses

type GetTimesheetDataResponse struct {
    GetTimesheetDataResult struct {
        ResultHeader
        ID       uint16    `xml:"SchaltsatzDaten>DatenpunktID"`
        DaySlots []daySlot `xml:"SchaltsatzDaten>Schaltzeiten>Schaltzeit"`
    } `xml:"Body>GetTimesheetDataResponse>GetTimesheetDataResult"`
}

GetTimesheetDataResponse is a response to a GetTimesheetData request.

func (*GetTimesheetDataResponse) ResultHeader Uses

func (r *GetTimesheetDataResponse) ResultHeader() *ResultHeader

ResultHeader returns the ResultHeader address in the response.

type GetTypeInfoResponse Uses

type GetTypeInfoResponse struct {
    GetTypeInfoResult struct {
        ResultHeader
        Attributes []*attributeInfo `xml:"TypeInfoListe>DatenpunktTypInfo"`
    } `xml:"Body>GetTypeInfoResponse>GetTypeInfoResult"`
}

GetTypeInfoResponse is a response to a GetTypeInfo request.

func (*GetTypeInfoResponse) ResultHeader Uses

func (r *GetTypeInfoResponse) ResultHeader() *ResultHeader

ResultHeader returns the ResultHeader address in the response.

type HasResultHeader Uses

type HasResultHeader interface {
    ResultHeader() *ResultHeader
}

HasResultHeader is the interface for abstrating Result part of each Vitotrol™ Response message.

type LoginResponse Uses

type LoginResponse struct {
    LoginResult struct {
        ResultHeader
        Version   string `xml:"TechVersion"`
        Firstname string `xml:"Vorname"`
        Lastname  string `xml:"Nachname"`
    } `xml:"Body>LoginResponse>LoginResult"`
}

LoginResponse is a response to a Login request.

func (*LoginResponse) ResultHeader Uses

func (r *LoginResponse) ResultHeader() *ResultHeader

ResultHeader returns the ResultHeader address in the response.

type RefreshDataResponse Uses

type RefreshDataResponse struct {
    RefreshDataResult struct {
        ResultHeader
        RefreshID string `xml:"AktualisierungsId"`
    } `xml:"Body>RefreshDataResponse>RefreshDataResult"`
}

RefreshDataResponse is a response to a RefreshData request.

func (*RefreshDataResponse) ResultHeader Uses

func (r *RefreshDataResponse) ResultHeader() *ResultHeader

ResultHeader returns the ResultHeader address in the response.

type RequestRefreshStatusResponse Uses

type RequestRefreshStatusResponse struct {
    RequestRefreshStatusResult struct {
        ResultHeader
        Status int `xml:"Status"`
    } `xml:"Body>RequestRefreshStatusResponse>RequestRefreshStatusResult"`
}

RequestRefreshStatusResponse is a response to a RequestRefreshStatus request.

func (*RequestRefreshStatusResponse) ResultHeader Uses

func (r *RequestRefreshStatusResponse) ResultHeader() *ResultHeader

ResultHeader returns the ResultHeader address in the response.

type RequestWriteStatusResponse Uses

type RequestWriteStatusResponse struct {
    RequestWriteStatusResult struct {
        ResultHeader
        Status int `xml:"Status"`
    } `xml:"Body>RequestWriteStatusResponse>RequestWriteStatusResult"`
}

RequestWriteStatusResponse is a response to a RequestWriteStatus request.

func (*RequestWriteStatusResponse) ResultHeader Uses

func (r *RequestWriteStatusResponse) ResultHeader() *ResultHeader

ResultHeader returns the ResultHeader address in the response.

type ResultHeader Uses

type ResultHeader struct {
    ErrorNum int    `xml:"Ergebnis"`
    ErrorStr string `xml:"ErgebnisText"`
}

ResultHeader included in each Result part of each Vitotrol™ Response message.

func (*ResultHeader) Error Uses

func (e *ResultHeader) Error() string

Error returns the result as a string.

func (*ResultHeader) IsError Uses

func (e *ResultHeader) IsError() bool

IsError allows to know if this result is an error or not from the Vitotrol™ point of view.

type Session Uses

type Session struct {
    Cookies []string

    Devices []Device

    Debug bool
}

Session keep a cache of all informations downloaded from the Vitotrol™ server. See Login method as entry point.

func (*Session) GetDevices Uses

func (v *Session) GetDevices() error

GetDevices launches the Vitotrol™ GetDevices request. Populates the internal cache before returning (see Devices field).

func (*Session) Login Uses

func (v *Session) Login(login, password string) error

Login authenticates the session on the Vitotrol™ server using the Login request.

func (*Session) RequestRefreshStatus Uses

func (v *Session) RequestRefreshStatus(refreshID string) (int, error)

RequestRefreshStatus launches the Vitotrol™ RequestRefreshStatus request to follow the status of the RefreshData request matching the passed refresh ID. Use RefreshDataWait instead.

func (*Session) RequestWriteStatus Uses

func (v *Session) RequestWriteStatus(refreshID string) (int, error)

RequestWriteStatus launches the Vitotrol™ RequestWriteStatus request to follow the status of the WriteData request matching the passed refresh ID. Use WriteDataWait instead.

type Time Uses

type Time time.Time

Time handle the Vitotrol™ time format.

func ParseVitotrolTime Uses

func ParseVitotrolTime(value string) (Time, error)

ParseVitotrolTime parses a Vitotrol™ time information. Without a time zone it is considered as a local time.

func (Time) String Uses

func (t Time) String() string

String returns the time formatted using the format string

2006-01-02 15:04:05

considered as being a localtime value.

func (*Time) UnmarshalXML Uses

func (t *Time) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML decodes a Vitotrol™ time embedded in XML.

type TimesheetID Uses

type TimesheetID uint16

A TimesheetID allows to reference a specific timesheet. See *Timesheet consts.

const (
    HotWaterLoopTimesheet TimesheetID = 7193 // Programmation bouclage ECS
    HotWaterTimesheet     TimesheetID = 7192 // Programmation ECS
    HeatingTimesheet      TimesheetID = 7191 // Programmation chauffage
)

All available/recognized TimesheetID values.

type TimesheetRef Uses

type TimesheetRef struct {
    Name string
    Doc  string
}

A TimesheetRef describe a time program reference.

func (*TimesheetRef) String Uses

func (t *TimesheetRef) String() string

String returns a string describing a time program reference.

type Timeslot Uses

type Timeslot struct {
    From uint16 `json:"from"`
    To   uint16 `json:"to"`
}

Timeslot represents a time slot. Hours and minutes are packed on 16 bits by multiplying hours by 100 before adding them to minutes.

func (*Timeslot) String Uses

func (t *Timeslot) String() string

String returns a string representing the time slot.

type TimeslotSlice Uses

type TimeslotSlice []Timeslot

TimeslotSlice allows to sort Timeslot slices.

func (TimeslotSlice) Len Uses

func (t TimeslotSlice) Len() int

func (TimeslotSlice) Less Uses

func (t TimeslotSlice) Less(i, j int) bool

func (TimeslotSlice) Swap Uses

func (t TimeslotSlice) Swap(i, j int)

type Value Uses

type Value struct {
    Value string
    Time  Time
}

Value is the timestamped value of an attribute.

func (*Value) Num Uses

func (v *Value) Num() (ret float64)

Num returns the numerical value of this value. If the value is not a numerical one, 0 is returned.

type VitodataDate Uses

type VitodataDate struct{}

A VitodataDate represent the Vitodata™ Date type.

func (*VitodataDate) Human2VitodataValue Uses

func (v *VitodataDate) Human2VitodataValue(value string) (string, error)

Human2VitodataValue checks that the value is Vitodata™ formatted date and returns it after reformatting.

func (*VitodataDate) Type Uses

func (v *VitodataDate) Type() string

Type returns the "human" name of the type.

func (*VitodataDate) Vitodata2HumanValue Uses

func (v *VitodataDate) Vitodata2HumanValue(value string) (string, error)

Vitodata2HumanValue checks that the value is Vitodata™ formatted date and returns it after reformatting.

func (*VitodataDate) Vitodata2NativeValue Uses

func (v *VitodataDate) Vitodata2NativeValue(value string) (interface{}, error)

Vitodata2NativeValue extract the Vitodata™ date from the passed string and returns it as a vitotrol.Time.

type VitodataDouble Uses

type VitodataDouble struct{}

A VitodataDouble represent the Vitodata™ Double type.

func (*VitodataDouble) Human2VitodataValue Uses

func (v *VitodataDouble) Human2VitodataValue(value string) (string, error)

Human2VitodataValue checks that the value is a float number and returns it after reformatting.

func (*VitodataDouble) Type Uses

func (v *VitodataDouble) Type() string

Type returns the "human" name of the type.

func (*VitodataDouble) Vitodata2HumanValue Uses

func (v *VitodataDouble) Vitodata2HumanValue(value string) (string, error)

Vitodata2HumanValue checks that the value is a float number and returns it after reformatting.

func (*VitodataDouble) Vitodata2NativeValue Uses

func (v *VitodataDouble) Vitodata2NativeValue(value string) (interface{}, error)

Vitodata2NativeValue extract the number from the passed string and returns it as a float64.

type VitodataEnum Uses

type VitodataEnum struct {
    // contains filtered or unexported fields
}

VitodataEnum represents any Vitodata™ Enum type. See NewEnum to specialize it.

func NewEnum Uses

func NewEnum(values []string) *VitodataEnum

NewEnum specializes an enum to a set of values and returns it.

func (*VitodataEnum) Human2VitodataValue Uses

func (v *VitodataEnum) Human2VitodataValue(value string) (string, error)

Human2VitodataValue checks that the value is a Vitodata™ enum value and returns its numeric counterpart.

func (*VitodataEnum) Type Uses

func (v *VitodataEnum) Type() string

Type returns the "human" name of the type.

func (*VitodataEnum) Vitodata2HumanValue Uses

func (v *VitodataEnum) Vitodata2HumanValue(value string) (string, error)

Vitodata2HumanValue check that the (numeric) value is a Vitodata™ enum value and returns its string counterpart.

func (*VitodataEnum) Vitodata2NativeValue Uses

func (v *VitodataEnum) Vitodata2NativeValue(value string) (interface{}, error)

Vitodata2NativeValue extract the numeric Vitodata™ enum value from the passed string and returns it as a uint64.

type VitodataInteger Uses

type VitodataInteger struct{}

A VitodataInteger represent the Vitodata™ Integer type.

func (*VitodataInteger) Human2VitodataValue Uses

func (v *VitodataInteger) Human2VitodataValue(value string) (string, error)

Human2VitodataValue checks that the value is an integer and returns it after reformatting.

func (*VitodataInteger) Type Uses

func (v *VitodataInteger) Type() string

Type returns the "human" name of the type.

func (*VitodataInteger) Vitodata2HumanValue Uses

func (v *VitodataInteger) Vitodata2HumanValue(value string) (string, error)

Vitodata2HumanValue checks that the value is an integer and returns it after reformatting.

func (*VitodataInteger) Vitodata2NativeValue Uses

func (v *VitodataInteger) Vitodata2NativeValue(value string) (interface{}, error)

Vitodata2NativeValue extract the number from the passed string and returns it as an int64.

type VitodataString Uses

type VitodataString struct{}

A VitodataString represent the Vitodata™ String type.

func (*VitodataString) Human2VitodataValue Uses

func (v *VitodataString) Human2VitodataValue(value string) (string, error)

Human2VitodataValue is a no-op here, returning its argument.

func (*VitodataString) Type Uses

func (v *VitodataString) Type() string

Type returns the "human" name of the type.

func (*VitodataString) Vitodata2HumanValue Uses

func (v *VitodataString) Vitodata2HumanValue(value string) (string, error)

Vitodata2HumanValue is a no-op here, returning its argument.

func (*VitodataString) Vitodata2NativeValue Uses

func (v *VitodataString) Vitodata2NativeValue(value string) (interface{}, error)

Vitodata2NativeValue is a no-op here, returning its argument.

type VitodataType Uses

type VitodataType interface {
    Type() string
    Human2VitodataValue(string) (string, error)
    Vitodata2HumanValue(string) (string, error)
    Vitodata2NativeValue(string) (interface{}, error)
}

VitodataType is the interface implemented by each Vitodata™ type.

type WriteDataResponse Uses

type WriteDataResponse struct {
    WriteDataResult struct {
        ResultHeader
        RefreshID string `xml:"AktualisierungsId"`
    } `xml:"Body>WriteDataResponse>WriteDataResult"`
}

WriteDataResponse is a response to a WriteData request.

func (*WriteDataResponse) ResultHeader Uses

func (r *WriteDataResponse) ResultHeader() *ResultHeader

ResultHeader returns the ResultHeader address in the response.

type WriteTimesheetDataResponse Uses

type WriteTimesheetDataResponse struct {
    WriteTimesheetDataResult struct {
        ResultHeader
        RefreshID string `xml:"AktualisierungsId"`
    } `xml:"Body>WriteTimesheetDataResponse>WriteTimesheetDataResult"`
}

WriteTimesheetDataResponse is a response to a WriteTimesheetData request.

func (*WriteTimesheetDataResponse) ResultHeader Uses

func (r *WriteTimesheetDataResponse) ResultHeader() *ResultHeader

ResultHeader returns the ResultHeader address in the response.

Package vitotrol imports 11 packages (graph). Updated 2019-05-17. Refresh now. Tools for package owners.