zwavejs2mqtt

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const GetNodesCommandTopic = "/getNodes"
View Source
const NodeAvailableTopic = "/node_alive"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(config configuration.Config, ctx context.Context) (*Client, error)

func (*Client) ForwardError

func (this *Client) ForwardError(msg string)

func (*Client) RequestDeviceInfoUpdate

func (this *Client) RequestDeviceInfoUpdate() error

func (*Client) SendZwayCommand

func (this *Client) SendZwayCommand(command string, args []interface{}) error

func (*Client) SetDeviceInfoListener

func (this *Client) SetDeviceInfoListener(listener DeviceInfoListener)

func (*Client) SetDeviceStatusListener

func (this *Client) SetDeviceStatusListener(listener func(nodeId int64, online bool) error)

func (*Client) SetErrorForwardingFunc

func (this *Client) SetErrorForwardingFunc(f func(msg string))

func (*Client) SetValueByValueId

func (this *Client) SetValueByValueId(valueId string, value interface{}) error

func (*Client) SetValueEventListener

func (this *Client) SetValueEventListener(listener ValueEventListener)

type DeviceInfoListener

type DeviceInfoListener = func(nodes []model.DeviceInfo, huskIds []int64, withValues bool, allKnownDevices bool)

type DeviceState

type DeviceState = string
const ALIVE DeviceState = "Alive"
const ASLEEP DeviceState = "Asleep"
const DEAD DeviceState = "Dead"
const UNKNOWN DeviceState = "Unknown"

type DeviceStateListener

type DeviceStateListener = func(nodeId int64, online bool) error

type DeviceStateMsg

type DeviceStateMsg struct {
	Status string `json:"status"`
	NodeId int64  `json:"nodeId"`
}

type NodeAvailableMessage

type NodeAvailableMessage struct {
	Data []NodeInfo `json:"data"`
}
{
   "data":[
      5,
      {
         "manufacturer":"Danfoss",
         "manufacturerid":"0x0002",
         "product":"Devolo Home Control Radiator Thermostat",
         "producttype":"0x0005",
         "productid":"0x0175",
         "type":"Setpoint Thermostat",
         "name":"",
         "loc":""
      }
   ]
}

type NodeInfo

type NodeInfo struct {
	Id                 int64                `json:"id"`
	DeviceId           string               `json:"deviceId"`
	Manufacturer       string               `json:"manufacturer"`
	ManufacturerId     int64                `json:"manufacturerId"`
	ProductDescription string               `json:"productDescription"`
	ProductType        int64                `json:"productType"`
	ProductId          int64                `json:"productId"`
	Name               string               `json:"name"`
	Values             map[string]NodeValue `json:"values"`
	Statistics         Statistics           `json:"statistics"`
}
{
	"id":2,
	"name":"Lampe_Ingo",
	"loc":"",
	"values":{},
	"groups":[],
	"neighbors":[],
	"ready":true,
	"available":true,
	"hassDevices":{},
	"failed":false,
	"inited":true,
	"hexId":"0x0371-0x0003-0x0002",
	"dbLink":"https://devices.zwave-js.io/?jumpTo=0x0371:0x0003:0x0002:2.5",
	"manufacturerId":881,
	"productId":2,
	"productType":3,
	"deviceConfig":{},
	"productLabel":"ZWA002",
	"productDescription":"Bulb 6 Multi-Color",
	"manufacturer":"Aeotec Ltd.",
	"firmwareVersion":"2.5",
	"protocolVersion":3,
	"zwavePlusVersion":1,
	"zwavePlusNodeType":0,
	"zwavePlusRoleType":5,
	"nodeType":1,
	"endpointsCount":0,
	"endpointIndizes":[],
	"isSecure":"unknown",
	"supportsSecurity":false,
	"supportsBeaming":true,
	"isControllerNode":false,
	"isListening":true,
	"isFrequentListening":false,
	"isRouting":true,
	"keepAwake":false,
	"maxDataRate":100000,
	"deviceClass":{},
	"deviceId":"881-2-3",
	"status":"Alive",
	"interviewStage":"Complete",
	"statistics":{},
	"lastActive":1652876439240
}

type NodeInfoResultWrapper

type NodeInfoResultWrapper struct {
	ResultWrapper
	Result []NodeInfo `json:"result"`
}

type NodeValue

type NodeValue struct {
	Id               string      `json:"id"`
	NodeId           int64       `json:"nodeId"`
	CommandClass     int64       `json:"commandClass"`
	CommandClassName string      `json:"commandClassName"`
	Description      string      `json:"description"`
	Endpoint         int64       `json:"endpoint"`
	Type             string      `json:"type"`
	Label            string      `json:"label"`
	Readable         bool        `json:"readable"`
	Writeable        bool        `json:"writeable"`
	Values           interface{} `json:"values"`
	Value            interface{} `json:"value"`
	LastUpdate       int64       `json:"lastUpdate"`
}

type ResultWrapper

type ResultWrapper struct {
	Success bool          `json:"success"`
	Message string        `json:"message"`
	Args    []interface{} `json:"args"`
}

type Statistics

type Statistics struct {
	CommandTx         float64 `json:"commandsTX"`
	CommandsRX        float64 `json:"commandsRX"`
	CommandsDroppedRX float64 `json:"commandsDroppedRX"`
	CommandsDroppedTX float64 `json:"commandsDroppedTX"`
	TimeoutResponse   float64 `json:"timeoutResponse"`
	Rtt               float64 `json:"rtt"`
}

type ValueEventListener

type ValueEventListener = func(value model.Value)

type ValueID

type ValueID struct {
	NodeId       int64       `json:"nodeId"`
	CommandClass int64       `json:"commandClass"`
	Endpoint     int64       `json:"endpoint"`
	Property     interface{} `json:"property"`
	PropertyKey  interface{} `json:"propertyKey,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL