import "code.pfad.fr/fritzgox/aha"
package aha allows to interact with the AVM Home Automation HTTP Interface (AHA), to control the connected smart devices.
const ThermostatTempOff = ThermostatTemp(0)
const ThermostatTempOn = ThermostatTemp(37)
const ThermostatTempUndefined = ThermostatTemp(-1)
LoginV2 asks the fritzbox for the PBKDF2 challenge on login.
TrustOnFirstUse retrieves the certificate and marks it as trusted for subsequent calls.
type Client struct { URL url.URL Transport *http.Transport // if Username is empty, it will be auto-discovered Username string LoginV2 bool // contains filtered or unexported fields }
NewClient creates a new client to interact with the AHA interface.
func (c *Client) GetDeviceListInfos() (info *DeviceListInfos, err error)
GetDeviceListInfos returns the connected smart devices.
SetThermostatBoost
func (c *Client) SetThermostatTargetTemp(identifier string, t ThermostatTemp) error
SetThermostatTargetTemp
type Device struct { Identifier string ID string Function DeviceFunction FirmwareVersion string Manufacturer string Productname string Present bool Txbusy bool Name string BatteryLow bool BatteryLevel int TemperatureSensor *TemperatureSensor Thermostat *Thermostat }
const ( DeviceHANFUN DeviceFunction = 1 << iota DeviceLight DeviceAlarm DeviceButton DeviceThermostat DeviceEnergieSensor DeviceTemperatureSensor DeviceSwitch )
type DeviceListInfos struct { XMLName xml.Name Version string FirmwareVersion string Devices []Device }
func (f Float32Tenth) String() string
func (f *Float32Tenth) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
TrustCertificate adds a PEM certificate to be trusted. Be aware that self-signed certificates may be re-created on reboot. You might prefer to use TrustOnFirstUse.
WithUsername disables the auto-discovery of the username.
type TemperatureSensor struct { Celsius Float32Tenth // adjusted temperature Offset Float32Tenth // operated adjustment }
type Thermostat struct { // you should use the TemperatureSensor instead of ActualTemp ActualTemp ThermostatTemp TargetTemp ThermostatTemp LowTemp ThermostatTemp ComfortTemp ThermostatTemp APILocked bool DeviceLocked bool ErrorCode int WindowOpened bool WindowOpenedUntil UnixSecond BoostActive bool BoostActiveUntil UnixSecond BatteryLow bool BatteryLevel int NextChange struct { At UnixSecond WishTemp ThermostatTemp } SummerActive bool HolidayActive bool }
func (t ThermostatTemp) String() string
func (t *ThermostatTemp) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
func (u *UnixSecond) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error