Documentation ¶
Index ¶
- Constants
- func AddAssociation(homeID uint32, nodeID uint8, groupIDx uint8, targetNodeID uint8, ...)
- func AddDriver(controllerPath string) error
- func AddNode(homeID uint32, doSecurity bool) bool
- func AssignReturnRoute(homeID uint32, nodeID uint8) bool
- func CancelControllerCommand(homeID uint32)
- func ClearSwitchPoints(homeID uint32, valueID uint64)
- func CreateButton(homeID uint32, nodeID uint8, buttonID uint8) bool
- func CreateNewPrimary(homeID uint32) bool
- func DeleteAllReturnRoutes(homeID uint32, nodeID uint8) bool
- func DeleteButton(homeID uint32, nodeID uint8, buttonID uint8) bool
- func DestroyOptions() bool
- func DisablePoll(homeID uint32, valueID uint64) bool
- func EnablePoll(homeID uint32, valueID uint64, intensity uint8) bool
- func GetChangeVerified(homeID uint32, valueID uint64) bool
- func GetControllerNodeID(homeID uint32) uint8
- func GetControllerPath(homeID uint32) string
- func GetGroupLabel(homeID uint32, nodeID uint8, groupIDx uint8) string
- func GetLibraryTypeName(homeID uint32) string
- func GetLibraryVersion(homeID uint32) string
- func GetMaxAssociations(homeID uint32, nodeID uint8, groupIDx uint8) uint8
- func GetNodeBasicType(homeID uint32, nodeID uint8) uint8
- func GetNodeClassInformation(homeID uint32, nodeID uint8, commandClassID uint8) (bool, string, uint8)
- func GetNodeDeviceType(homeID uint32, nodeID uint8) uint16
- func GetNodeDeviceTypeString(homeID uint32, nodeID uint8) string
- func GetNodeGenericType(homeID uint32, nodeID uint8) uint8
- func GetNodeLocation(homeID uint32, nodeID uint8) string
- func GetNodeManufacturerID(homeID uint32, nodeID uint8) string
- func GetNodeManufacturerName(homeID uint32, nodeID uint8) string
- func GetNodeMaxBaudRate(homeID uint32, nodeID uint8) uint32
- func GetNodeName(homeID uint32, nodeID uint8) string
- func GetNodePlusType(homeID uint32, nodeID uint8) uint8
- func GetNodePlusTypeString(homeID uint32, nodeID uint8) string
- func GetNodeProductID(homeID uint32, nodeID uint8) string
- func GetNodeProductName(homeID uint32, nodeID uint8) string
- func GetNodeProductType(homeID uint32, nodeID uint8) string
- func GetNodeQueryStage(homeID uint32, nodeID uint8) string
- func GetNodeRole(homeID uint32, nodeID uint8) uint8
- func GetNodeRoleString(homeID uint32, nodeID uint8) string
- func GetNodeSecurity(homeID uint32, nodeID uint8) uint8
- func GetNodeSpecificType(homeID uint32, nodeID uint8) uint8
- func GetNodeType(homeID uint32, nodeID uint8) string
- func GetNodeVersion(homeID uint32, nodeID uint8) uint8
- func GetNumGroups(homeID uint32, nodeID uint8) uint8
- func GetNumSwitchPoints(homeID uint32, valueID uint64) (uint8, error)
- func GetPollIntensity(homeID uint32, valueID uint64) uint8
- func GetPollInterval() int32
- func GetSUCNodeID(homeID uint32) uint8
- func GetSendQueueCount(homeID uint32) int32
- func GetSwitchPoint(homeID uint32, valueID uint64, idx uint8) (uint8, uint8, int8, error)
- func GetValueAsBool(homeID uint32, valueID uint64) (bool, error)
- func GetValueAsByte(homeID uint32, valueID uint64) (byte, error)
- func GetValueAsFloat(homeID uint32, valueID uint64) (float32, error)
- func GetValueAsInt(homeID uint32, valueID uint64) (int32, error)
- func GetValueAsRaw(homeID uint32, valueID uint64) ([]byte, error)
- func GetValueAsShort(homeID uint32, valueID uint64) (int16, error)
- func GetValueAsString(homeID uint32, valueID uint64) string
- func GetValueFloatPrecision(homeID uint32, valueID uint64) (uint8, error)
- func GetValueHelp(homeID uint32, valueID uint64) string
- func GetValueLabel(homeID uint32, valueID uint64) string
- func GetValueListItems(homeID uint32, valueID uint64) ([]string, error)
- func GetValueListSelectionAsInt32(homeID uint32, valueID uint64) (int32, error)
- func GetValueListSelectionAsString(homeID uint32, valueID uint64) (string, error)
- func GetValueMax(homeID uint32, valueID uint64) int32
- func GetValueMin(homeID uint32, valueID uint64) int32
- func GetValueUnits(homeID uint32, valueID uint64) string
- func GetVersionAsString() string
- func GetVersionLongAsString() string
- func HasNodeFailed(homeID uint32, nodeID uint8) bool
- func HealNetwork(homeID uint32, doRR bool)
- func HealNetworkNode(homeID uint32, nodeID uint8, doRR bool)
- func IsBridgeController(homeID uint32) bool
- func IsNodeAwake(homeID uint32, nodeID uint8) bool
- func IsNodeBeamingDevice(homeID uint32, nodeID uint8) bool
- func IsNodeFailed(homeID uint32, nodeID uint8) bool
- func IsNodeFrequentListeningDevice(homeID uint32, nodeID uint8) bool
- func IsNodeInfoReceived(homeID uint32, nodeID uint8) bool
- func IsNodeListeningDevice(homeID uint32, nodeID uint8) bool
- func IsNodeRoutingDevice(homeID uint32, nodeID uint8) bool
- func IsNodeSecurityDevice(homeID uint32, nodeID uint8) bool
- func IsNodeZWavePlus(homeID uint32, nodeID uint8) bool
- func IsPolled(homeID uint32, valueID uint64) bool
- func IsPrimaryController(homeID uint32) bool
- func IsStaticUpdateController(homeID uint32) bool
- func IsValuePolled(homeID uint32, valueID uint64) bool
- func IsValueReadOnly(homeID uint32, valueID uint64) bool
- func IsValueSet(homeID uint32, valueID uint64) bool
- func IsValueWriteOnly(homeID uint32, valueID uint64) bool
- func LogDriverStatistics(homeID uint32)
- func PressButton(homeID uint32, valueID uint64) error
- func ReceiveConfiguration(homeID uint32) bool
- func RefreshNodeInfo(homeID uint32, nodeID uint8) bool
- func RefreshValue(homeID uint32, valueID uint64) bool
- func ReleaseButton(homeID uint32, valueID uint64) error
- func RemoveAssociation(homeID uint32, nodeID uint8, groupIDx uint8, targetNodeID uint8, ...)
- func RemoveDriver(controllerPath string) error
- func RemoveFailedNode(homeID uint32, nodeID uint8) bool
- func RemoveNode(homeID uint32) bool
- func RemoveSwitchPoint(homeID uint32, valueID uint64, hours, minutes uint8) error
- func ReplaceFailedNode(homeID uint32, nodeID uint8) bool
- func ReplicationSend(homeID uint32, nodeID uint8) bool
- func RequestNetworkUpdate(homeID uint32, nodeID uint8) bool
- func RequestNodeAllConfigParam(homeID uint32, nodeID uint8)
- func RequestNodeConfigParam(homeID uint32, nodeID uint8, param uint8)
- func RequestNodeDynamic(homeID uint32, nodeID uint8) bool
- func RequestNodeNeighborUpdate(homeID uint32, nodeID uint8) bool
- func RequestNodeState(homeID uint32, nodeID uint8) bool
- func ResetController(homeID uint32)
- func SendNodeInformation(homeID uint32, nodeID uint8) bool
- func SetChangeVerified(homeID uint32, valueID uint64, verify bool)
- func SetNodeConfigParam(homeID uint32, nodeID uint8, param uint8, value int32, size uint8) bool
- func SetNodeLevel(homeID uint32, nodeID uint8, level uint8)
- func SetNodeLocation(homeID uint32, nodeID uint8, location string)
- func SetNodeManufacturerName(homeID uint32, nodeID uint8, manufacturerName string)
- func SetNodeName(homeID uint32, nodeID uint8, nodeName string)
- func SetNodeOff(homeID uint32, nodeID uint8)
- func SetNodeOn(homeID uint32, nodeID uint8)
- func SetNodeProductName(homeID uint32, nodeID uint8, productName string)
- func SetPollIntensity(homeID uint32, valueID uint64, intensity uint8)
- func SetPollInterval(milliseconds int32, intervalBetweenPolls bool)
- func SetSwitchPoint(homeID uint32, valueID uint64, hours, minutes uint8, setback int8) error
- func SetValueBool(homeID uint32, valueID uint64, value bool) error
- func SetValueBytes(homeID uint32, valueID uint64, value []byte) error
- func SetValueFloat(homeID uint32, valueID uint64, value float32) error
- func SetValueHelp(homeID uint32, valueID uint64, value string)
- func SetValueInt16(homeID uint32, valueID uint64, value int16) error
- func SetValueInt32(homeID uint32, valueID uint64, value int32) error
- func SetValueLabel(homeID uint32, valueID uint64, value string)
- func SetValueListSelection(homeID uint32, valueID uint64, selection string) error
- func SetValueString(homeID uint32, valueID uint64, value string) error
- func SetValueUint8(homeID uint32, valueID uint64, value uint8) error
- func SetValueUnits(homeID uint32, valueID uint64, value string)
- func SoftReset(homeID uint32)
- func Start(handler NotificationHandler) error
- func Stop() error
- func TestNetwork(homeID uint32, count uint32)
- func TestNetworkNode(homeID uint32, nodeID uint8, count uint32)
- func TransferPrimaryRole(homeID uint32) bool
- type LogLevel
- type Node
- func (n *Node) GetBasicType() uint8
- func (n *Node) GetClassInformation(commandClassID uint8) (bool, string, uint8)
- func (n *Node) GetDeviceType() uint16
- func (n *Node) GetDeviceTypeString() string
- func (n *Node) GetGenericType() uint8
- func (n *Node) GetLocation() string
- func (n *Node) GetManufacturerID() string
- func (n *Node) GetManufacturerName() string
- func (n *Node) GetMaxBaudRate() uint32
- func (n *Node) GetName() string
- func (n *Node) GetPlusType() uint8
- func (n *Node) GetPlusTypeString() string
- func (n *Node) GetProductID() string
- func (n *Node) GetProductName() string
- func (n *Node) GetProductType() string
- func (n *Node) GetQueryStage() string
- func (n *Node) GetRole() uint8
- func (n *Node) GetRoleString() string
- func (n *Node) GetSecurity() uint8
- func (n *Node) GetSpecificType() uint8
- func (n *Node) GetType() string
- func (n *Node) GetVersion() uint8
- func (n *Node) IsAwake() bool
- func (n *Node) IsBeamingDevice() bool
- func (n *Node) IsFailed() bool
- func (n *Node) IsFrequentListeningDevice() bool
- func (n *Node) IsInfoReceived() bool
- func (n *Node) IsListeningDevice() bool
- func (n *Node) IsRoutingDevice() bool
- func (n *Node) IsSecurityDevice() bool
- func (n *Node) IsZWavePlus() bool
- func (n *Node) RefeshInfo() bool
- func (n *Node) RequestDynamic() bool
- func (n *Node) RequestState() bool
- func (n *Node) SetLevel(level uint8)
- func (n *Node) SetLocation(location string)
- func (n *Node) SetManufacturerName(name string)
- func (n *Node) SetName(name string)
- func (n *Node) SetOff()
- func (n *Node) SetOn()
- func (n *Node) SetProductName(name string)
- func (n *Node) String() string
- type Notification
- type NotificationCode
- type NotificationHandler
- type NotificationType
- type Options
- func (o *Options) AddOptionBool(name string, value bool) bool
- func (o *Options) AddOptionInt(name string, value int32) bool
- func (o *Options) AddOptionLogLevel(name string, value LogLevel) bool
- func (o *Options) AddOptionString(name string, value string, append bool) bool
- func (o *Options) AreLocked() bool
- func (o *Options) GetOptionAsBool(name string) (bool, bool)
- func (o *Options) GetOptionAsInt(name string) (bool, int32)
- func (o *Options) GetOptionAsString(name string) (bool, string)
- func (o *Options) Lock() bool
- type ValueID
- func (v *ValueID) DisablePoll() bool
- func (v *ValueID) EnablePoll(intensity uint8) bool
- func (v *ValueID) GetAsBool() (bool, error)
- func (v *ValueID) GetAsByte() (byte, error)
- func (v *ValueID) GetAsFloat() (float32, error)
- func (v *ValueID) GetAsInt() (int32, error)
- func (v *ValueID) GetAsRaw() ([]byte, error)
- func (v *ValueID) GetAsShort() (int16, error)
- func (v *ValueID) GetAsString() string
- func (v *ValueID) GetChangeVerified() bool
- func (v *ValueID) GetFloatPrecision() (uint8, error)
- func (v *ValueID) GetHelp() string
- func (v *ValueID) GetLabel() string
- func (v *ValueID) GetListItems() ([]string, error)
- func (v *ValueID) GetListSelectionAsInt32() (int32, error)
- func (v *ValueID) GetListSelectionAsString() (string, error)
- func (v *ValueID) GetMax() int32
- func (v *ValueID) GetMin() int32
- func (v *ValueID) GetPollIntensity() uint8
- func (v *ValueID) GetUnits() string
- func (v *ValueID) IDString() string
- func (v *ValueID) IsPolled() bool
- func (v *ValueID) IsReadOnly() bool
- func (v *ValueID) IsSet() bool
- func (v *ValueID) IsWriteOnly() bool
- func (v *ValueID) PressButton() error
- func (v *ValueID) Refresh() bool
- func (v *ValueID) ReleaseButton() error
- func (v *ValueID) SetBool(value bool) error
- func (v *ValueID) SetBytes(value []byte) error
- func (v *ValueID) SetChangeVerified(verify bool)
- func (v *ValueID) SetFloat(value float32) error
- func (v *ValueID) SetHelp(help string)
- func (v *ValueID) SetInt16(value int16) error
- func (v *ValueID) SetInt32(value int32) error
- func (v *ValueID) SetLabel(label string)
- func (v *ValueID) SetListSelection(selectedItem string) error
- func (v *ValueID) SetPollIntensity(intensity uint8)
- func (v *ValueID) SetString(value string) error
- func (v *ValueID) SetUint8(value uint8) error
- func (v *ValueID) SetUnits(units string)
- func (v *ValueID) String() string
- func (v *ValueID) StringFull() string
- type ValueIDGenre
- type ValueIDType
- type Version
Constants ¶
const ( LogLevelInvalid = LogLevel(C.loglevel_invalid) LogLevelNone = LogLevel(C.loglevel_none) LogLevelAlways = LogLevel(C.loglevel_always) LogLevelFatal = LogLevel(C.loglevel_fatal) LogLevelError = LogLevel(C.loglevel_error) LogLevelWarning = LogLevel(C.loglevel_warning) LogLevelAlert = LogLevel(C.loglevel_alert) LogLevelInfo = LogLevel(C.loglevel_info) LogLevelDetail = LogLevel(C.loglevel_detail) LogLevelDebug = LogLevel(C.loglevel_debug) LogLevelStreamdetail = LogLevel(C.loglevel_streamdetail) LogLevelInternal = LogLevel(C.loglevel_internal) )
Variables ¶
This section is empty.
Functions ¶
func AddAssociation ¶
func AddAssociation(homeID uint32, nodeID uint8, groupIDx uint8, targetNodeID uint8, instance uint8)
AddAssociation adds a node to an association group.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the association data held in this class is updated directly. This will be reverted by a future Association message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func AddDriver ¶
AddDriver creates a new driver for a Z-Wave controller using the path specified (e.g. "/dev/ttyUSB0"). It returns an error if the controller already exists.
This method creates a Driver object for handling communications with a single Z-Wave controller. In the background, the driver first tries to read configuration data saved during a previous run. It then queries the controller directly for any missing information, and a refresh of the list of nodes that it controls. Once this information has been received, a DriverReady notification callback is sent, containing the Home ID of the controller. This Home ID is required by most of the OpenZWave Manager class methods.
func AddNode ¶
AddNode starts the Inclusion Process to add a Node to the Network. It will return true if the command was sent to the controller successfully.
The Status of the Node Inclusion is communicated via Notifications. Specifically, you should monitor ControllerCommand Notifications.
func AssignReturnRoute ¶
AssignReturnRoute will ask a Node to update its update its Return Route to the Controller. It will return true if the command was sent to the controller successfully.
func CancelControllerCommand ¶
func CancelControllerCommand(homeID uint32)
CancelControllerCommand cancels any in-progress command running on a controller.
func ClearSwitchPoints ¶
ClearSwitchPoints clears all switch points from the schedule.
func CreateButton ¶
CreateButton create a handheld button id. It will return true if the command was sent to the controller successfully.
func CreateNewPrimary ¶
CreateNewPrimary will create a new primary controller when old primary fails. Requires SUC. It will return true if the command was sent to the controller successfully.
This command Creates a new Primary Controller when the Old Primary has Failed.
Requires a SUC on the network to function.
func DeleteAllReturnRoutes ¶
DeleteAllReturnRoutes will ask a Node to delete all Return Routes. It will return true if the command was sent to the controller successfully.
This command will ask a Node to delete all its return routes, and will rediscover when needed.
func DeleteButton ¶
DeleteButton deletes a handheld button id. It will return true if the command was sent to the controller successfully.
func DestroyOptions ¶
func DestroyOptions() bool
DestroyOptions deletes the Options and cleans up any associated objects. The application is responsible for destroying the Options object, but this must not be done until after the Manager object has been destroyed.
func DisablePoll ¶
DisablePoll disables the polling of a device's state. Returns true if polling was disabled.
func EnablePoll ¶
EnablePoll enables the polling of a device's state. Returns true if polling was enabled.
func GetChangeVerified ¶
GetChangeVerified returns true if value changes upon a refresh should be verified. If so, the library will immediately refresh the value a second time whenever a change is observed. This helps to filter out spurious data reported occasionally by some devices.
func GetControllerNodeID ¶
GetControllerNodeID returns the node ID of the Z-Wave controller.
func GetControllerPath ¶
GetControllerPath returns a string of the controller interface path.
func GetGroupLabel ¶
GetGroupLabel returns a label for the particular group of a node. This label is populated by the device specific configuration files.
func GetLibraryTypeName ¶
GetLibraryTypeName returns a string containing the Z-Wave API library type used by a controller.
The possible library types are: - Static Controller - Controller - Enhanced Slave - Slave - Installer - Routing Slave - Bridge Controller - Device Under Test
The controller should never return a slave library type. For a more efficient test of whether a controller is a Bridge Controller, use the IsBridgeController method.
func GetLibraryVersion ¶
GetLibraryVersion returns a string version of the Z-Wave API library used by a controller.
func GetMaxAssociations ¶
GetMaxAssociations returns the maximum number of associations for a group.
func GetNodeBasicType ¶
GetNodeBasicType returns the basic type of a node.
func GetNodeClassInformation ¶
func GetNodeClassInformation(homeID uint32, nodeID uint8, commandClassID uint8) (bool, string, uint8)
GetNodeClassInformation returns true if the node has the defined class available or not, and the class name and version if available.
func GetNodeDeviceType ¶
GetNodeDeviceType returns the node device type as reported in the Z-Wave+ Info report.
func GetNodeDeviceTypeString ¶
GetNodeDeviceTypeString returns a string of the node device type as reported in the Z-Wave+ Info report.
func GetNodeGenericType ¶
GetNodeGenericType returns the generic type of a node.
func GetNodeLocation ¶
GetNodeLocation returns the location of a node.
The node location is a user-editable string that would normally be handled by the Node Naming commmand class, but many devices do not support it. So that a node can always report its location, OpenZWave stores it with the node data, and provides access through this method and SetNodeLocation, rather than reporting it via a command class Value object.
func GetNodeManufacturerID ¶
GetNodeManufacturerID returns the manufacturer ID of a device.
The manufacturer ID is a four digit hex code and would normally be handled by the Manufacturer Specific commmand class, but not all devices support it. Although the value reported by this method will be an empty string if the command class is not supported and cannot be set by the user, the manufacturer ID is still stored with the node data (rather than being reported via a command class Value object) to retain a consistent approach with the other manufacturer specific data.
func GetNodeManufacturerName ¶
GetNodeManufacturerName returns the manufacturer name of a device.
The manufacturer name would normally be handled by the Manufacturer Specific commmand class, taking the manufacturer ID reported by the device and using it to look up the name from the manufacturer_specific.xml file in the OpenZWave config folder. However, there are some devices that do not support the command class, so to enable the user to manually set the name, it is stored with the node data and accessed via this method rather than being reported via a command class Value object.
func GetNodeMaxBaudRate ¶
GetNodeMaxBaudRate returns the maximum baud rate of a node's communications.
func GetNodeName ¶
GetNodeName returns the name of a node.
The node name is a user-editable label for the node that would normally be handled by the Node Naming commmand class, but many devices do not support it. So that a node can always be named, OpenZWave stores it with the node data, and provides access through this method and SetNodeName, rather than reporting it via a command class Value object. The maximum length of a node name is 16 characters.
func GetNodePlusType ¶
GetNodePlusType returns the node PlusType as reported in the Z-Wave+ Info report.
func GetNodePlusTypeString ¶
GetNodePlusTypeString returns a string of the node PlusType as reported in the Z-Wave+ Info report.
func GetNodeProductID ¶
GetNodeProductID returns the product ID of a device.
The product ID is a four digit hex code and would normally be handled by the Manufacturer Specific commmand class, but not all devices support it. Although the value reported by this method will be an empty string if the command class is not supported and cannot be set by the user, the product ID is still stored with the node data (rather than being reported via a command class Value object) to retain a consistent approach with the other manufacturer specific data.
func GetNodeProductName ¶
GetNodeProductName returns the product name of a device.
The product name would normally be handled by the Manufacturer Specific commmand class, taking the product Type and ID reported by the device and using it to look up the name from the manufacturer_specific.xml file in the OpenZWave config folder. However, there are some devices that do not support the command class, so to enable the user to manually set the name, it is stored with the node data and accessed via this method rather than being reported via a command class Value object.
func GetNodeProductType ¶
GetNodeProductType returns the product type of a device.
The product type is a four digit hex code and would normally be handled by the Manufacturer Specific commmand class, but not all devices support it. Although the value reported by this method will be an empty string if the command class is not supported and cannot be set by the user, the product type is still stored with the node data (rather than being reported via a command class Value object) to retain a consistent approach with the other manufacturer specific data.
func GetNodeQueryStage ¶
GetNodeQueryStage returns the node's query stage as a string.
func GetNodeRole ¶
GetNodeRole returns the node role as reported in the Z-Wave+ Info report.
func GetNodeRoleString ¶
GetNodeRoleString returns a string of the node role as reported in the Z-Wave+ Info report.
func GetNodeSecurity ¶
GetNodeSecurity returns the security byte of a node.
func GetNodeSpecificType ¶
GetNodeSpecificType returns the specific type of a node.
func GetNodeType ¶
GetNodeType returns a human-readable label describing the node.
The label is taken from the Z-Wave specific, generic or basic type, depending on which of those values are specified by the node.
func GetNodeVersion ¶
GetNodeVersion returns the version number of a node.
func GetNumGroups ¶
GetNumGroups returns the number of association groups reported by this node.
In Z-Wave, groups are numbered starting from one. For example, if a call to GetNumGroups returns 4, the _groupIdx value to use in calls to GetAssociations, AddAssociation and RemoveAssociation will be a number between 1 and 4.
func GetNumSwitchPoints ¶
GetNumSwitchPoints returns the number of switch points defined in a schedule. It will return zero if the value if not of schedule type.
func GetPollIntensity ¶
GetPollIntensity returns the polling intensity of a device's state.
func GetPollInterval ¶
func GetPollInterval() int32
GetPollInterval returns the time period between polls of a node's state.
func GetSUCNodeID ¶
GetSUCNodeID returns the node ID of the Static Update Controller.
func GetSendQueueCount ¶
GetSendQueueCount returns the count of messages in the outgoing send queue.
func GetSwitchPoint ¶
GetSwitchPoint returns switch point data from the schedule. It will also return an error if the value is not of schedule type.
It retrieves the time and setback values from a switch point in the schedule.
func GetValueAsBool ¶
GetValueAsBool returns the value as a bool. It will also return an error if the value is not a bool type.
func GetValueAsByte ¶
GetValueAsByte returns the value as an 8-bit unsigned integer. It will also return an error if the value is not of byte type.
func GetValueAsFloat ¶
GetValueAsFloat returns the value as a float. It will also return an error if the value is not a decimal type.
func GetValueAsInt ¶
GetValueAsInt returns the value as a 32-bit signed integer. It will also return an error if the value is not of 32-bit signed integer type.
func GetValueAsRaw ¶
GetValueAsRaw returns the value as a raw byte slice. It will also return an error if the value is not of raw type.
func GetValueAsShort ¶
GetValueAsShort returns the value as a 16-bit signed integer. It will also return an error if the value is not of 16-bit signed integer type.
func GetValueAsString ¶
GetValueAsString returns the value as a string, regardless of its actual type.
func GetValueFloatPrecision ¶
GetValueFloatPrecision returns the float value's precision. It will also return an error if the value is not of decimal type.
func GetValueHelp ¶
GetValueHelp returns a help string describing the value's purpose and usage.
func GetValueLabel ¶
GetValueLabel returns the user-friendly label for the value.
func GetValueListItems ¶
GetValueListItems returns the list of items from a list value. It will also return an error if the value is not of list type.
func GetValueListSelectionAsInt32 ¶
GetValueListSelectionAsInt32 returns selected item from a list as an integer. It will also return an error if the value is not of list type.
func GetValueListSelectionAsString ¶
GetValueListSelectionAsString returns selected item from a list as a string. It will also return an error if the value is not of list type.
func GetValueMax ¶
GetValueMax returns the maximum that this value may contain.
func GetValueMin ¶
GetValueMin returns the minimum that this value may contain.
func GetValueUnits ¶
GetValueUnits returns the units that the value is measured in.
func GetVersionAsString ¶
func GetVersionAsString() string
GetVersionAsString returns the Version Number of OZW as a string.
func GetVersionLongAsString ¶
func GetVersionLongAsString() string
GetVersionLongAsString returns the Version Number including Git commit of OZW as a string.
func HasNodeFailed ¶
HasNodeFailed checks if the Controller Believes a Node has Failed. The result is then communicated via a Notification. It will return true if the command was sent to the controller successfully.
This is different from the IsNodeFailed call in that we test the Controllers Failed Node List, whereas the IsNodeFailed is testing our list of Failed Nodes, which might be different. The Results will be communicated via Notifications. Specifically, you should monitor the ControllerCommand notifications.
func HealNetwork ¶
HealNetwork heals a network by requesting node's rediscover their neighbors.
Sends a ControllerCommand_RequestNodeNeighborUpdate to every node. Can take a while on larger networks.
func HealNetworkNode ¶
HealNetworkNode heals a network node by requesting that the node rediscovers their neighbors.
Sends a ControllerCommand_RequestNodeNeighborUpdate to the node.
func IsBridgeController ¶
IsBridgeController returns true if the controller is using the bridge controller library.
A bridge controller is able to create virtual nodes that can be associated with other controllers to enable events to be passed on.
func IsNodeAwake ¶
IsNodeAwake returns true if the node is awake, otherwise false if it is asleep.
func IsNodeBeamingDevice ¶
IsNodeBeamingDevice returns true if the node is a beam capable device.
func IsNodeFailed ¶
IsNodeFailed returns true if the node is working, otherwise false if it has failed.
func IsNodeFrequentListeningDevice ¶
IsNodeFrequentListeningDevice returns true if the node is a frequent listening device that goes to sleep but can be woken up by a beam. Useful to determine node and controller consistency.
func IsNodeInfoReceived ¶
IsNodeInfoReceived returns whether the node information has been received.
func IsNodeListeningDevice ¶
IsNodeListeningDevice returns true if the node is a listening device that does not go to sleep.
func IsNodeRoutingDevice ¶
IsNodeRoutingDevice returns true if the node is a routing device that passes messages to other nodes.
func IsNodeSecurityDevice ¶
IsNodeSecurityDevice returns true if the node supports security features.
func IsNodeZWavePlus ¶
IsNodeZWavePlus returns true if this a ZWave+ Supported Node.
func IsPrimaryController ¶
IsPrimaryController returns true if the controller is a primary controller.
The primary controller is the main device used to configure and control a Z-Wave network. There can only be one primary controller - all other controllers are secondary controllers.
func IsStaticUpdateController ¶
IsStaticUpdateController returns true if the controller is a static update controller.
A Static Update Controller (SUC) is a controller that must never be moved in normal operation and which can be used by other nodes to receive information about network changes.
func IsValuePolled ¶
IsValuePolled returns true if the value is currently being polled.
func IsValueReadOnly ¶
IsValueReadOnly returns true if the value is read-only.
func IsValueSet ¶
IsValueSet returns true if the value has been set.
func IsValueWriteOnly ¶
IsValueWriteOnly returns true if the value is write-only.
func LogDriverStatistics ¶
func LogDriverStatistics(homeID uint32)
LogDriverStatistics will send the current driver statistics to the log file.
func PressButton ¶
PressButton starts an activity in a device. It will return an error if the value is not of button type.
Since buttons are write-only values that do not report a state, no notification callbacks are sent.
func ReceiveConfiguration ¶
ReceiveConfiguration will receive network configuration information from the primary controller. Requires secondary. This command prepares the controller to recieve Network Configuration from a Secondary Controller. It will return true if the command was sent to the controller successfully.
func RefreshNodeInfo ¶
RefreshNodeInfo triggers the fetching of fixed data about a node. Returns true if the request was sent successfully.
Causes the node's data to be obtained from the Z-Wave network in the same way as if it had just been added. This method would normally be called automatically by OpenZWave, but if you know that a node has been changed, calling this method will force a refresh of all of the data held by the library. This can be especially useful for devices that were asleep when the application was first run. This is the same as the query state starting from the beginning.
func RefreshValue ¶
RefreshValue refreshes the specified value from the Z-Wave network. It will return true if the driver and node were found, otherwise false.
A call to this function causes the library to send a message to the network to retrieve the current value of the specified ValueID (just like a poll, except only one-time, not recurring).
func ReleaseButton ¶
ReleaseButton stops an activity in a device. It will return an error if the value is not of button type.
Since buttons are write-only values that do not report a state, no notification callbacks are sent.
func RemoveAssociation ¶
func RemoveAssociation(homeID uint32, nodeID uint8, groupIDx uint8, targetNodeID uint8, instance uint8)
RemoveAssociation removes a node from an association group.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the association data held in this class is updated directly. This will be reverted by a future Association message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func RemoveDriver ¶
RemoveDriver removes the driver for a Z-Wave controller as specified, and closes the controller. It returns an error if the controller could not be found.
Drivers do not need to be explicitly removed before calling Destroy - this is handled automatically.
func RemoveFailedNode ¶
RemoveFailedNode removes a Failed Device from the Z-Wave Network. It will return true if the command was sent to the controller successfully.
This Command will remove a failed node from the network. The Node should be on the Controllers Failed Node List, otherwise this command will fail. You can use the HasNodeFailed function below to test if the Controller believes the Node has Failed. The Status of the Node Removal is communicated via Notifications. Specifically, you should monitor ControllerCommand Notifications.
func RemoveNode ¶
RemoveNode removes a Device from the Z-Wave Network. It will return true if the command was sent to the controller successfully.
The Status of the Node Removal is communicated via Notifications. Specifically, you should monitor ControllerCommand Notifications.
func RemoveSwitchPoint ¶
RemoveSwitchPoint removes a switch point from the schedule. It will return an error if the value is not of schedule type or there is no switch point with the specified time values.
func ReplaceFailedNode ¶
ReplaceFailedNode will replace a failed device with another. If the node is not in the controller's failed nodes list, or the node responds, this command will fail. You can check if a Node is in the Controllers Failed node list by using the HasNodeFailed method. It will return true if the command was sent to the controller successfully.
func ReplicationSend ¶
ReplicationSend sends information from primary to secondary. It will return true if the command was sent to the controller successfully.
func RequestNetworkUpdate ¶
RequestNetworkUpdate updates the controller with network information from the SUC/SIS. It will return true if the command was sent to the controller successfully.
func RequestNodeAllConfigParam ¶
RequestNodeAllConfigParam requests the values of all known configurable parameters from a device.
func RequestNodeConfigParam ¶
RequestNodeConfigParam requests the value of a configurable parameter from a device.
Some devices have various parameters that can be configured to control the device behaviour. These are not reported by the device over the Z-Wave network, but can usually be found in the device's user manual. This method requests the value of a parameter from the device, and then returns immediately, without waiting for a response. If the parameter index is valid for this device, and the device is awake, the value will eventually be reported via a ValueChanged notification callback. The ValueID reported in the callback will have an index set the same as _param and a command class set to the same value as returned by a call to Configuration::StaticGetCommandClassId.
func RequestNodeDynamic ¶
RequestNodeDynamic triggers the fetching of just the dynamic value data for a node. Returns true if the request was sent successfully.
Causes the node's values to be requested from the Z-Wave network. This is the same as the query state starting from the dynamic state.
func RequestNodeNeighborUpdate ¶
RequestNodeNeighborUpdate will ask a Node to update its Neighbor Tables. It will return true if the command was sent to the controller successfully.
This command will ask a Node to update its Neighbor Tables.
func RequestNodeState ¶
RequestNodeState triggers the fetching of dynamic value data for a node. Returns true if the request was sent successfully.
Causes the node's values to be requested from the Z-Wave network. This is the same as the query state starting from the associations state.
func ResetController ¶
func ResetController(homeID uint32)
ResetController performs a hard reset on a PC Z-Wave Controller.
Resets a controller and erases its network configuration settings. The controller becomes a primary controller ready to add devices to a new network.
func SendNodeInformation ¶
SendNodeInformation sends a NIF frame from the Controller to a Node. It will return true if the command was sent to the controller successfully.
This command send a NIF frame from the Controller to a Node.
func SetChangeVerified ¶
SetChangeVerified sets a flag indicating whether value changes noted upon a refresh should be verified. If so, the library will immediately refresh the value a second time whenever a change is observed. This helps to filter out spurious data reported occasionally by some devices.
func SetNodeConfigParam ¶
SetNodeConfigParam sets the value of a configurable parameter in a device. Returns true if the message setting was sent to the device.
Some devices have various parameters that can be configured to control the device behaviour. These are not reported by the device over the Z-Wave network, but can usually be found in the device's user manual. This method returns immediately, without waiting for confirmation from the device that the change has been made.
func SetNodeLevel ¶
SetNodeLevel sets the basic level of a node.
This is a helper method to simplify basic control of a node. It is the equivalent of changing the value reported by the node's Basic command class and will generate a ValueChanged notification from that class.
func SetNodeLocation ¶
SetNodeLocation sets the location of a node.
The node location is a user-editable string that would normally be handled by the Node Naming commmand class, but many devices do not support it. So that a node can always report its location, OpenZWave stores it with the node data, and provides access through this method and GetNodeLocation, rather than reporting it via a command class Value object. If the device does support the Node Naming command class, the new location will be sent to the node.
func SetNodeManufacturerName ¶
SetNodeManufacturerName sets the manufacturer name of a device.
The manufacturer name would normally be handled by the Manufacturer Specific commmand class, taking the manufacturer ID reported by the device and using it to look up the name from the manufacturer_specific.xml file in the OpenZWave config folder. However, there are some devices that do not support the command class, so to enable the user to manually set the name, it is stored with the node data and accessed via this method rather than being reported via a command class Value object.
func SetNodeName ¶
SetNodeName sets the name of a node.
The node name is a user-editable label for the node that would normally be handled by the Node Naming commmand class, but many devices do not support it. So that a node can always be named, OpenZWave stores it with the node data, and provides access through this method and GetNodeName, rather than reporting it via a command class Value object. If the device does support the Node Naming command class, the new name will be sent to the node. The maximum length of a node name is 16 characters.
func SetNodeOff ¶
SetNodeOff turns a node off.
This is a helper method to simplify basic control of a node. It is the equivalent of changing the level reported by the node's Basic command class to zero, and will generate a ValueChanged notification from that class.
func SetNodeOn ¶
SetNodeOn turns a node on.
This is a helper method to simplify basic control of a node. It is the equivalent of changing the level reported by the node's Basic command class to 255, and will generate a ValueChanged notification from that class. This command will turn on the device at its last known level, if supported by the device, otherwise it will turn it on at 100%.
func SetNodeProductName ¶
SetNodeProductName sets the product name of a device.
The product name would normally be handled by the Manufacturer Specific commmand class, taking the product Type and ID reported by the device and using it to look up the name from the manufacturer_specific.xml file in the OpenZWave config folder. However, there are some devices that do not support the command class, so to enable the user to manually set the name, it is stored with the node data and accessed via this method rather than being reported via a command class Value object.
func SetPollIntensity ¶
SetPollIntensity sets the frequency of polling.
- 0 = none
- 1 = every time through the list
- 2 = every other time
- etc.
func SetPollInterval ¶
SetPollInterval will set the time period between polls of a node's state.
Due to patent concerns, some devices do not report state changes automatically to the controller. These devices need to have their state polled at regular intervals. The length of the interval is the same for all devices. To even out the Z-Wave network traffic generated by polling, OpenZWave divides the polling interval by the number of devices that have polling enabled, and polls each in turn. It is recommended that if possible, the interval should not be set shorter than the number of polled devices in seconds (so that the network does not have to cope with more than one poll per second).
func SetSwitchPoint ¶
SetSwitchPoint sets a switch point in the schedule. It will return an error if the value is not of schedule type.
Inserts a new switch point into the schedule, unless a switch point already exists at the specified time in which case that switch point is updated with the new setback value instead. A maximum of nine switch points can be set in the schedule.
func SetValueBool ¶
SetValueBool sets the state of a bool. It will return an error if the value is not of bool type.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func SetValueBytes ¶
SetValueBytes sets the value of a raw value. It will return an error if the value is not of raw type.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func SetValueFloat ¶
SetValueFloat sets the value of a decimal. It will return an error if the value is not of decimal type.
It is usually better to handle decimal values using strings rather than floats, to avoid floating point accuracy issues. Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func SetValueHelp ¶
SetValueHelp sets a help string describing the value's purpose and usage.
func SetValueInt16 ¶
SetValueInt16 sets the value of a 16-bit signed integer. It will return an error if the value is not of 16-bit signed integer type.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func SetValueInt32 ¶
SetValueInt32 sets the value of a 32-bit signed integer. It will return an error if the value is not of 32-bit signed integer type.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func SetValueLabel ¶
SetValueLabel sets the user-friendly label for the value.
func SetValueListSelection ¶
SetValueListSelection sets the selected item in a list. It will return an error if the value is not of list type or if the selection is not in the list.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func SetValueString ¶
SetValueString sets the value from a string, regardless of type. It will return an error if the value could not be parsed into the correct type for the value.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func SetValueUint8 ¶
SetValueUint8 sets the value of a byte. It will return an error if the value is not of byte type.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func SetValueUnits ¶
SetValueUnits sets the units that the value is measured in.
func SoftReset ¶
func SoftReset(homeID uint32)
SoftReset performs a soft reset on a PC Z-Wave Controller.
Resets a controller without erasing its network configuration settings.
func Start ¶
func Start(handler NotificationHandler) error
Start will create a new OpenZWave Manager, starting the library execution. The OpenZWave Options must be created and locked before calling this. See the Options struct. Also pass a NotificationHandler function to this as notifications will also be started.
func Stop ¶
func Stop() error
Stop will stop notifications and destroy the manager. Do this just before you quit your app. Don't forget to destroy the Options object after calling this.
func TestNetwork ¶
TestNetwork tests the network.
Sends a series of messages to every node on the network for testing network reliability.
func TestNetworkNode ¶
TestNetworkNode tests the network node.
Sends a series of messages to a network node for testing network reliability.
func TransferPrimaryRole ¶
TransferPrimaryRole adds a new controller to the network and make it the primary. The existing primary will become a secondary controller. It will return true if the command was sent to the controller successfully.
Types ¶
type Node ¶
Node contains all necessary information for a Node from the OpenZWave library. Create a new Node by using the `NewNode` function with the HomeID and NodeID as supplied from a Notification.
func NewNode ¶
NewNode will create a new Node object filled with the data available from the Manager based on the homeID and nodeID.
func (*Node) GetBasicType ¶
GetBasicType Get the basic type of a node.
func (*Node) GetClassInformation ¶
GetClassInformation Get whether the node has the defined class available or not.
func (*Node) GetDeviceType ¶
GetDeviceType Get the node device type as reported in the Z-Wave+ Info report.
func (*Node) GetDeviceTypeString ¶
GetDeviceTypeString Get the node device type as reported in the Z-Wave+ Info report.
func (*Node) GetGenericType ¶
GetGenericType Get the generic type of a node.
func (*Node) GetLocation ¶
GetLocation Get the location of a node The node location is a user-editable string that would normally be handled by the Node Naming commmand class, but many devices do not support it. So that a node can always report its location, OpenZWave stores it with the node data, and provides access through this method and SetNodeLocation, rather than reporting it via a command class Value object.
func (*Node) GetManufacturerID ¶
GetManufacturerID Get the manufacturer ID of a device The manufacturer ID is a four digit hex code and would normally be handled by the Manufacturer Specific commmand class, but not all devices support it. Although the value reported by this method will be an empty string if the command class is not supported and cannot be set by the user, the manufacturer ID is still stored with the node data (rather than being reported via a command class Value object) to retain a consistent approach with the other manufacturer specific data.
func (*Node) GetManufacturerName ¶
GetManufacturerName Get the manufacturer name of a device The manufacturer name would normally be handled by the Manufacturer Specific commmand class, taking the manufacturer ID reported by the device and using it to look up the name from the manufacturer_specific.xml file in the OpenZWave config folder. However, there are some devices that do not support the command class, so to enable the user to manually set the name, it is stored with the node data and accessed via this method rather than being reported via a command class Value object.
func (*Node) GetMaxBaudRate ¶
GetMaxBaudRate Get the maximum baud rate of a node's communications.
func (*Node) GetName ¶
GetName Get the name of a node The node name is a user-editable label for the node that would normally be handled by the Node Naming commmand class, but many devices do not support it. So that a node can always be named, OpenZWave stores it with the node data, and provides access through this method and SetNodeName, rather than reporting it via a command class Value object. The maximum length of a node name is 16 characters.
func (*Node) GetPlusType ¶
GetPlusType Get the node PlusType as reported in the Z-Wave+ Info report.
func (*Node) GetPlusTypeString ¶
GetPlusTypeString Get the node PlusType as reported in the Z-Wave+ Info report.
func (*Node) GetProductID ¶
GetProductID Get the product ID of a device The product ID is a four digit hex code and would normally be handled by the Manufacturer Specific commmand class, but not all devices support it. Although the value reported by this method will be an empty string if the command class is not supported and cannot be set by the user, the product ID is still stored with the node data (rather than being reported via a command class Value object) to retain a consistent approach with the other manufacturer specific data.
func (*Node) GetProductName ¶
GetProductName Get the product name of a device The product name would normally be handled by the Manufacturer Specific commmand class, taking the product Type and ID reported by the device and using it to look up the name from the manufacturer_specific.xml file in the OpenZWave config folder. However, there are some devices that do not support the command class, so to enable the user to manually set the name, it is stored with the node data and accessed via this method rather than being reported via a command class Value object.
func (*Node) GetProductType ¶
GetProductType Get the product type of a device The product type is a four digit hex code and would normally be handled by the Manufacturer Specific commmand class, but not all devices support it. Although the value reported by this method will be an empty string if the command class is not supported and cannot be set by the user, the product type is still stored with the node data (rather than being reported via a command class Value object) to retain a consistent approach with the other manufacturer specific data.
func (*Node) GetQueryStage ¶
GetQueryStage Get whether the node's query stage as a string.
func (*Node) GetRoleString ¶
GetRoleString Get the node role as reported in the Z-Wave+ Info report.
func (*Node) GetSecurity ¶
GetSecurity Get the security byte of a node.
func (*Node) GetSpecificType ¶
GetSpecificType Get the specific type of a node.
func (*Node) GetType ¶
GetType Get a human-readable label describing the node The label is taken from the Z-Wave specific, generic or basic type, depending on which of those values are specified by the node.
func (*Node) GetVersion ¶
GetVersion Get the version number of a node.
func (*Node) IsBeamingDevice ¶
IsBeamingDevice Get whether the node is a beam capable device.
func (*Node) IsFrequentListeningDevice ¶
IsFrequentListeningDevice Get whether the node is a frequent listening device that goes to sleep but can be woken up by a beam. Useful to determine node and controller consistency.
func (*Node) IsInfoReceived ¶
IsInfoReceived Get whether the node information has been received.
func (*Node) IsListeningDevice ¶
IsListeningDevice Get whether the node is a listening device that does not go to sleep.
func (*Node) IsRoutingDevice ¶
IsRoutingDevice Get whether the node is a routing device that passes messages to other nodes.
func (*Node) IsSecurityDevice ¶
IsSecurityDevice Get the security attribute for a node. True if node supports security features.
func (*Node) IsZWavePlus ¶
IsZWavePlus Is this a ZWave+ Supported Node?
func (*Node) RefeshInfo ¶
RefeshInfo Trigger the fetching of fixed data about a node. Causes the node's data to be obtained from the Z-Wave network in the same way as if it had just been added. This method would normally be called automatically by OpenZWave, but if you know that a node has been changed, calling this method will force a refresh of all of the data held by the library. This can be especially useful for devices that were asleep when the application was first run. This is the same as the query state starting from the beginning.
func (*Node) RequestDynamic ¶
RequestDynamic Trigger the fetching of just the dynamic value data for a node. Causes the node's values to be requested from the Z-Wave network. This is the same as the query state starting from the dynamic state.
func (*Node) RequestState ¶
RequestState Trigger the fetching of dynamic value data for a node. Causes the node's values to be requested from the Z-Wave network. This is the same as the query state starting from the associations state.
func (*Node) SetLevel ¶
SetLevel Sets the basic level of a node This is a helper method to simplify basic control of a node. It is the equivalent of changing the value reported by the node's Basic command class and will generate a ValueChanged notification from that class.
func (*Node) SetLocation ¶
SetLocation Set the location of a node The node location is a user-editable string that would normally be handled by the Node Naming commmand class, but many devices do not support it. So that a node can always report its location, OpenZWave stores it with the node data, and provides access through this method and GetNodeLocation, rather than reporting it via a command class Value object. If the device does support the Node Naming command class, the new location will be sent to the node.
func (*Node) SetManufacturerName ¶
SetManufacturerName Set the manufacturer name of a device The manufacturer name would normally be handled by the Manufacturer Specific commmand class, taking the manufacturer ID reported by the device and using it to look up the name from the manufacturer_specific.xml file in the OpenZWave config folder. However, there are some devices that do not support the command class, so to enable the user to manually set the name, it is stored with the node data and accessed via this method rather than being reported via a command class Value object.
func (*Node) SetName ¶
SetName Set the name of a node The node name is a user-editable label for the node that would normally be handled by the Node Naming commmand class, but many devices do not support it. So that a node can always be named, OpenZWave stores it with the node data, and provides access through this method and GetNodeName, rather than reporting it via a command class Value object. If the device does support the Node Naming command class, the new name will be sent to the node. The maximum length of a node name is 16 characters.
func (*Node) SetOff ¶
func (n *Node) SetOff()
SetOff Turns a node off This is a helper method to simplify basic control of a node. It is the equivalent of changing the level reported by the node's Basic command class to zero, and will generate a ValueChanged notification from that class.
func (*Node) SetOn ¶
func (n *Node) SetOn()
SetOn Turns a node on This is a helper method to simplify basic control of a node. It is the equivalent of changing the level reported by the node's Basic command class to 255, and will generate a ValueChanged notification from that class. This command will turn on the device at its last known level, if supported by the device, otherwise it will turn it on at 100%.
func (*Node) SetProductName ¶
SetProductName Set the product name of a device The product name would normally be handled by the Manufacturer Specific commmand class, taking the product Type and ID reported by the device and using it to look up the name from the manufacturer_specific.xml file in the OpenZWave config folder. However, there are some devices that do not support the command class, so to enable the user to manually set the name, it is stored with the node data and accessed via this method rather than being reported via a command class Value object.
type Notification ¶
type Notification struct { Type NotificationType HomeID uint32 NodeID uint8 ValueID *ValueID GroupIDX *uint8 Event *uint8 ButtonID *uint8 SceneID *uint8 Notification *NotificationCode }
Notification is a container for the C++ OpenZWave library Notification class.
func (*Notification) String ¶
func (n *Notification) String() string
type NotificationCode ¶
type NotificationCode int
NotificationCode defines a type for the notification code enum.
const ( NotificationCodeMsgComplete NotificationCode = iota // C.notification_code_msgComplete NotificationCodeTimeout // C.notification_code_timeout NotificationCodeNoOperation // C.notification_code_noOperation NotificationCodeAwake // C.notification_code_awake NotificationCodeSleep // C.notification_code_sleep NotificationCodeDead // C.notification_code_dead NotificationCodeAlive // C.notification_code_alive )
func (NotificationCode) String ¶
func (nc NotificationCode) String() string
type NotificationHandler ¶
type NotificationHandler func(notification *Notification)
NotificationHandler defines the format for a function that will handle new Notification's as they arrive.
type NotificationType ¶
type NotificationType int
NotificationType defines a type for the notification type enum.
const ( NotificationTypeValueAdded NotificationType = iota NotificationTypeValueRemoved NotificationTypeValueChanged NotificationTypeValueRefreshed NotificationTypeGroup NotificationTypeNodeNew NotificationTypeNodeAdded NotificationTypeNodeRemoved NotificationTypeNodeProtocolInfo NotificationTypeNodeNaming NotificationTypeNodeEvent NotificationTypePollingDisabled NotificationTypePollingEnabled NotificationTypeCreateButton NotificationTypeDeleteButton NotificationTypeButtonOn NotificationTypeButtonOff NotificationTypeDriverReady NotificationTypeDriverFailed NotificationTypeDriverReset NotificationTypeEssentialNodeQueriesComplete NotificationTypeNodeQueriesComplete NotificationTypeAwakeNodesQueried NotificationTypeAllNodesQueriedSomeDead NotificationTypeAllNodesQueried NotificationTypeNotification NotificationTypeDriverRemoved NotificationTypeControllerCommand NotificationTypeNodeReset )
func (NotificationType) String ¶
func (nt NotificationType) String() string
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options is a container for the C++ OpenZWave library Options class.
func CreateOptions ¶
CreateOptions creates an object to manage the program options.
func GetOptions ¶
func GetOptions() *Options
GetOptions gets a pointer to the Options singleton object.
func (*Options) AddOptionBool ¶
AddOptionBool add a boolean option to the program. Adds an option to the program whose value can then be read from a file or command line. All calls to AddOptionInt must be made before Lock.
func (*Options) AddOptionInt ¶
AddOptionInt add an integer option to the program. Adds an option to the program whose value can then be read from a file or command line. All calls to AddOptionInt must be made before Lock.
func (*Options) AddOptionLogLevel ¶
AddOptionLogLevel add a log level option to the program. Adds an option to the program whose value can then be read from a file or command line. All calls to AddOptionLogLevel must be made before Lock.
func (*Options) AddOptionString ¶
AddOptionString add a string option to the program. Adds an option to the program whose value can then be read from a file or command line. All calls to AddOptionString must be made before Lock.
func (*Options) GetOptionAsBool ¶
GetOptionAsBool get the value of a boolean option.
func (*Options) GetOptionAsInt ¶
GetOptionAsInt get the value of an integer option.
func (*Options) GetOptionAsString ¶
GetOptionAsString get the value of a string option.
type ValueID ¶
type ValueID struct { HomeID uint32 NodeID uint8 Genre ValueIDGenre CommandClassID uint8 Instance uint8 Index uint8 Type ValueIDType ID uint64 }
ValueID contains all appropriate information available for a ValueID from the OpenZWave library. You should not create a new ValueID manually, but receive it from the goopenzwave package after a Notification has been received from the OpenZWave library.
func (*ValueID) DisablePoll ¶
DisablePoll disables the polling of a device's state. Returns true if polling was disabled.
func (*ValueID) EnablePoll ¶
EnablePoll enables the polling of a device's state. Returns true if polling was enabled.
func (*ValueID) GetAsBool ¶
GetAsBool returns the value as a bool. It will also return an error if the value is not a bool type.
func (*ValueID) GetAsByte ¶
GetAsByte returns the value as an 8-bit unsigned integer. It will also return an error if the value is not of byte type.
func (*ValueID) GetAsFloat ¶
GetAsFloat returns the value as a float. It will also return an error if the value is not a decimal type.
func (*ValueID) GetAsInt ¶
GetAsInt returns the value as a 32-bit signed integer. It will also return an error if the value is not of 32-bit signed integer type.
func (*ValueID) GetAsRaw ¶
GetAsRaw returns the value as a raw byte slice. It will also return an error if the value is not of raw type.
func (*ValueID) GetAsShort ¶
GetAsShort returns the value as a 16-bit signed integer. It will also return an error if the value is not of 16-bit signed integer type.
func (*ValueID) GetAsString ¶
GetAsString returns the value as a string, regardless of its actual type.
func (*ValueID) GetChangeVerified ¶
GetChangeVerified returns true if value changes upon a refresh should be verified. If so, the library will immediately refresh the value a second time whenever a change is observed. This helps to filter out spurious data reported occasionally by some devices.
func (*ValueID) GetFloatPrecision ¶
GetFloatPrecision returns the float value's precision. It will also return an error if the value is not of decimal type.
func (*ValueID) GetListItems ¶
GetListItems returns the list of items from a list value. It will also return an error if the value is not of list type.
func (*ValueID) GetListSelectionAsInt32 ¶
GetListSelectionAsInt32 returns selected item from a list as an integer. It will also return an error if the value is not of list type.
func (*ValueID) GetListSelectionAsString ¶
GetListSelectionAsString returns selected item from a list as a string. It will also return an error if the value is not of list type.
func (*ValueID) GetPollIntensity ¶
GetPollIntensity returns the polling intensity of a device's state.
func (*ValueID) IsReadOnly ¶
IsReadOnly returns true if the value is read-only.
func (*ValueID) IsWriteOnly ¶
IsWriteOnly returns true if the value is write-only.
func (*ValueID) PressButton ¶
PressButton starts an activity in a device. It will return an error if the value is not of button type.
Since buttons are write-only values that do not report a state, no notification callbacks are sent.
func (*ValueID) Refresh ¶
Refresh refreshes the specified value from the Z-Wave network. It will return true if the driver and node were found, otherwise false.
A call to this function causes the library to send a message to the network to retrieve the current value of the specified ValueID (just like a poll, except only one-time, not recurring).
func (*ValueID) ReleaseButton ¶
ReleaseButton stops an activity in a device. It will return an error if the value is not of button type.
Since buttons are write-only values that do not report a state, no notification callbacks are sent.
func (*ValueID) SetBool ¶
SetBool sets the state of a bool. It will return an error if the value is not of bool type.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func (*ValueID) SetBytes ¶
SetBytes sets the value of a raw value. It will return an error if the value is not of raw type.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func (*ValueID) SetChangeVerified ¶
SetChangeVerified sets a flag indicating whether value changes noted upon a refresh should be verified. If so, the library will immediately refresh the value a second time whenever a change is observed. This helps to filter out spurious data reported occasionally by some devices.
func (*ValueID) SetFloat ¶
SetFloat sets the value of a decimal. It will return an error if the value is not of decimal type.
It is usually better to handle decimal values using strings rather than floats, to avoid floating point accuracy issues. Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func (*ValueID) SetInt16 ¶
SetInt16 sets the value of a 16-bit signed integer. It will return an error if the value is not of 16-bit signed integer type.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func (*ValueID) SetInt32 ¶
SetInt32 sets the value of a 32-bit signed integer. It will return an error if the value is not of 32-bit signed integer type.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func (*ValueID) SetListSelection ¶
SetListSelection sets the selected item in a list. It will return an error if the value is not of list type or if the selection is not in the list.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func (*ValueID) SetPollIntensity ¶
SetPollIntensity sets the frequency of polling.
- 0 = none
- 1 = every time through the list
- 2 = every other time
- etc.
func (*ValueID) SetString ¶
SetString sets the value from a string, regardless of type. It will return an error if the value could not be parsed into the correct type for the value.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func (*ValueID) SetUint8 ¶
SetUint8 sets the value of a byte. It will return an error if the value is not of byte type.
Due to the possibility of a device being asleep, the command is assumed to succeed, and the value held by the node is updated directly. This will be reverted by a future status message from the device if the Z-Wave message actually failed to get through. Notification callbacks will be sent in both cases.
func (*ValueID) StringFull ¶
type ValueIDGenre ¶
type ValueIDGenre int
ValueIDGenre defines a type for the valueid genre enum.
const ( ValueIDGenreBasic ValueIDGenre = iota ValueIDGenreUser ValueIDGenreConfig ValueIDGenreSystem ValueIDGenreCount )
func (ValueIDGenre) String ¶
func (v ValueIDGenre) String() string
type ValueIDType ¶
type ValueIDType int
ValueIDType defines a type for the valueid type enum.
const ( ValueIDTypeBool ValueIDType = iota ValueIDTypeByte ValueIDTypeDecimal ValueIDTypeInt ValueIDTypeList ValueIDTypeSchedule ValueIDTypeShort ValueIDTypeString ValueIDTypeButton ValueIDTypeRaw ValueIDTypeMax )
func (ValueIDType) String ¶
func (v ValueIDType) String() string