zigbee-deconzdeprecated

Zigbee communication module for Dresden Elektronik DeConz usb dongle

Usage no npm install needed!

<script type="module">
  import zigbeeDeconz from 'https://cdn.skypack.dev/zigbee-deconz';
</script>

README

Communication module for Dresden Elektronik Conbee Zigbee dongle

Copyright (C) 2018 Emre Tapcı.
NodeJS module for accessing the serial line IP interface of Conbee Zigbee dongle of Dresden Elektronik.

Device interface specification:
https://www.dresden-elektronik.de/funktechnik/products/software/pc-software/deconz

github repository:
https://github.com/emretapci/zigbee-deconz

Install

npm install --save zigbee-deconz

Test

npm install --save mocha  
npm test

Usage

Unit test codes can be useful for API usage examples, in test/test.js file.

API

const { Deconz, Constants } = require('zigbee-deconz');  

const port = 'COM1';
const zigbeeDeconz = new Deconz(port);

Functions of zigbeeDeconz object are

//reads a parameter's value and returns in an object {success, value}  
async readParameter(parameterCode)  

//parameterCode: parameter code to be written  
//value: array of data to be written  
//writes a parameter's value and returns the result in an object {success}  
async writeParameter(parameterCode, value)  

//reads network state and returns the result in an object {status, networkState}  
async readNetworkState()  

//if connected is true, connects to network.  
//if connected is false, disconnects from network.  
async setNetworkState(connected)  

//destAddress: 2 bytes array for NWK, 8 bytes array for MAC (little endian).  
//destEndpoint: 0-255  
//destClusterId: 0x0000-0xffff  
//data: array to be sent  
//returns result in an object {status}  
//enqueues a send and waits for a successful response from the dongle indefinitely.  
async sendData(destAddress, destEndpoint, destClusterId, data)  

//closes the serial port and stops the module  
exit()  

zigbeeDeconz.on('dataReceived', function (data) {
    //called when data is received
})

//Device parameter codes  
Constants.parameterCodes  

//Status codes returned from API functions (in "status" property of the returned object)  
Constants.statusCodes  

//Network states of the device  
Constants.networkStates  

//Address modes of messages sent and received  
Constants.addressModes