Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureApi(host string, username string, password string, ...)
- func GetDatapoint(sysap string, deviceId string, channelId string, datapointId string) (string, error)
- func GetFloorRoom(device *Device, channel *Channel) (string, string)
- func PrtAllUnits()
- func PutDatapoint(sysap string, deviceId string, channelId string, datapointId string, ...) (bool, error)
- func PutVirtualDevice(sysap, serial string, message *VirtualDevice) (virtualSerial string, err error)
- func ReadAndHydradteAllDevices()
- func StartWebSocketLoop(refreshTime int) error
- type ApiRestConfigurationGet200ApplicationJsonResponse
- type ApiRestDatapointSysapSerialGet200ApplicationJsonResponse
- type ApiRestDatapointSysapSerialPut200TextPlainResponse
- type ApiRestDeviceSysapDeviceGet200ApplicationJsonResponse
- type ByFloorAndRoom
- type Channel
- type Device
- type Devicelist
- type Devices
- type DimmingActuatorUnit
- type DimmingSensorUnit
- type Error
- type Floors
- type FunctionIdType
- type InOutPut
- type RoomTemperatureControllerUnit
- type Rooms
- type SwitchActuatorUnit
- type SwitchSensorUnit
- type SysAP
- type Unit
- type UnitData
- type UnitTypeConst
- type Users
- type VirtualDevice
- type VirtualDeviceProperties
- type VirtualDeviceType
- type VirtualDevicesSuccess
- type WeatherStationBrightnessUnit
- type WeatherStationRainUnit
- type WeatherStationTemperatureUnit
- type WeatherStationWindUnit
- type WebsocketMessage
- type WebsocketUpdateMessageCallbackFunc
- type WebsocketUpdateUnitCallbackFunc
- type WindowDoorSensorUnit
Constants ¶
View Source
const ApiPathPrefix string = "/fhapi/v1"
View Source
const WebSocketPath string = "/fhapi/v1/api/ws"
Variables ¶
View Source
var FreeDevices map[string]*Device
View Source
var UnitMap map[string]Unit
Functions ¶
func ConfigureApi ¶
func ConfigureApi( host string, username string, password string, callbackUnit WebsocketUpdateUnitCallbackFunc, callbackMessage WebsocketUpdateMessageCallbackFunc, loggerParam *log.Logger, logLevelParam int, )
func GetDatapoint ¶
func PrtAllUnits ¶
func PrtAllUnits()
func PutDatapoint ¶
func PutVirtualDevice ¶
func PutVirtualDevice(sysap, serial string, message *VirtualDevice) (virtualSerial string, err error)
func ReadAndHydradteAllDevices ¶
func ReadAndHydradteAllDevices()
func StartWebSocketLoop ¶
Types ¶
type ApiRestConfigurationGet200ApplicationJsonResponse ¶
type ApiRestConfigurationGet200ApplicationJsonResponse struct {
ZeroSysAp *SysAP `json:"00000000-0000-0000-0000-000000000000"`
}
type ApiRestDatapointSysapSerialGet200ApplicationJsonResponse ¶
type ApiRestDatapointSysapSerialGet200ApplicationJsonResponse struct { ZeroSysAp struct { Values []string `json:"values,omitempty"` } `json:"00000000-0000-0000-0000-000000000000"` }
type ApiRestDeviceSysapDeviceGet200ApplicationJsonResponse ¶
type ApiRestDeviceSysapDeviceGet200ApplicationJsonResponse struct {
ZeroSysAp *Devices `json:"00000000-0000-0000-0000-000000000000"`
}
type ByFloorAndRoom ¶
type ByFloorAndRoom []Unit
Sort
func (ByFloorAndRoom) Len ¶
func (u ByFloorAndRoom) Len() int
func (ByFloorAndRoom) Less ¶
func (u ByFloorAndRoom) Less(i, j int) bool
func (ByFloorAndRoom) Swap ¶
func (u ByFloorAndRoom) Swap(i, j int)
type Channel ¶
type Channel struct { DisplayName *string `json:"displayName,omitempty"` Type *string `json:"type,omitempty"` FunctionID *string `json:"functionID,omitempty"` // FunctionIdType Inputs map[string]*InOutPut `json:"inputs,omitempty"` Outputs map[string]*InOutPut `json:"outputs,omitempty"` Floor *string `json:"floor,omitempty"` Room *string `json:"room,omitempty"` }
Channel defines model for Channel.
type Device ¶
type Device struct { DisplayName *string `json:"displayName,omitempty"` Floor *string `json:"floor,omitempty"` Room *string `json:"room,omitempty"` Interface *string `json:"interface,omitempty"` NativeId *string `json:"nativeId,omitempty"` Unresponsive *bool `json:"unresponsive,omitempty"` Channels map[string]*Channel `json:"channels,omitempty"` }
type Devicelist ¶
type Devicelist struct {
AdditionalProperties []string `json:"00000000-0000-0000-0000-000000000000"`
}
func GetDeviceList ¶
func GetDeviceList() (*Devicelist, error)
type DimmingActuatorUnit ¶
type DimmingActuatorUnit struct { UnitData On bool OnSet bool DimmingValue int DimmingValueSet bool Force bool ForceSet bool }
func CastDAU ¶
func CastDAU(u Unit) *DimmingActuatorUnit
func (*DimmingActuatorUnit) String ¶
func (dau *DimmingActuatorUnit) String() string
type DimmingSensorUnit ¶
func CastDSU ¶
func CastDSU(u Unit) *DimmingSensorUnit
func (*DimmingSensorUnit) String ¶
func (dsu *DimmingSensorUnit) String() string
type Error ¶
type Error struct { Code *string `json:"code,omitempty"` Detail *string `json:"detail,omitempty"` Title *string `json:"title,omitempty"` }
Error defines model for Error.
type FunctionIdType ¶
type FunctionIdType string
see https://developer.eu.mybuildings.abb.com/fah_local/reference/functionids/
const ( FID_SWITCH_SENSOR FunctionIdType = "0" FID_DIMMING_SENSOR FunctionIdType = "1" FID_SWITCH_ACTUATOR FunctionIdType = "7" FID_DIMMING_ACTUATOR FunctionIdType = "12" FID_WINDOW_DOOR_SENSOR FunctionIdType = "f" FID_ROOM_TEMPERATURE_CONTROLLER_MASTER_WITHOUT_FAN FunctionIdType = "23" FID_BRIGHTNESS_SENSOR FunctionIdType = "41" FID_RAIN_SENSOR FunctionIdType = "42" FID_TEMPERATURE_SENSOR FunctionIdType = "43" FID_WIND_SENSOR FunctionIdType = "44" )
type InOutPut ¶
type InOutPut struct { PairingID *int `json:"pairingID,omitempty"` Value *string `json:"value,omitempty"` }
InOutPut defines model for InOutPut.
type RoomTemperatureControllerUnit ¶
type RoomTemperatureControllerUnit struct { UnitData ActualDegree float64 TargetDegree float64 Active int Capacity int ActualDegreeSet bool TargetDegreeSet bool ActiveSet bool CapacitySet bool }
func CastRTC ¶
func CastRTC(u Unit) *RoomTemperatureControllerUnit
func (*RoomTemperatureControllerUnit) String ¶
func (rtc *RoomTemperatureControllerUnit) String() string
type SwitchActuatorUnit ¶
func CastSAU ¶
func CastSAU(u Unit) *SwitchActuatorUnit
func (*SwitchActuatorUnit) String ¶
func (sau *SwitchActuatorUnit) String() string
type SwitchSensorUnit ¶
func CastSSU ¶
func CastSSU(u Unit) *SwitchSensorUnit
func (*SwitchSensorUnit) String ¶
func (ssu *SwitchSensorUnit) String() string
type SysAP ¶
type SysAP struct { Devices map[string]*Device `json:"devices,omitempty"` Error *Error `json:"error"` Floorplan struct { Floors map[string]*Floors `json:"floors,omitempty"` } `json:"floorplan,omitempty"` SysapName *string `json:"sysapName,omitempty"` Users *Users `json:"users,omitempty"` }
var SysAPConfiguration *SysAP
func GetConfiguration ¶
type UnitData ¶
type UnitData struct { SerialNumber string NativeId *string ChannelId string Type UnitTypeConst Device *Device Floor string Room string LastUpdate time.Time }
hydrated data structures
func (*UnitData) GetChannel ¶
func (*UnitData) GetUnitData ¶
type UnitTypeConst ¶
type UnitTypeConst string
const UntTypeDimmingActuator UnitTypeConst = "AcDimmin"
const UntTypeDimmingSensor UnitTypeConst = "SeDimmin"
const UntTypeRoomTemperatureController UnitTypeConst = "CoRoTemp"
const UntTypeSwitchActuator UnitTypeConst = "AcSwitch"
const UntTypeSwitchSensor UnitTypeConst = "SeSwitch"
const UntTypeWeatherStationBrightness UnitTypeConst = "SeWBrig"
const UntTypeWeatherStationRain UnitTypeConst = "SeWRain"
const UntTypeWeatherStationTemperature UnitTypeConst = "SeWTemp"
const UntTypeWeatherStationWind UnitTypeConst = "SeWWind"
const UntTypeWindowDoorSensor UnitTypeConst = "SeWindow"
type Users ¶
type Users struct { AdditionalProperties map[string]struct { Enabled *bool `json:"enabled,omitempty"` Flags *[]string `json:"flags,omitempty"` GrantedPermissions *[]string `json:"grantedPermissions,omitempty"` Jid *string `json:"jid,omitempty"` Name *string `json:"name,omitempty"` RequestedPermissions *[]string `json:"requestedPermissions,omitempty"` Role *string `json:"role,omitempty"` } `json:"-"` }
Users defines model for Users.
type VirtualDevice ¶
type VirtualDevice struct { Properties VirtualDeviceProperties `json:"properties,omitempty"` Type VirtualDeviceType `json:"type,omitempty"` }
VirtualDevice defines model for VirtualDevice.
type VirtualDeviceProperties ¶
type VirtualDeviceType ¶
type VirtualDeviceType string
VirtualDeviceType defines model for VirtualDeviceType.
const ( VirtualDeviceType_BinarySensor VirtualDeviceType = "BinarySensor" VirtualDeviceType_CODetector VirtualDeviceType = "CODetector" VirtualDeviceType_CeilingFanActuator VirtualDeviceType = "CeilingFanActuator" VirtualDeviceType_DimActuator VirtualDeviceType = "DimActuator" VirtualDeviceType_FireDetector VirtualDeviceType = "FireDetector" VirtualDeviceType_RTC VirtualDeviceType = "RTC" VirtualDeviceType_ShutterActuator VirtualDeviceType = "ShutterActuator" VirtualDeviceType_SwitchingActuator VirtualDeviceType = "SwitchingActuator" VirtualDeviceType_WeatherStation VirtualDeviceType = "WeatherStation" VirtualDeviceType_Weather_BrightnessSensor VirtualDeviceType = "Weather-BrightnessSensor" VirtualDeviceType_Weather_RainSensor VirtualDeviceType = "Weather-RainSensor" VirtualDeviceType_Weather_TemperatureSensor VirtualDeviceType = "Weather-TemperatureSensor" VirtualDeviceType_Weather_WindSensor VirtualDeviceType = "Weather-WindSensor" VirtualDeviceType_WindowActuator VirtualDeviceType = "WindowActuator" VirtualDeviceType_WindowSensor VirtualDeviceType = "WindowSensor" )
List of VirtualDeviceType
type VirtualDevicesSuccess ¶
type VirtualDevicesSuccess struct { ZeroSysAp struct { Devices map[string]struct { Serial string `json:"serial,omitempty"` } `json:"devices,omitempty"` } `json:"00000000-0000-0000-0000-000000000000"` }
VirtualDevicesSuccess defines model for VirtualDevicesSuccess.
type VirtualDevicesSuccessXXX struct { AdditionalProperties map[string]struct { Devices *VirtualDevicesSuccess_Devices `json:"devices,omitempty"` } `json:"-"` }
type WeatherStationBrightnessUnit ¶
type WeatherStationBrightnessUnit struct { UnitData Luminance float64 LuminanceSet bool LuminanceAlarm bool LuminanceAlarmSet bool }
func CastWSB ¶
func CastWSB(u Unit) *WeatherStationBrightnessUnit
func (*WeatherStationBrightnessUnit) String ¶
func (ws *WeatherStationBrightnessUnit) String() string
type WeatherStationRainUnit ¶
type WeatherStationRainUnit struct { UnitData RainAlarm bool RainAlarmSet bool RainPercentage int RainPercentageSet bool }
func CastWSR ¶
func CastWSR(u Unit) *WeatherStationRainUnit
func (*WeatherStationRainUnit) String ¶
func (ws *WeatherStationRainUnit) String() string
type WeatherStationTemperatureUnit ¶
type WeatherStationTemperatureUnit struct { UnitData Temperature float64 TemperatureSet bool FreezeAlarm bool FreezeAlarmSet bool }
func CastWST ¶
func CastWST(u Unit) *WeatherStationTemperatureUnit
func (*WeatherStationTemperatureUnit) String ¶
func (ws *WeatherStationTemperatureUnit) String() string
type WeatherStationWindUnit ¶
type WeatherStationWindUnit struct { UnitData Wind float64 WindSet bool WindAlarm bool WindAlarmSet bool WindForce float64 WindForceSet bool }
func CastWSW ¶
func CastWSW(u Unit) *WeatherStationWindUnit
func (*WeatherStationWindUnit) String ¶
func (ws *WeatherStationWindUnit) String() string
type WebsocketMessage ¶
type WebsocketMessage struct { ZeroSysAp struct { Datapoints map[string]string `json:"datapoints"` Devices map[string]*Devices `json:"devices"` DevicesAdded []string `json:"devicesAdded"` DevicesRemoved []string `json:"devicesRemoved"` ScenesTriggered map[string]interface{} `json:"scenesTriggered"` } `json:"00000000-0000-0000-0000-000000000000"` }
type WebsocketUpdateMessageCallbackFunc ¶
type WebsocketUpdateMessageCallbackFunc func(message WebsocketMessage)
type WebsocketUpdateUnitCallbackFunc ¶
type WebsocketUpdateUnitCallbackFunc func(unitKeys []string)
type WindowDoorSensorUnit ¶
func CastWDS ¶
func CastWDS(u Unit) *WindowDoorSensorUnit
func (*WindowDoorSensorUnit) String ¶
func (wds *WindowDoorSensorUnit) String() string
Source Files ¶
- DimmingActuatorModel.go
- DimmingSensorModel.go
- RoomTemperatureControllerModel.go
- SwitchActuatorModel.go
- SwitchSensorModel.go
- UnitDataModel.go
- WeatherStationBrightnessModel.go
- WeatherStationRainModel.go
- WeatherStationTemperatureModel.go
- WeatherStationWindModel.go
- Websocket.go
- WindowDoorSensorModel.go
- fahapi.go
Click to show internal directories.
Click to hide internal directories.