Documentation ¶
Index ¶
- Constants
- type AdapterResty
- func (c AdapterResty) Delete(path string, data interface{}) (*resty.Response, error)
- func (c AdapterResty) Get(path string, container interface{}) (*resty.Response, error)
- func (c AdapterResty) HandleEtag(response *resty.Response, path string, container interface{}) bool
- func (c AdapterResty) Post(path string, data interface{}, container interface{}) (*resty.Response, error)
- func (c AdapterResty) Put(path string, data interface{}, container interface{}) (*resty.Response, error)
- type BaseConfig
- type CLIPConfigHumidity
- type CLIPConfigLightLevel
- type CLIPConfigTemperature
- type CLIPStateAlarm
- type CLIPStateBattery
- type CLIPStateCarbonMonoxide
- type CLIPStateConsumption
- type CLIPStateFire
- type CLIPStateGenericFlag
- type CLIPStateGenericStatus
- type CLIPStateHumidity
- type CLIPStateLightLevel
- type CLIPStateOpenClose
- type CLIPStatePower
- type CLIPStatePresence
- type CLIPStatePressure
- type CLIPStateSwitch
- type CLIPStateTemperature
- type CLIPStateVibration
- type CLIPStateWater
- type Client
- func (c *Client[R]) AcquireAPIKey(request ConfigRequestAcquireAPIKey) (R, error)
- func (c *Client[R]) ChangePassword(request ConfigRequestChangePassword) (R, error)
- func (c *Client[R]) ChangePasswordX(username string, oldPassword string, newPassword string) (R, error)
- func (c *Client[R]) ChangeSensorConfig(id string, config interface{}) (R, error)
- func (c *Client[R]) ChangeSensorState(id string, state interface{}) (R, error)
- func (c *Client[R]) CreateGroup(create GroupRequestCreate, createResponse *GroupResponseCreate) (R, error)
- func (c *Client[R]) CreateSensor(create SensorRequestCreate[any]) (R, error)
- func (c *Client[R]) Delete(path string, container interface{}, pathArguments ...any) (R, error)
- func (c *Client[R]) DeleteAPIKey(apiKeyToDelete string) (R, error)
- func (c *Client[R]) DeleteGroup(id string) (R, error)
- func (c *Client[R]) DeleteLight(id string, reset LightRequestDelete) (R, error)
- func (c *Client[R]) DeleteSensor(id string) (R, error)
- func (c *Client[R]) Get(path string, container interface{}, pathArguments ...any) (R, error)
- func (c *Client[R]) GetAllGroups(groups *map[string]GroupResponse) (R, error)
- func (c *Client[R]) GetAllLights(container *map[string]LightResponseState) (R, error)
- func (c *Client[R]) GetAllSensors(container *map[string]SensorResponse) (R, error)
- func (c *Client[R]) GetConfig(config *ConfigResponse) (R, error)
- func (c *Client[R]) GetFullState(fullState *ConfigResponseFullState) (R, error)
- func (c *Client[R]) GetGroupAttributes(id string, attribute *GroupResponseAttribute) (R, error)
- func (c *Client[R]) GetLightState(id string, container *LightResponseState) (R, error)
- func (c *Client[R]) GetSensor(id string, container *SensorResponse) (R, error)
- func (c *Client[R]) ModifyConfiguration(request ConfigRequest) (R, error)
- func (c *Client[R]) Post(path string, body interface{}, pathArguments ...any) (R, error)
- func (c *Client[R]) PostWithResult(path string, body interface{}, container interface{}, pathArguments ...any) (R, error)
- func (c *Client[R]) Put(path string, body interface{}, pathArguments ...any) (R, error)
- func (c *Client[R]) PutWithResult(path string, body interface{}, container interface{}, pathArguments ...any) (R, error)
- func (c *Client[R]) RemoveFromAllGroups(id string) (R, error)
- func (c *Client[R]) RemoveFromAllScenes(id string) (R, error)
- func (c *Client[R]) ResetGateway(request ConfigRequestReset) (R, error)
- func (c *Client[R]) ResetPassword() (R, error)
- func (c *Client[R]) SetGroupAttributes(id string, attribute GroupRequestAttribute) (R, error)
- func (c *Client[R]) SetGroupState(id string, state GroupRequestState) (R, error)
- func (c *Client[R]) SetLightAttributes(id string, attr LightRequestAttribute) (R, error)
- func (c *Client[R]) SetLightState(id string, state LightRequestState) (R, error)
- func (c *Client[R]) UpdateFirmware() (R, error)
- func (c *Client[R]) UpdateSensor(id string, data SensorRequestUpdate) (R, error)
- func (c *Client[R]) UpdateSoftware() (R, error)
- type ClientAdapter
- type ColorMode
- type ConfigDaylight
- type ConfigRequest
- type ConfigRequestAcquireAPIKey
- type ConfigRequestChangePassword
- type ConfigRequestReset
- type ConfigResponse
- type ConfigResponseFullState
- type ConfigTimeFormat
- type ConfigZHAHumidity
- type ConfigZHALightLevel
- type ConfigZHAOpenClose
- type ConfigZHAPresence
- type ConfigZHAPressure
- type ConfigZHASwitch
- type ConfigZHATemperature
- type ConfigZHAThermostat
- type EtagCacheEntry
- type GroupAlertMode
- type GroupEffectMode
- type GroupRequestAttribute
- type GroupRequestCreate
- type GroupRequestState
- type GroupResponse
- type GroupResponseAttribute
- type GroupResponseCreate
- type HAAirQualityValues
- type LightAlertMode
- type LightEffectMode
- type LightRequestAttribute
- type LightRequestDelete
- type LightRequestState
- type LightResponseState
- type LightResponseStateDetail
- type SensorMode
- type SensorRequestCreate
- type SensorRequestCreateConfig
- type SensorRequestUpdate
- type SensorResponse
- type StateDaylight
- type StateHAAirQuality
- type StateZHAAlarm
- type StateZHACarbonMonoxide
- type StateZHAConsumption
- type StateZHAFire
- type StateZHAHumidity
- type StateZHALightLevel
- type StateZHAOpenClose
- type StateZHAPower
- type StateZHAPresence
- type StateZHAPressure
- type StateZHASwitch
- type StateZHATemperature
- type StateZHAThermostat
- type StateZHATime
- type StateZHAVibration
- type StateZHAWater
- type UpdateChannel
- type WhitelistedAPIKey
- type ZHASwitchMode
- type ZHAThermostatFanMode
- type ZHAThermostatHostflags
- type ZHAThermostatMode
- type ZHAThermostatPreset
- type ZHAThermostatSwingmode
- type ZHAThermostatTemperatureMeasurement
- type ZigbeeChannel
Constants ¶
const HAAirQualityValuesExcellent = "excellent"
const HAAirQualityValuesGood = "good"
const HAAirQualityValuesModerate = "moderate"
const HAAirQualityValuesOutOfScale = "out of scale"
const HAAirQualityValuesPoor = "poor"
const HAAirQualityValuesUnhealthy = "unhealthy"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdapterResty ¶
type AdapterResty struct {
// contains filtered or unexported fields
}
func (AdapterResty) Delete ¶
func (c AdapterResty) Delete(path string, data interface{}) (*resty.Response, error)
func (AdapterResty) Get ¶
func (c AdapterResty) Get(path string, container interface{}) (*resty.Response, error)
func (AdapterResty) HandleEtag ¶
func (c AdapterResty) HandleEtag(response *resty.Response, path string, container interface{}) bool
func (AdapterResty) Post ¶
func (c AdapterResty) Post(path string, data interface{}, container interface{}) (*resty.Response, error)
func (AdapterResty) Put ¶
func (c AdapterResty) Put(path string, data interface{}, container interface{}) (*resty.Response, error)
type BaseConfig ¶ added in v0.0.8
type BaseConfig struct { // (default: true) On bool `json:"on"` // (default: true) Reachable *bool `json:"reachable,omitempty"` // (0–100) Battery *uint8 `json:"battery,omitempty"` }
func (BaseConfig) GetBattery ¶ added in v0.0.8
func (b BaseConfig) GetBattery() *uint8
func (BaseConfig) IsOn ¶ added in v0.0.8
func (b BaseConfig) IsOn() bool
func (BaseConfig) IsReachable ¶ added in v0.0.8
func (b BaseConfig) IsReachable() *bool
type CLIPConfigHumidity ¶ added in v0.0.7
type CLIPConfigHumidity struct {
Offset int16 `json:"offset"`
}
type CLIPConfigLightLevel ¶ added in v0.0.7
type CLIPConfigTemperature ¶ added in v0.0.7
type CLIPConfigTemperature struct {
Offset int16 `json:"offset"`
}
type CLIPStateAlarm ¶ added in v0.0.7
type CLIPStateAlarm struct {
Alarm bool `json:"alarm"`
}
type CLIPStateBattery ¶ added in v0.0.7
type CLIPStateBattery struct {
Battery uint8 `json:"battery"`
}
type CLIPStateCarbonMonoxide ¶ added in v0.0.7
type CLIPStateCarbonMonoxide struct {
Carbonmonoxide bool `json:"carbonmonoxide"`
}
type CLIPStateConsumption ¶ added in v0.0.7
type CLIPStateConsumption struct {
Consumption uint64 `json:"consumption"`
}
type CLIPStateFire ¶ added in v0.0.7
type CLIPStateFire struct {
Fire bool `json:"fire"`
}
type CLIPStateGenericFlag ¶ added in v0.0.7
type CLIPStateGenericFlag struct {
Flag bool `json:"flag"`
}
type CLIPStateGenericStatus ¶ added in v0.0.7
type CLIPStateGenericStatus struct {
Status int32 `json:"status"`
}
type CLIPStateHumidity ¶ added in v0.0.7
type CLIPStateHumidity struct {
Humidity uint16 `json:"humidity"`
}
type CLIPStateLightLevel ¶ added in v0.0.7
type CLIPStateOpenClose ¶ added in v0.0.7
type CLIPStateOpenClose struct {
Open bool `json:"open"`
}
type CLIPStatePower ¶ added in v0.0.7
type CLIPStatePresence ¶ added in v0.0.7
type CLIPStatePressure ¶ added in v0.0.7
type CLIPStatePressure struct {
Pressure int16 `json:"pressure"`
}
type CLIPStateSwitch ¶ added in v0.0.7
type CLIPStateSwitch struct {
Buttonevent uint32 `json:"buttonevent"`
}
type CLIPStateTemperature ¶ added in v0.0.7
type CLIPStateTemperature struct {
Temperature int16 `json:"temperature"`
}
type CLIPStateVibration ¶ added in v0.0.7
type CLIPStateVibration struct {
Vibration bool `json:"vibration"`
}
type CLIPStateWater ¶ added in v0.0.7
type CLIPStateWater struct {
Water bool `json:"water"`
}
type Client ¶
type Client[R any] struct { // contains filtered or unexported fields }
func CreateClient ¶
func CreateClient[R any](adapter ClientAdapter[R], settings godeconz.Settings) Client[R]
CreateClient that can access the Deconz API it uses [R] as response type from http requests.
func (*Client[R]) AcquireAPIKey ¶
func (c *Client[R]) AcquireAPIKey(request ConfigRequestAcquireAPIKey) (R, error)
AcquireAPIKey Creates a new API key which provides authorized access to the REST-API. The request will only succeed if the gateway is unlocked or valid HTTP basic authentication credentials are provided in the HTTP request header see authorization. (TODO support basic auth also)
func (*Client[R]) ChangePassword ¶
func (c *Client[R]) ChangePassword(request ConfigRequestChangePassword) (R, error)
ChangePassword Change the Password of the Gateway. The parameter must be a Base64 encoded string of <username>:<password>.
func (*Client[R]) ChangePasswordX ¶
func (c *Client[R]) ChangePasswordX(username string, oldPassword string, newPassword string) (R, error)
ChangePasswordX Change the Password of the Gateway.
func (*Client[R]) ChangeSensorConfig ¶
ChangeSensorConfig Update a sensor config with the specified parameters. Sensors expose certain configuration parameters depending on their defined or known capabilities. To get an overview on which parameters are available for a particular device, get the sensor state of either all (https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/sensors/#getall) or a single sensor https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/sensors/#getsensor.
func (*Client[R]) ChangeSensorState ¶
ChangeSensorState Update a sensor state with the specified parameters. Changing the sensor state is only allowed for CLIP sensors.
func (*Client[R]) CreateGroup ¶
func (c *Client[R]) CreateGroup(create GroupRequestCreate, createResponse *GroupResponseCreate) (R, error)
CreateGroup creates a new empty group. Creating a group with a name which already exists will not create a new group or fail. Such a call does only return the id of the existing group.
func (*Client[R]) CreateSensor ¶
func (c *Client[R]) CreateSensor(create SensorRequestCreate[any]) (R, error)
CreateSensor Creates a new CLIP sensor.
func (*Client[R]) DeleteAPIKey ¶
DeleteAPIKey Deletes an API key, so it can no longer be used.
func (*Client[R]) DeleteGroup ¶
DeleteGroup Deletes a group. In order to delete the group and therefore remove all lights from the group the lights must be powered on.
func (*Client[R]) DeleteLight ¶
func (c *Client[R]) DeleteLight(id string, reset LightRequestDelete) (R, error)
DeleteLight Removes the light from the gateway. It will not be shown in any REST-API call. Also deletes all groups and scenes on the light device.
func (*Client[R]) DeleteSensor ¶
DeleteSensor Delete a sensor.
func (*Client[R]) GetAllGroups ¶
func (c *Client[R]) GetAllGroups(groups *map[string]GroupResponse) (R, error)
GetAllGroups returns a list of all groups.
func (*Client[R]) GetAllLights ¶
func (c *Client[R]) GetAllLights(container *map[string]LightResponseState) (R, error)
GetAllLights Returns a list of all lights.
func (*Client[R]) GetAllSensors ¶
func (c *Client[R]) GetAllSensors(container *map[string]SensorResponse) (R, error)
GetAllSensors Returns a list of all sensors. If there are no sensors in the system an empty object {} is returned.
func (*Client[R]) GetConfig ¶
func (c *Client[R]) GetConfig(config *ConfigResponse) (R, error)
GetConfig Returns the current gateway configuration.
func (*Client[R]) GetFullState ¶
func (c *Client[R]) GetFullState(fullState *ConfigResponseFullState) (R, error)
GetFullState Returns the full state of the gateway including all its lights, groups, scenes and schedules.
func (*Client[R]) GetGroupAttributes ¶
func (c *Client[R]) GetGroupAttributes(id string, attribute *GroupResponseAttribute) (R, error)
GetGroupAttributes returns the full state of a group.
func (*Client[R]) GetLightState ¶
func (c *Client[R]) GetLightState(id string, container *LightResponseState) (R, error)
GetLightState Returns the full state of a light.
func (*Client[R]) GetSensor ¶
func (c *Client[R]) GetSensor(id string, container *SensorResponse) (R, error)
GetSensor Returns the sensor with the specified id. See also GetSensor.
func (*Client[R]) ModifyConfiguration ¶
func (c *Client[R]) ModifyConfiguration(request ConfigRequest) (R, error)
ModifyConfiguration Modify configuration parameters.
func (*Client[R]) PostWithResult ¶
func (*Client[R]) PutWithResult ¶
func (*Client[R]) RemoveFromAllGroups ¶
RemoveFromAllGroups Remove the light from all groups it is a member of.
func (*Client[R]) RemoveFromAllScenes ¶
RemoveFromAllScenes Remove the light from all scenes it is a member of.
func (*Client[R]) ResetGateway ¶
func (c *Client[R]) ResetGateway(request ConfigRequestReset) (R, error)
ResetGateway Reset the gateway network settings to factory new and/or delete the deCONZ database (config, lights, scenes, groups, schedules, devices, rules).
func (*Client[R]) ResetPassword ¶
ResetPassword Resets the username and password to default username = “delight” and password = “delight”. The request can only succeed within 10 minutes after gateway start.
func (*Client[R]) SetGroupAttributes ¶
func (c *Client[R]) SetGroupAttributes(id string, attribute GroupRequestAttribute) (R, error)
SetGroupAttributes of a group which are not related to its state. In order to add or remove lights to the group the lights must be powered on.
func (*Client[R]) SetGroupState ¶
func (c *Client[R]) SetGroupState(id string, state GroupRequestState) (R, error)
SetGroupState Sets the state of a group.
func (*Client[R]) SetLightAttributes ¶
func (c *Client[R]) SetLightAttributes(id string, attr LightRequestAttribute) (R, error)
SetLightAttributes Sets attributes of a light which are not related to its state.
func (*Client[R]) SetLightState ¶
func (c *Client[R]) SetLightState(id string, state LightRequestState) (R, error)
SetLightState Sets the state of a light.
func (*Client[R]) UpdateFirmware ¶
UpdateFirmware Starts the update firmware process if newer version is available.
func (*Client[R]) UpdateSensor ¶
func (c *Client[R]) UpdateSensor(id string, data SensorRequestUpdate) (R, error)
UpdateSensor Update a sensor with the specified parameters.
func (*Client[R]) UpdateSoftware ¶
UpdateSoftware Returns the newest software version available. Starts the update if available (only on Raspberry Pi).
type ClientAdapter ¶
type ClientAdapter[R any] interface { Get(path string, container interface{}) (R, error) Post(path string, data interface{}, container interface{}) (R, error) Put(path string, data interface{}, container interface{}) (R, error) Delete(path string, data interface{}) (R, error) }
func CreateAdapterHttpClientResty ¶
func CreateAdapterHttpClientResty(client *resty.Client, logger godeconz.Logger, trace bool) ClientAdapter[*resty.Response]
CreateAdapterHttpClientResty to plugin deconz api
type ColorMode ¶
type ColorMode string
const ColorModeCT ColorMode = "ct"
ColorModeCT color temperature
const ColorModeHS ColorMode = "hs"
ColorModeHS hue and saturation
const ColorModeXY ColorMode = "xy"
ColorModeXY CIE xy values
type ConfigDaylight ¶ added in v0.0.7
type ConfigDaylight struct { BaseConfig // True if the daylight sensor is configured with coordinates. R Daylight bool `json:"daylight"` // Latitude of the set location/timezone. W Lat float32 `json:"lat"` // Longitude of the set location/timezone. W Long float32 `json:"long"` // (-120–120) Sunrise offset value for location/timezone in minutes. R Sunriseoffset int8 `json:"sunriseoffset"` // (-120–120) Sunset offset value for location/timezone in minutes. R Sunsetoffset int8 `json:"sunsetoffset"` }
type ConfigRequest ¶
type ConfigRequest struct { // Set gateway discovery over the internet active or inactive. optional Discovery *bool `json:"discovery,omitempty"` // (0–5000) Time between two group commands in milliseconds. optional GroupDelay *uint16 `json:"groupdelay,omitempty"` // (1–65535) Default: 60; Sets the number of seconds where the timestamp for "lastseen" is updated at the earliest for light resources. For any such update, a seperate websocket event will be triggered. LightLastSeenInterval *uint16 `json:"lightlastseeninterval,omitempty"` // (0–16 chars) Name of the gateway. optional Name *string `json:"name,omitempty"` // (1–65535) Sets the lights and sensors search duration in seconds. optional NetworkOpenDuration *uint16 `json:"networkopenduration,omitempty"` // Set OTAU active or inactive. optional OTAUActive *bool `json:"otauactive,omitempty"` //(0–255) Open the network so that other zigbee devices can join. //0 = network closed, //255 = network open, //1–254 = time in seconds the network remains open. The value will decrement automatically. optional PermitJoin *uint8 `json:"permitjoin,omitempty"` // Set to true to bring the Zigbee network up and false to bring it down. // This has the same effect as using the Join and Leave buttons in deCONZ. optional RFConnected *bool `json:"rfconnected,omitempty"` // Can be used to store the timeformat permanently. It can be either "12h" or "24h". optional TimeFormat *ConfigTimeFormat `json:"timeformat,omitempty"` // Set the timezone of the gateway (only on Raspberry Pi). // Format: tzdatabase e.g. “Europe/Berlin” Wikipedia:ListOfTimeZones optional Timezone *string `json:"timezone,omitempty"` // (0–600) Unlock the gateway so that apps can register themselves to the gateway (time in seconds). optional Unlock *uint16 `json:"unlock,omitempty"` // Set update channel ("stable"|"alpha"|"beta"). optional UpdateChannel *UpdateChannel `json:"updatechannel,omitempty"` // Set the UTC time of the gateway (only on Raspberry Pi) in ISO 8601 format (yyyy-MM-ddTHH:mm:ss). optional Utc string `json:"utc,omitempty"` // Set the zigbee channel of the gateway. Notify other Zigbee devices also to change their channel. optional ZigbeeChannel *ZigbeeChannel `json:"zigbeechannel,omitempty"` // When true all state changes will be signalled through the Websocket connection (default true). optional WebsocketNotifyAll *bool `json:"websocketnotifyall,omitempty"` }
type ConfigRequestChangePassword ¶
type ConfigRequestChangePassword struct { // The username (currently only “delight” is supported). required Username string `json:"username"` // The Base64 encoded combination of “username:old password”. required OldHash string `json:"oldhash"` // The Base64 encoded combination of “username:new password”. required NewHash string `json:"newhash"` }
type ConfigRequestReset ¶
type ConfigRequestReset struct { // Set the network settings of the gateway to factory new. optional ResetGW *bool `json:"resetGW,omitempty"` // Delete the Database. optional DeleteDB *bool `json:"deleteDB,omitempty"` }
ConfigRequestReset At least one parameter is required!
type ConfigResponse ¶
type ConfigResponse struct { // The version of the deCONZ Rest API ApiVersion string `json:"apiversion"` // The unique identifier for the gateway. BridgeId string `json:"bridgeid"` // The product name of the gateway. Valid values are "ConBee", "RaspBee", "ConBee II" and "RaspBee II". DeviceName string `json:"devicename"` // Whether the IP address of the bridge is obtained with DHCP. Dhcp bool `json:"dhcp"` // The current Zigbee firmware version. FWVersion string `json:"fwversion"` // IPv4 address of the gateway. Gateway string `json:"gateway"` // IPv4 address of the gateway. Ipaddress string `json:"ipaddress"` Linkbutton bool `json:"linkbutton"` // The localtime of the gateway Localtime string `json:"localtime"` // MAC address of the gateway. Mac string `json:"mac"` // Fixed string "deCONZ". ModelId string `json:"modelid"` // Name of the gateway. Name string `json:"name"` // Network mask of the gateway. Netmask string `json:"netmask"` // (1–65535) The duration in seconds used by lights and sensors search, see Modify configuration. NetworkOpenDuration uint16 `json:"networkopenduration"` // Only for gateways running on Linux. Tells if the NTP time is "synced" or "unsynced". Ntp string `json:"ntp"` // (0–65535) The Zigbee pan ID of the gateway. PanId uint16 `json:"panid"` // This indicates whether the bridge is registered to synchronize data with a portal account. PortalServices bool `json:"portalservices"` // Not supported ProxyAddress string `json:"proxyaddress"` // Not supported ProxyPort int `json:"proxyport"` // Is true when the deCONZ is connected with the firmware and the Zigbee network is up. RFConnected bool `json:"rfconnected"` // Contains information related to software updates. SWUpdate struct { Notify bool `json:"notify"` Text string `json:"text"` UpdateState int `json:"updatestate"` Url string `json:"url"` } `json:"swupdate"` // The software version of the gateway. SWVersion string `json:"swversion"` // Stores a value of the time format that can be used by other applications. "12h" or "24h" TimeFormat string `json:"timeformat"` // Timezone used by the gateway (only on Raspberry Pi). "None" if not further specified. Timezone string `json:"timezone"` // Current UTC time of the gateway in ISO 8601 format. UTC string `json:"UTC"` // UPNP Unique ID of the gateway Uuid string `json:"uuid"` // When true all state changes will be signalled through the Websocket connection (default true). WebsocketNotifyAll bool `json:"websocketnotifyall"` // Port of the Websocket server. WebsocketPort int `json:"websocketport"` // An array of whitelisted API keys. Whitelist map[string]WhitelistedAPIKey `json:"whitelist"` // The current wireless frequency channel used by the Gateway. Supported channels: 11, 15, 20, 25. ZigbeeChannel int `json:"zigbeechannel"` }
type ConfigResponseFullState ¶
type ConfigResponseFullState struct { // Configuration of the gateway. Config ConfigResponse `json:"config"` // All groups of the gateway. Groups map[string]GroupResponseAttribute `json:"groups"` // All lights of the gateway. Lights map[string]LightResponseState `json:"lights"` // All rules of the gateway. (as from deconz version > 2.04.12) TODO needs to be implemented Rules json.RawMessage `json:"rules"` // All schedules of the gateway. TODO needs to be implemented Schedules json.RawMessage `json:"schedules"` }
type ConfigTimeFormat ¶
type ConfigTimeFormat string
const ( ConfigTimeFormat12h ConfigTimeFormat = "12h" ConfigTimeFormat24h ConfigTimeFormat = "24h" )
type ConfigZHAHumidity ¶ added in v0.0.7
type ConfigZHAHumidity struct { BaseConfig // (-32768–32767) Adds a signed offset value to measured state values. Values send by the REST-API are already // amended by the offset. RW Offset int16 `json:"offset"` }
type ConfigZHALightLevel ¶ added in v0.0.7
type ConfigZHALightLevel struct { BaseConfig // Specifies at which lightlevel the dark attribute turns false. Default: 12000 RW Tholddark uint16 `json:"tholddark"` // Relative offset to tholddark. Sets daylight attribute to true when lightlevel is at or above // (tholddark + tholdoffset). Default: 7000 RW Tholdoffset uint16 `json:"tholdoffset"` }
type ConfigZHAOpenClose ¶ added in v0.0.7
type ConfigZHAOpenClose struct {
BaseConfig
}
ConfigZHAOpenClose Not defined by API added for convenience
type ConfigZHAPresence ¶ added in v0.0.7
type ConfigZHAPresence struct { BaseConfig // (0–65535) Timeout in seconds presence state is set to false again. RW Duration uint16 `json:"duration"` // (0–65535) The occupied to unoccupied delay in seconds. RW Delay uint16 `json:"delay"` }
type ConfigZHAPressure ¶ added in v0.0.7
type ConfigZHAPressure struct {
BaseConfig
}
ConfigZHAPressure Not defined by API added for convenience
type ConfigZHASwitch ¶ added in v0.0.7
type ConfigZHASwitch struct { BaseConfig // The associated Zigbee group the sensor controls. (only supported by some sensors) R Group uint16 `json:"group"` // For ubisys S1/S2, operation mode of the switch. RW Mode string `json:"mode"` }
type ConfigZHATemperature ¶ added in v0.0.7
type ConfigZHATemperature struct { BaseConfig // Adds a signed offset value to measured state values. Values send by the REST-API are already amended by // the offset. R Offset int16 `json:"offset"` }
type ConfigZHAThermostat ¶ added in v0.0.7
type ConfigZHAThermostat struct { BaseConfig // Sets the current operating mode of a thermostat. (Supported modes are device dependent) RW Mode ZHAThermostatMode `json:"mode"` // Flip the display for TRVs supporting it. RW Displayflipped bool `json:"displayflipped"` // (-32768–32767) Allows to use the temperature value provided by an external sensor. // (device dependent and only exposed for devices supporting it) RW Externalsensortemp int16 `json:"externalsensortemp"` // Allows to use the open/close state from an external sensor. // (device dependent and only exposed for devices supporting it) RW Externalwindowopen bool `json:"externalwindowopen"` // Sets the mode of the fan. (device dependent and only exposed for devices supporting it) RW Fanmode ZHAThermostatFanMode `json:"fanmode"` // Eurotronic Spirit SPZB Only for debugging purpose. R Hostflags ZHAThermostatHostflags `json:"hostflags"` // Child lock active/inactive for thermostats/TRVs supporting it. RW Locked bool `json:"locked"` // Sets the operating mode for Tuya thermostats. (supported modes are device dependent) RW Preset ZHAThermostatPreset `json:"preset"` // Controls valve of thermostats. false — Close valve | true — Open valve (exposed for thermostats supporting it) RW Setvalve bool `json:"setvalve"` // Sets the AC louvers position. (exposed for thermostats supporting it) RW Swingmode ZHAThermostatSwingmode `json:"swingmode"` // Sets the mode of operation for Elko Super TR thermostat. RW TemperatureMeasurement ZHAThermostatTemperatureMeasurement `json:"temperature measurement"` // Sets if window open detection shall be active or inactive for Tuya thermostats. (support is device dependent) RW WindowOpenSet bool `json:"window open_set"` // A thermostat schedule. RW TODO not described in the https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/sensors/#dev-sensor-config-attr Schedule []interface{} `json:"schedule"` // True when a thermostat schedule is enabled. RW ScheduleOn bool `json:"schedule_on"` // (700–3500) Set the desired cooling temperature. RW Coolsetpoint uint8 `json:"coolsetpoint"` // (500–3200) Set the desired heating temperature. RW Heatsetpoint uint8 `json:"heatsetpoint"` // Sets a TRV into mounting mode if supported (valve fully open position). RW Mountingmode bool `json:"mountingmode"` }
type EtagCacheEntry ¶
type EtagCacheEntry struct {
// contains filtered or unexported fields
}
type GroupAlertMode ¶
type GroupAlertMode string
const GroupAlertModeLselect GroupAlertMode = "lselect"
GroupAlertModeLselect lights are blinking a longer time
const GroupAlertModeNone GroupAlertMode = "none"
GroupAlertModeNone lights are not performing an alert
const GroupAlertModeSelect GroupAlertMode = "select"
GroupAlertModeSelect lights are blinking a short time
type GroupEffectMode ¶
type GroupEffectMode string
const GroupEffectColorLoop GroupEffectMode = "colorloop"
GroupEffectColorLoop the lights of the group will cycle continously through all colors with the speed specified by colorloopspeed
const GroupEffectNone GroupEffectMode = "none"
GroupEffectNone no effect
type GroupRequestAttribute ¶
type GroupRequestAttribute struct { // (0–32) The name of the group optional Name string `json:"name,omitempty"` // IDs of the lights which are members of the group. optional Lights []string `json:"lights,omitempty"` // Indicates the hidden status of the group. Has no effect at the gateway but apps can use this to hide groups. optional Hidden *bool `json:"hidden,omitempty"` // Specify a sorted list of light ids that can be used in apps. optional Lightsequence []string `json:"lightsequence,omitempty"` // Append the subsequential light ids of multi-devices like the FLS-PP if the app should handle that light differently. optional Mulitdeviceids []string `json:"mulitdeviceids,omitempty"` }
type GroupRequestCreate ¶
type GroupRequestCreate struct {
Name string `json:"name"`
}
type GroupRequestState ¶
type GroupRequestState struct { // Set to true to turn the lights on, false to turn them off. optional On *bool `json:"on"` // Set to true toggles the lights of that group from on to off or vice versa, false has no effect. **Notice:** This setting supersedes the `on` parameter! optional Toggle *bool `json:"toggle"` // (0–255) Set the brightness of the group. Depending on the lights 0 might not mean visible "off" but minimum brightness. If the lights are off and the value is greater 0 a on=true shall also be provided. optional Bri *uint8 `json:"bri"` // (0–65535) Set the color hue of the group. The hue parameter in the HSV color model is between 0°–360° and is mapped to 0–65535 to get 16-bit resolution. optional Hue *uint16 `json:"hue"` // (0–255) Set the color saturation of the group. There 0 means no color at all and 255 is the highest saturation of the color. optional Sat *uint8 `json:"sat"` // (153–500) Set the Mired color temperature of the group. (2000K–6500K) optional Ct *uint16 `json:"ct"` // Set the CIE xy color space coordinates as array [x, y] of real values (0–1). optional Xy []float32 `json:"xy"` // Trigger a temporary alert effect. optional Alert GroupAlertMode `json:"alert"` // Trigger an effect of the group. optional Effect GroupEffectMode `json:"effect"` // (1–255) Specifies the speed of a colorloop. 1 = very fast, 255 = very slow (default: 15). This parameter only has an effect when it is called together with effect colorloop. optional Colorloopspeed *uint8 `json:"colorloopspeed"` // Transition time in 1/10 seconds between two states. Note that not all states support a transition time. // For example, a transition time when setting on will be ignored as the Zigbee On and Off commands do not support //transition times. In general, light attributes that support a range of values support transition times, while //boolean values do not. optional Transitiontime *uint `json:"transitiontime"` }
type GroupResponse ¶
type GroupResponse struct { // If this group was created by a device (switch or sensor) this list contains the device ids. Devicemembership []string `json:"devicemembership"` // HTTP etag which changes on any action to the group. Etag string `json:"etag"` // Indicates if this group is hidden. Hidden bool `json:"hidden"` // Name of a group. Name string `json:"name"` }
type GroupResponseAttribute ¶
type GroupResponseAttribute struct { // A list of device ids (sensors) if this group was created by a device. Devicemembership []string `json:"devicemembership"` // HTTP etag which changes on any action to the group. Etag string `json:"etag"` // Indicates the hidden status of the group. Has no effect at the gateway but apps can use this to hide groups. Hidden bool `json:"hidden"` // The id of the group. Id string `json:"id"` // A list of all light ids of this group. Sequence is defined by the gateway. Lights []string `json:"lights"` // A list of light ids of this group that can be sorted by the user. Need not contain all light ids of this group. Lightsequence []string `json:"lightsequence"` // A list of light ids of this group that are subsequent ids from multi devices with multiple endpoints like the FLS-PP. Mulitdeviceids []string `json:"mulitdeviceids"` // Name of the group. Name string `json:"name"` // A list of scenes of the group. Scenes []struct { Id string `json:"id"` Name string `json:"name"` } // contains filtered or unexported fields }
type GroupResponseCreate ¶
type GroupResponseCreate struct { Success struct { // The unique identifier of the group. Id string `json:"id"` } `json:"success"` }
type HAAirQualityValues ¶ added in v0.0.7
type HAAirQualityValues string
type LightAlertMode ¶
type LightAlertMode string
const LightAlertLselect LightAlertMode = "lselect"
LightAlertLselect light is blinking a longer time
const LightAlertNone LightAlertMode = "none"
LightAlertNone light is not performing an alert
const LightAlertSelect LightAlertMode = "select"
LightAlertSelect light is blinking a short time
type LightEffectMode ¶
type LightEffectMode string
const LightEffectColorLoop LightEffectMode = "colorloop"
LightEffectColorLoop cycle through hue values 0–360
const LightEffectNone LightEffectMode = "none"
LightEffectNone no effect
type LightRequestAttribute ¶
type LightRequestAttribute struct {
// contains filtered or unexported fields
}
type LightRequestDelete ¶
type LightRequestDelete struct {
// contains filtered or unexported fields
}
type LightRequestState ¶
type LightRequestState struct { // Trigger a temporary alert effect. optional Alert LightAlertMode `json:"alert,omitempty"` // Number (0–255) Set the brightness of the light. Depending on the light type 0 might not mean visible "off" // but minimum brightness. If the light is off and the value is greater 0 a on=true shall also be provided. optional Bri *uint8 `json:"bri,omitempty"` // Specifies the speed of a colorloop (default: 15). 1 = very fast 255 = very slow This parameter only has an // effect when it is called together with effect colorloop. optional Colorloopspeed *uint8 `json:"colorloopspeed,omitempty"` // (ctmin–ctmax) Set the Mired color temperature of the light. Where Mired is 1000000 / color temperature // (in kelvins). optional Ct *int `json:"ct,omitempty"` // Trigger an effect of the light. optional Effect LightEffectMode `json:"effect,omitempty"` // (0–65535) Set the color hue of the light. The hue parameter in the HSV color model is between 0°–360° and is // mapped to 0–65535 to get 16-bit resolution. optional Hue *uint16 `json:"hue,omitempty"` // Set to true to turn the light on, false to turn it off. optional On *bool `json:"on,omitempty"` // Number (0–255) Set the color saturation of the light. There 0 means no color at all and 255 is the greatest // saturation of the color. optional Sat *uint8 `json:"sat,omitempty"` // Transition time in 1/10 seconds between two states. Note that not all states support a transition time. // For example, a transition time when setting on will be ignored as the Zigbee On and Off commands do not support // transition times. In general, light attributes that support a range of values support transition times, while // boolean values do not. optional Transitiontime *uint `json:"transitiontime,omitempty"` // Set the CIE xy color space coordinates as array [x, y] of real values (0–1). optional Xy []float32 `json:"xy,omitempty"` }
type LightResponseState ¶
type LightResponseState struct { // The color capabilities as reported by the light. Colorcapabilities *int `json:"colorcapabilities"` // The maximum mired color temperature value a device supports. Ctmax *int `json:"ctmax"` // The minimum mired color temperature value a device supports. Ctmin *int `json:"ctmin"` // Last time the device announced itself to the network. Lastannounced string `json:"lastannounced"` // Last time the device has transmitted any data. Lastseen string `json:"lastseen"` // HTTP etag which changes on any action to the light. Etag string `json:"etag"` // Indicates if the light can change color. Deprecated - use state instead: if light has no color colormode, hue // and xy will not be shown. Hascolor *bool `json:"hascolor"` // The manufacturer of the light device. Manufacturer string `json:"manufacturer"` // Name of a light. Name string `json:"name"` // An identifier unique to the product. Modelid string `json:"modelid"` // Not used in the current version. Pointsymbol *interface{} `json:"pointsymbol"` // SETTABLE. Brightness to set after power on (limited to DE devices). Powerup *int `json:"powerup"` // Firmware version. Swversion string `json:"swversion"` // Human-readable type of the light. Type string `json:"type"` // The current state of the light. State json.RawMessage `json:"state"` // The unique id of the light. It consists of the MAC address of the light followed by a dash and a unique endpoint // identifier in the range 01 to FF. Uniqueid string `json:"uniqueid"` }
func (LightResponseState) StateAs ¶ added in v0.0.14
func (l LightResponseState) StateAs(data interface{}) error
type LightResponseStateDetail ¶
type LightResponseStateDetail struct { // true if the light is on. On *bool `json:"on"` // (0–255) Brightness of the light. Depending on the light type 0 might not mean visible "off" but minimum // brightness. Bri *int `json:"bri"` // (0–65535) Color hue of the light. The hue parameter in the HSV color model is between 0°–360° and is mapped // to 0–65535 to get 16-bit resolution. Hue *int `json:"hue"` // (0–255) Color saturation of the light. There 0 means no color at all and 255 is the greatest saturation of // the color. Sat *int `json:"sat"` // (ctmin–ctmax) Mired color temperature of the light. Where Mired is 1000000 / color temperature (in kelvins). Ct *int `json:"ct"` // CIE xy color space coordinates as array [x, y] of real values (0–1). Xy *[]float32 `json:"xy"` // Temporary alert effect. Alert *LightAlertMode `json:"alert"` // The current color mode of the light Colormode *ColorMode `json:"colormode"` // Effect of the light Effect *LightEffectMode `json:"effect"` // (0–6) SETTABLE. Sets the speed of fans/ventilators. Speed *uint8 `json:"speed"` // true if the light is reachable and accepts commands. Reachable *bool `json:"reachable"` }
func (LightResponseStateDetail) GetAlert ¶ added in v0.0.13
func (l LightResponseStateDetail) GetAlert() interface{}
func (LightResponseStateDetail) GetBrightness ¶ added in v0.0.13
func (l LightResponseStateDetail) GetBrightness() int
func (LightResponseStateDetail) IsOn ¶ added in v0.0.13
func (l LightResponseStateDetail) IsOn() bool
type SensorMode ¶
type SensorMode int
SensorMode (only available for dresden elektronik Lighting Switch)
const SensorModeScene SensorMode = 1
const SensorModeTemperature SensorMode = 3
const SensorModeTwoGroup SensorMode = 2
type SensorRequestCreate ¶
type SensorRequestCreate[T any] struct { // Name The name of the sensor. required Name string `json:"name"` // Modelid The model identifier of the sensor. required Modelid string `json:"modelid"` // The software version of the sensor. required Swversion string `json:"swversion"` // The type of the sensor, see Sensor types and states. required Type string `json:"type"` // The unique id of the sensor. Should be the MAC address of the device. required Uniqueid string `json:"uniqueid"` // The manufacturer name of the sensor. required Manufacturername string `json:"manufacturername"` // The state of the sensor, see Sensor types and states. optional State *T `json:"state,omitempty"` // The config of the sensor. optional Config *SensorRequestCreateConfig `json:"config,omitempty"` }
type SensorRequestUpdate ¶
type SensorRequestUpdate struct { // The name of the sensor. optional Name *string `json:"name,omitempty"` // Only available for dresden elektronik Lighting Switch. Set the mode of the switch. optional Mode *SensorMode `json:"mode,omitempty"` }
type SensorResponse ¶
type SensorResponse struct { // The config of the sensor. Refer to Change sensor config for further details. Config json.RawMessage `json:"config"` // The Endpoint of the sensor. Ep int `json:"ep"` // HTTP etag which changes whenever the sensor changes. Etag string `json:"etag"` // (ISO 8601 timestamp) Timestamp representing the last time a message from the sensor was received. UTC with resolution of minutes. Lastseen string `json:"lastseen"` // The manufacturer name of the sensor. Manufacturername string `json:"manufacturername"` // The mode of the sensor. Mode *SensorMode `json:"mode"` // The model id of the sensor. Modelid string `json:"modelid"` // The name of the sensor. Name string `json:"name"` // The state of the sensor. State json.RawMessage `json:"state"` // Software version of the sensor. Swversion string `json:"swversion"` // The type of the sensor. Type string `json:"type"` // The unique identifiers including the MAC address of the sensor. Uniqueid string `json:"uniqueid"` }
func (SensorResponse) ConfigAs ¶ added in v0.0.14
func (s SensorResponse) ConfigAs(data interface{}) error
func (SensorResponse) StateAs ¶ added in v0.0.14
func (s SensorResponse) StateAs(data interface{}) error
type StateDaylight ¶ added in v0.0.7
type StateDaylight struct { Dark bool `json:"dark"` Daylight bool `json:"daylight"` // ISO 8601 timestamp Lastupdated string `json:"lastupdated"` Status int `json:"status"` Sunrise string `json:"sunrise"` Sunset string `json:"sunset"` }
StateDaylight not documented by API
type StateHAAirQuality ¶ added in v0.0.7
type StateHAAirQuality struct { Airquality HAAirQualityValues `json:"airquality"` Airqualityppb uint16 `json:"airqualityppb"` }
type StateZHAAlarm ¶ added in v0.0.7
type StateZHACarbonMonoxide ¶ added in v0.0.7
type StateZHAConsumption ¶ added in v0.0.7
type StateZHAFire ¶ added in v0.0.7
type StateZHAHumidity ¶ added in v0.0.7
type StateZHALightLevel ¶ added in v0.0.7
type StateZHAOpenClose ¶ added in v0.0.7
type StateZHAPower ¶ added in v0.0.7
type StateZHAPresence ¶ added in v0.0.7
type StateZHAPressure ¶ added in v0.0.7
type StateZHASwitch ¶ added in v0.0.7
type StateZHASwitch struct { // Refer to https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/sensors/button_events for device specific // values. Buttonevent int `json:"buttonevent"` // ISO 8601 timestamp Lastupdated string `json:"lastupdated"` Gesture int `json:"gesture"` Eventduration int `json:"eventduration"` X int `json:"x"` Y int `json:"y"` Angle int `json:"angle"` }
type StateZHATemperature ¶ added in v0.0.7
type StateZHAThermostat ¶ added in v0.0.7
type StateZHAThermostat struct { On bool `json:"on"` Errorcode string `json:"errorcode"` Fanmode string `json:"fanmode"` Floortemperature int `json:"floortemperature"` Heating bool `json:"heating"` // ISO 8601 timestamp Lastupdated string `json:"lastupdated"` Mountingmodeactive bool `json:"mountingmodeactive"` Temperature int `json:"temperature"` Valve int `json:"valve"` Windowopen string `json:"windowopen"` }
type StateZHATime ¶ added in v0.0.7
type StateZHAVibration ¶ added in v0.0.7
type StateZHAWater ¶ added in v0.0.7
type UpdateChannel ¶
type UpdateChannel string
const ( UpdateChannelStable UpdateChannel = "stable" UpdateChannelAlpha UpdateChannel = "alpha" UpdateChannelBeta UpdateChannel = "beta" )
type WhitelistedAPIKey ¶
type ZHASwitchMode ¶ added in v0.0.7
type ZHASwitchMode string
const ZHASwitchModeMomentary ZHASwitchMode = "momentary"
const ZHASwitchModeRocker ZHASwitchMode = "rocker"
type ZHAThermostatFanMode ¶ added in v0.0.7
type ZHAThermostatFanMode string
const ZHAThermostatFanModeAuto ZHAThermostatFanMode = "auto"
const ZHAThermostatFanModeHigh ZHAThermostatFanMode = "high"
const ZHAThermostatFanModeLow ZHAThermostatFanMode = "low"
const ZHAThermostatFanModeMedium ZHAThermostatFanMode = "medium"
const ZHAThermostatFanModeOff ZHAThermostatFanMode = "off"
const ZHAThermostatFanModeOn ZHAThermostatFanMode = "on"
const ZHAThermostatFanModeSmart ZHAThermostatFanMode = "smart"
type ZHAThermostatHostflags ¶ added in v0.0.7
type ZHAThermostatHostflags int32
const ZHAThermostatHostflagsDisplayFlipped ZHAThermostatHostflags = 0x0002
const ZHAThermostatHostflagsLocked ZHAThermostatHostflags = 0x0080
const ZHAThermostatHostflagsModeHeat ZHAThermostatHostflags = 0x0004
const ZHAThermostatHostflagsModeOff ZHAThermostatHostflags = 0x0010
type ZHAThermostatMode ¶ added in v0.0.7
type ZHAThermostatMode string
const ZHAThermostatModeAuto ZHAThermostatMode = "auto"
const ZHAThermostatModeCool ZHAThermostatMode = "cool"
const ZHAThermostatModeDry ZHAThermostatMode = "dry"
const ZHAThermostatModeEmergencyHeating ZHAThermostatMode = "emergency heating"
const ZHAThermostatModeFanOnly ZHAThermostatMode = "fan only"
const ZHAThermostatModeHeat ZHAThermostatMode = "heat"
const ZHAThermostatModeOff ZHAThermostatMode = "off"
const ZHAThermostatModePrecooling ZHAThermostatMode = "precooling"
const ZHAThermostatModeSleep ZHAThermostatMode = "sleep"
type ZHAThermostatPreset ¶ added in v0.0.7
type ZHAThermostatPreset string
const ZHAThermostatPresetAuto ZHAThermostatPreset = "auto"
const ZHAThermostatPresetBoost ZHAThermostatPreset = "boost"
const ZHAThermostatPresetComfort ZHAThermostatPreset = "comfort"
const ZHAThermostatPresetComplex ZHAThermostatPreset = "complex"
const ZHAThermostatPresetEco ZHAThermostatPreset = "eco"
const ZHAThermostatPresetHoliday ZHAThermostatPreset = "holiday"
const ZHAThermostatPresetManual ZHAThermostatPreset = "manual"
type ZHAThermostatSwingmode ¶ added in v0.0.7
type ZHAThermostatSwingmode string
const ZHAThermostatSwingmodeFullyClosed ZHAThermostatSwingmode = "fully closed"
const ZHAThermostatSwingmodeFullyOpen ZHAThermostatSwingmode = "fully open"
const ZHAThermostatSwingmodeHalfOpen ZHAThermostatSwingmode = "half open"
const ZHAThermostatSwingmodeQuarterOpen ZHAThermostatSwingmode = "quarter open"
const ZHAThermostatSwingmodeThreeQuartersOpen ZHAThermostatSwingmode = "three quarters open"
type ZHAThermostatTemperatureMeasurement ¶ added in v0.0.7
type ZHAThermostatTemperatureMeasurement string
const ZHAThermostatTemperatureMeasurementAirSensor ZHAThermostatTemperatureMeasurement = "air sensor"
const ZHAThermostatTemperatureMeasurementFloorProtection ZHAThermostatTemperatureMeasurement = "floor protection"
const ZHAThermostatTemperatureMeasurementFloorSensor ZHAThermostatTemperatureMeasurement = "floor sensor"
type ZigbeeChannel ¶
type ZigbeeChannel uint8
const ( Channel11 ZigbeeChannel = 11 Channel15 ZigbeeChannel = 15 Channel20 ZigbeeChannel = 20 Channel25 ZigbeeChannel = 25 )