Skip to content

Instantly share code, notes, and snippets.

@Koenkk

Koenkk/ext.js Secret

Last active September 11, 2023 18:01
Show Gist options
  • Save Koenkk/2e438754fac949869e5c2cf5219382aa to your computer and use it in GitHub Desktop.
Save Koenkk/2e438754fac949869e5c2cf5219382aa to your computer and use it in GitHub Desktop.
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const legacy = require('zigbee-herdsman-converters/lib/legacy');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
fingerprint: tuya.fingerprint('TS0225', ['_TZ3218_awarhusb']),
model: 'TS0225',
vendor: 'TuYa',
description: 'Motion sensor',
fromZigbee: [fz.ias_occupancy_alarm_1, fz.illuminance],
toZigbee: [],
exposes: [e.occupancy(), e.illuminance_lux()],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['msIlluminanceMeasurement']);
await reporting.illuminance(endpoint);
},
};
module.exports = definition;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment