Documentation
¶
Index ¶
- Constants
- type ButtonEvent
- type DeconzDevice
- func (e *DeconzDevice) CreateButtonDevice(sensor deconzsensor.Sensor, buttonId int)
- func (e *DeconzDevice) NewDeconzDevice(vdcdClient *vdcdapi.Client, deconzHost string, deconzPort int, ...) *vdcdapi.Device
- func (e *DeconzDevice) NewDeconzGroupDevice() *vdcdapi.Device
- func (e *DeconzDevice) NewDeconzLightDevice() *vdcdapi.Device
- func (e *DeconzDevice) NewDeconzSensorDevice() *vdcdapi.Device
- func (e *DeconzDevice) SetBrightness(brightness float32)
- func (e *DeconzDevice) SetColorTemp(ct float32)
- func (e *DeconzDevice) SetHue(hue float32)
- func (e *DeconzDevice) SetSaturation(saturation float32)
- func (e *DeconzDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)
- func (e *DeconzDevice) StartDiscovery(vdcdClient *vdcdapi.Client, deconzHost string, deconzPort int, ...)
- func (e *DeconzDevice) TurnOff()
- func (e *DeconzDevice) TurnOn()
- func (e *DeconzDevice) ZHASwitchSensorDiscovery(sensor deconzsensor.Sensor)
- type DeconzLightAttribute
- type DeconzState
- type DeconzWebSocketMessage
- type GenericDevice
- type MQTTProxy
- type ShellyDevice
- func (e *ShellyDevice) NewShellyDevice(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client) *vdcdapi.Device
- func (e *ShellyDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)
- func (e *ShellyDevice) StartDiscovery(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client)
- func (e *ShellyDevice) TurnOff()
- func (e *ShellyDevice) TurnOn()
- type TasmotaDevice
- func (e *TasmotaDevice) NewTasmotaDevice(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client) *vdcdapi.Device
- func (e *TasmotaDevice) SetBrightness(brightness float32)
- func (e *TasmotaDevice) SetColorTemp(ct float32)
- func (e *TasmotaDevice) SetHSB(hue float32, saturation float32, brightness float32)
- func (e *TasmotaDevice) SetHue(hue float32)
- func (e *TasmotaDevice) SetSaturation(saturation float32)
- func (e *TasmotaDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)
- func (e *TasmotaDevice) SetWhite(white float32)
- func (e *TasmotaDevice) StartDiscovery(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client)
- func (e *TasmotaDevice) TurnOff()
- func (e *TasmotaDevice) TurnOn()
- type TasmotaResultMsg
- type TasmotaTeleMsg
- type TasmotaTeleSI721Msg
- type Z2MCluster
- type Z2MDefinition
- type Z2MDevice
- type Z2MDeviceData
- type Z2MEndpoint
- type Z2MFeatures
- type Z2MGroup
- type Z2MMember
- type Z2MScene
- type Zigbee2MQTTDevice
- func (e *Zigbee2MQTTDevice) CreateButtonDevice(z2mDevice Z2MDevice, actionID int, actionPrefix string) *Zigbee2MQTTDevice
- func (e *Zigbee2MQTTDevice) CreateLightDevice(z2mDevice Z2MDevice)
- func (e *Zigbee2MQTTDevice) NewZigbee2MQTT(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client, device *vdcdapi.Device)
- func (e *Zigbee2MQTTDevice) SetBrightness(brightness float32)
- func (e *Zigbee2MQTTDevice) SetColorTemp(ct float32)
- func (e *Zigbee2MQTTDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)
- func (e *Zigbee2MQTTDevice) StartDiscovery(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client)
- func (e *Zigbee2MQTTDevice) TurnOff()
- func (e *Zigbee2MQTTDevice) TurnOn()
Constants ¶
View Source
const ( // milisecs SingleTip int = 150 SingleClick int = 50 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ButtonEvent ¶
type ButtonEvent int
const ( Hold ButtonEvent = iota + 1 ShortRelease LongRelease DoublePress TreeplePress )
http://developer.digitalstrom.org/Architecture/ds-basics.pdf
type DeconzDevice ¶
type DeconzDevice struct { GenericDevice IsLight bool IsGroup bool IsSensor bool // contains filtered or unexported fields }
func (*DeconzDevice) CreateButtonDevice ¶
func (e *DeconzDevice) CreateButtonDevice(sensor deconzsensor.Sensor, buttonId int)
func (*DeconzDevice) NewDeconzDevice ¶
func (*DeconzDevice) NewDeconzGroupDevice ¶
func (e *DeconzDevice) NewDeconzGroupDevice() *vdcdapi.Device
func (*DeconzDevice) NewDeconzLightDevice ¶
func (e *DeconzDevice) NewDeconzLightDevice() *vdcdapi.Device
func (*DeconzDevice) NewDeconzSensorDevice ¶
func (e *DeconzDevice) NewDeconzSensorDevice() *vdcdapi.Device
func (*DeconzDevice) SetBrightness ¶
func (e *DeconzDevice) SetBrightness(brightness float32)
func (*DeconzDevice) SetColorTemp ¶
func (e *DeconzDevice) SetColorTemp(ct float32)
func (*DeconzDevice) SetHue ¶
func (e *DeconzDevice) SetHue(hue float32)
func (*DeconzDevice) SetSaturation ¶
func (e *DeconzDevice) SetSaturation(saturation float32)
func (*DeconzDevice) SetValue ¶
func (e *DeconzDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)
Apply update from dss to deconz device
func (*DeconzDevice) StartDiscovery ¶
func (*DeconzDevice) TurnOff ¶
func (e *DeconzDevice) TurnOff()
func (*DeconzDevice) TurnOn ¶
func (e *DeconzDevice) TurnOn()
func (*DeconzDevice) ZHASwitchSensorDiscovery ¶
func (e *DeconzDevice) ZHASwitchSensorDiscovery(sensor deconzsensor.Sensor)
type DeconzLightAttribute ¶
type DeconzLightAttribute struct { Id string `json:"id,omitempty"` LastAnnounced string `json:"lastannounced,omitempty"` LastSeen string `json:"lastseen,omitempty"` ManufacturerName string `json:"manufacturername,omitempty"` ModelId string `json:"modelid,omitempty"` Name string `json:"name,omitempty"` SWVersion string `json:"swversion,omitempty"` Type string `json:"type,omitempty"` UniqueID string `json:"uniqueid,omitempty"` ColorCapabilities int `json:"colorcapabilities,omitempty"` Ctmax int `json:"ctmax,omitempty"` Ctmin int `json:"ctmin,omitempty"` }
type DeconzState ¶
type DeconzState struct { // Light & Group On *bool `json:"on,omitempty"` // Hue *uint16 `json:"hue,omitempty"` // Effect string `json:"effect,omitempty"` // Bri *uint8 `json:"bri,omitempty"` // min = 1, max = 254 Sat *uint8 `json:"sat,omitempty"` // CT *uint16 `json:"ct,omitempty"` // min = 154, max = 500 XY []float32 `json:"xy,omitempty"` Alert string `json:"alert,omitempty"` // Light Reachable *bool `json:"reachable,omitempty"` ColorMode string `json:"colormode,omitempty"` ColorLoopSpeed *uint8 `json:"colorloopspeed,omitempty"` TransitionTime *uint16 `json:"transitiontime,omitempty"` // Group AllOn bool `json:"all_on,omitempty"` AnyOn bool `json:"any_on,omitempty"` // Sensor ButtonEvent int `json:"buttonevent,omitempty"` }
type DeconzWebSocketMessage ¶
type DeconzWebSocketMessage struct { Type string `json:"t,omitempty"` Event string `json:"e,omitempty"` Resource string `json:"r,omitempty"` ID string `json:"id,omitempty"` UniqueID string `json:"uniqueid,omitempty"` GroupID string `json:"gid,omitempty"` SceneID string `json:"scid,omitempty"` Name string `json:"name,omitempty"` Attributes DeconzLightAttribute `json:"attr,omitempty"` State DeconzState `json:"state,omitempty"` }
type GenericDevice ¶
type GenericDevice struct {
// contains filtered or unexported fields
}
type MQTTProxy ¶
type MQTTProxy struct {
// contains filtered or unexported fields
}
This MQTT Proxy is needed because we can only subscribe to a topic once with a callback. The second subscribe would overwrite the registered callback function
type ShellyDevice ¶
type ShellyDevice struct { GenericDevice Id string `json:"id,omitempty"` Model string `json:"model,omitempty"` MACAddress string `json:"mac,omitempty"` IPAddress string `json:"ip,omitempty"` NewFirewareAvailable bool `json:"new_fw,omitempty"` FirmewareVersion string `json:"fw_ver,omitempty"` }
func (*ShellyDevice) NewShellyDevice ¶
func (*ShellyDevice) SetValue ¶
func (e *ShellyDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)
Apply update from dss to shelly
func (*ShellyDevice) StartDiscovery ¶
func (e *ShellyDevice) StartDiscovery(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client)
func (*ShellyDevice) TurnOff ¶
func (e *ShellyDevice) TurnOff()
func (*ShellyDevice) TurnOn ¶
func (e *ShellyDevice) TurnOn()
type TasmotaDevice ¶
type TasmotaDevice struct { GenericDevice IPAddress string `json:"ip,omitempty"` DeviceName string `json:"dn,omitempty"` FriendlyName []string `json:"fn,omitempty"` Hostname string `json:"hn,omitempty"` MACAddress string `json:"mac,omitempty"` Module string `json:"md,omitempty"` TuyaMCUFlag int `json:"ty,omitempty"` IFAN int `json:"if,omitempty"` DOffline string `json:"ofln,omitempty"` DOnline string `json:"onln,omitempty"` State []string `json:"st,omitempty"` SoftwareVersion string `json:"sw,omitempty"` Topic string `json:"t,omitempty"` Fulltopic string `json:"ft,omitempty"` TopicPrefix []string `json:"tp,omitempty"` Relays []int `json:"rl,omitempty"` Switches []int `json:"swc,omitempty"` SWN []int `json:"swn,omitempty"` Buttons []int `json:"btn,omitempty"` SetOptions map[string]int `json:"so,omitempty"` LK int `json:"lk,omitempty"` // LightColor (LC) and RGB LinKed https://github.com/arendst/Tasmota/blob/development/tasmota/xdrv_04_light.ino#L689 LightSubtype int `json:"lt_st,omitempty"` // https://github.com/arendst/Tasmota/blob/development/tasmota/xdrv_04_light.ino ShutterOptions []int `json:"sho,omitempty"` Version int `json:"ver,omitempty"` }
func (*TasmotaDevice) NewTasmotaDevice ¶
func (*TasmotaDevice) SetBrightness ¶
func (e *TasmotaDevice) SetBrightness(brightness float32)
func (*TasmotaDevice) SetColorTemp ¶
func (e *TasmotaDevice) SetColorTemp(ct float32)
func (*TasmotaDevice) SetHSB ¶
func (e *TasmotaDevice) SetHSB(hue float32, saturation float32, brightness float32)
func (*TasmotaDevice) SetHue ¶
func (e *TasmotaDevice) SetHue(hue float32)
func (*TasmotaDevice) SetSaturation ¶
func (e *TasmotaDevice) SetSaturation(saturation float32)
func (*TasmotaDevice) SetValue ¶
func (e *TasmotaDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)
Apply update from dss to shelly
func (*TasmotaDevice) SetWhite ¶
func (e *TasmotaDevice) SetWhite(white float32)
func (*TasmotaDevice) StartDiscovery ¶
func (e *TasmotaDevice) StartDiscovery(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client)
func (*TasmotaDevice) TurnOff ¶
func (e *TasmotaDevice) TurnOff()
func (*TasmotaDevice) TurnOn ¶
func (e *TasmotaDevice) TurnOn()
type TasmotaResultMsg ¶
type TasmotaResultMsg struct { Power1 string `json:"POWER1,omitempty"` Power string `json:"POWER,omitempty"` Dimmer int `json:"Dimmer,omitempty"` Color string `json:"Color,omitempty"` HSBCOlor string `json:"HSBColor,omitempty"` White int `json:"White,omitempty"` Channel []int `json:"Channel,omitempty"` }
type TasmotaTeleMsg ¶
type TasmotaTeleMsg struct { Time string `json:"time,omitempty"` TempUnit string `json:"TempUnit,omitempty"` SI7021 TasmotaTeleSI721Msg `json:"SI7021,omitempty"` }
type TasmotaTeleSI721Msg ¶
type Z2MCluster ¶
type Z2MDefinition ¶
type Z2MDefinition struct { Model string `json:"model"` Vendor string `json:"vendor"` Description string `json:"description"` Options []interface{} `json:"options"` // Customize the type according to actual options structure Exposes []Z2MFeatures `json:"exposes"` // Customize the type according to actual exposes structure }
type Z2MDevice ¶
type Z2MDevice struct { IEEEAddress string `json:"ieee_address"` Type string `json:"type"` NetworkAddress int `json:"network_address"` Supported bool `json:"supported"` Disabled bool `json:"disabled"` FriendlyName string `json:"friendly_name"` Description string `json:"description"` Endpoints map[string]Z2MEndpoint `json:"endpoints"` Definition Z2MDefinition `json:"definition"` PowerSource string `json:"power_source"` DateCode string `json:"date_code"` ModelID string `json:"model_id"` Scenes []Z2MScene `json:"scenes"` Interviewing bool `json:"interviewing"` InterviewCompleted bool `json:"interview_completed"` }
type Z2MDeviceData ¶
type Z2MDeviceData struct { Battery *int `json:"battery,omitempty"` BatteryLow *bool `json:"battery_low,omitempty"` Humidity *float32 `json:"humidity,omitempty"` LinkQuality *int `json:"linkquality,omitempty"` PowerOutageCount *int `json:"power_outage_count,omitempty"` Pressure *float32 `json:"pressure,omitempty"` Temperature *float32 `json:"temperature,omitempty"` DeviceTemperature *float32 `json:"device_temperature,omitempty"` Voltage *float32 `json:"voltage,omitempty"` Contact *bool `json:"contact,omitempty"` TriggerCount *int `json:"trigger_count,omitempty"` Action *string `json:"action,omitempty"` OperationMode *string `json:"operation_mode,omitempty"` Sensitivity *string `json:"sensitivity,omitempty"` Tamper *bool `json:"tamper,omitempty"` KeepTime *int `json:"keep_time,omitempty"` Brightness *float32 `json:"brightness,omitempty"` PowerOnBehaviour *string `json:"power_on_behaviour,omitempty"` State *string `json:"state,omitempty"` UpdateAvailable *bool `json:"update_available,omitempty"` ColorMode *string `json:"color_mode,omitempty"` ColorTemp *int `json:"color_temp,omitempty"` }
type Z2MEndpoint ¶
type Z2MEndpoint struct { Bindings []interface{} `json:"bindings"` ConfiguredReportings []interface{} `json:"configured_reportings"` Clusters Z2MCluster `json:"clusters"` }
type Z2MFeatures ¶
type Z2MFeatures struct { Features []Z2MFeatures `json:"features,omitempty"` Access int `json:"access,omitempty"` Description string `json:"description,omitempty"` Label string `json:"label,omitempty"` Name string `json:"name,omitempty"` Property string `json:"property,omitempty"` Type string `json:"type,omitempty"` // Light, Enum, numeric, binary Unit string `json:"unit,omitempty"` ValueOff string `json:"value_off,omitempty"` ValueOn string `json:"value_on,omitempty"` ValueToggle string `json:"value_toggle,omitempty"` ValueMax int `json:"value_max,omitempty"` ValueMin int `json:"value_min,omitempty"` Values []string `json:"values,omitempty"` }
type Zigbee2MQTTDevice ¶
type Zigbee2MQTTDevice struct { GenericDevice IsDevice bool IsGroup bool Topic string FriendlyName string // contains filtered or unexported fields }
func (*Zigbee2MQTTDevice) CreateButtonDevice ¶
func (e *Zigbee2MQTTDevice) CreateButtonDevice(z2mDevice Z2MDevice, actionID int, actionPrefix string) *Zigbee2MQTTDevice
func (*Zigbee2MQTTDevice) CreateLightDevice ¶
func (e *Zigbee2MQTTDevice) CreateLightDevice(z2mDevice Z2MDevice)
func (*Zigbee2MQTTDevice) NewZigbee2MQTT ¶
func (*Zigbee2MQTTDevice) SetBrightness ¶
func (e *Zigbee2MQTTDevice) SetBrightness(brightness float32)
func (*Zigbee2MQTTDevice) SetColorTemp ¶
func (e *Zigbee2MQTTDevice) SetColorTemp(ct float32)
func (*Zigbee2MQTTDevice) SetValue ¶
func (e *Zigbee2MQTTDevice) SetValue(value float32, channelName string, channelType vdcdapi.ChannelTypeType)
Apply update from dss to shelly
func (*Zigbee2MQTTDevice) StartDiscovery ¶
func (e *Zigbee2MQTTDevice) StartDiscovery(vdcdClient *vdcdapi.Client, mqttClient mqtt.Client)
func (*Zigbee2MQTTDevice) TurnOff ¶
func (e *Zigbee2MQTTDevice) TurnOff()
func (*Zigbee2MQTTDevice) TurnOn ¶
func (e *Zigbee2MQTTDevice) TurnOn()
Click to show internal directories.
Click to hide internal directories.