How to use the homey-meshdriver.ZigBeeDevice function in homey-meshdriver

To help you get started, we’ve selected a few homey-meshdriver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TedTolboom / com.xiaomi-mi-zigbee / drivers / cube / device.js View on Github external
},
	8: {
		motion: 'DoubleTap'
	},
	16: {
		motion: 'Rotate'
	},
	32: {
		motion: 'Catch'
	},
};

const Homey = require('homey');

const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;

class AqaraCubeSensor extends ZigBeeDevice {
	async onMeshInit() {
		// enable debugging
		// this.enableDebug();

		// print the node's info to the console
		// this.printNode();

		//Link util parseData method to this devices instance
		this.parseData = util.parseData.bind(this)

		// Register the AttributeReportListener - Shake, Catch, Flip 90, Flip 180, Slide and Double tap motionType
		this.registerAttrReportListener('genMultistateInput', 'presentValue', 1, 60, null, this.motionAttribReport.bind(this), 1)
			.catch(err => {
				// Registering attr reporting failed
github sebbebebbe / com.philips.hue.zigbee / drivers / SML001 / device.js View on Github external
'use strict';

const Homey = require('homey');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;

class MotionSensor extends ZigBeeDevice {
	onMeshInit()
	{
		this.printNode();
		
				if (this.hasCapability('alarm_motion')) this.registerCapability('alarm_motion', 'msOccupancySensing');
				if (this.hasCapability('alarm_battery')) this.registerCapability('alarm_battery', 'genPowerCfg');
				if (this.hasCapability('measure_temperature')) this.registerCapability('measure_temperature', 'msTemperatureMeasurement');
				if (this.hasCapability('measure_luminance')) this.registerCapability('measure_luminance', 'msIlluminanceMeasurement');
				if (this.hasCapability('measure_battery')) this.registerCapability('measure_battery', 'genPowerCfg');
		
				// alarm_motion
				this.minReportMotion = this.getSetting('minReportMotion') || 1;
				this.maxReportMotion = this.getSetting('maxReportMotion') || 300;
github TedTolboom / com.xiaomi-mi-zigbee / drivers / curtain / device.js View on Github external
idle: {
		command: 'stop'
	},
	down: {
		command: 'downClose'
	},
};

// up: = upOpen = genAnalogOutput-presentValue / closuresWindowCovering-currentPositionLiftPercentage 100
// idle: = stop = genAnalogOutput-presentValue / closuresWindowCovering-currentPositionLiftPercentage ...
// down: = downClose = genAnalogOutput-presentValue / closuresWindowCovering-currentPositionLiftPercentage 0

const Homey = require('homey');

const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;

class AqaraCurtain extends ZigBeeDevice {
	onMeshInit() {

		// enable debugging
		this.enableDebug();

		// print the node's info to the console
		// this.printNode();

		//Link util parseData method to this devices instance
		this.parseData = util.parseData.bind(this)

		this.registerCapability('onoff', 'genOnOff');

		if (this.hasCapability('windowcoverings_state')) {
github TedTolboom / com.xiaomi-mi-zigbee / drivers / remote.b186acn01 / device.js View on Github external
'use strict';

const Homey = require('homey');

const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;

let lastKey = null;

class AqaraRemoteb186acn01 extends ZigBeeDevice {
	async onMeshInit() {

		// enable debugging
		// this.enableDebug();

		// print the node's info to the console
		// this.printNode();

		//Link util parseData method to this devices instance
		this.parseData = util.parseData.bind(this)

		// supported scenes and their reported attribute numbers (all based on reported data)
github TedTolboom / com.xiaomi-mi-zigbee / drivers / sens / device.js View on Github external
'use strict';

const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;

class XiaomiTempSensor extends ZigBeeDevice {
	onMeshInit() {
		// enable debugging
		// this.enableDebug();

		// print the node's info to the console
		// this.printNode();

		//Link util parseData method to this devices instance
		this.parseData = util.parseData.bind(this)

		// Register the AttributeReportListener for measure_temperature
		this._attrReportListeners['0_msTemperatureMeasurement'] = this._attrReportListeners['0_msTemperatureMeasurement'] || {};
		this._attrReportListeners['0_msTemperatureMeasurement']['measuredValue'] =
			this.onTemperatureReport.bind(this);
github TedTolboom / com.xiaomi-mi-zigbee / drivers / remote.b1acn01 / device.js View on Github external
//lifeline validated
'use strict';

const Homey = require('homey');

const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;

let lastKey = null;

class AqaraRemoteb1acn01 extends ZigBeeDevice {
	async onMeshInit() {

		// enable debugging
		// this.enableDebug();

		// print the node's info to the console
		// this.printNode();

		//Link util parseData method to this devices instance
		this.parseData = util.parseData.bind(this)

		// supported scenes and their reported attribute numbers (all based on reported data)
github TedTolboom / com.xiaomi-mi-zigbee / drivers / sensor_motion / device.js View on Github external
'use strict';

const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;

class XiaomiHumanBodySensor extends ZigBeeDevice {
	onMeshInit() {
		// enable debugging
		// this.enableDebug();

		// print the node's info to the console
		// this.printNode();

		//Link util parseData method to this devices instance
		this.parseData = util.parseData.bind(this)

		// Register attribute listener for occupancy
		this._attrReportListeners['0_msOccupancySensing'] = this._attrReportListeners['0_msOccupancySensing'] || {};
		this._attrReportListeners['0_msOccupancySensing']['occupancy'] = this.onOccupancyReport.bind(this);
github TedTolboom / com.xiaomi-mi-zigbee / drivers / sensor_motion.aq2 / device.js View on Github external
'use strict';

const util = require('./../../lib/util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;

class AqaraHumanBodySensor extends ZigBeeDevice {
	onMeshInit() {
		// enable debugging
		// this.enableDebug();

		// print the node's info to the console
		// this.printNode();

		//Link util parseData method to this devices instance
		this.parseData = util.parseData.bind(this)

		// Register attribute listener for occupancy
		this.registerAttrReportListener('msOccupancySensing', 'occupancy', 1, 60, null,
				this.onOccupancyReport.bind(this), 0)
			.catch(err => {
github TedTolboom / com.xiaomi-mi-zigbee / node_modules / homey-meshdriver / lib / zigbee / ZigBeeLightDevice.js View on Github external
'use strict';

const util = require('./../util');
const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;

const maxHue = 254;
const maxSaturation = 254;

class ZigBeeLightDevice extends ZigBeeDevice {

	async onMeshInit() {

		// Register capabilities if present on device
		if (this.hasCapability('onoff')) this.registerCapability('onoff', 'genOnOff');
		if (this.hasCapability('dim')) this.registerCapability('dim', 'genLevelCtrl');

		// Register debounced capabilities
		const groupedCapabilities = [];
		if (this.hasCapability('light_hue')) {
			groupedCapabilities.push({
github TedTolboom / com.xiaomi-mi-zigbee / drivers / ctrl_neutral1 / device.js View on Github external
'use strict';

const ZigBeeDevice = require('homey-meshdriver').ZigBeeDevice;

class AqaraWallSwitchSingleL extends ZigBeeDevice {

	onMeshInit() {

		// enable debugging
		// this.enableDebug();

		// print the node's info to the console
		// this.printNode();

		// Register capabilities and reportListeners for  switch
		this.registerCapability('onoff', 'genOnOff', {
			endpoint: 1
		});
		this.registerAttrReportListener('genOnOff', 'onOff', 1, 3600, 1,

homey-meshdriver

Use this module to make the creation of Z-Wave & ZigBee Homey Apps easier.

ISC
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Similar packages