Skip to content

Instantly share code, notes, and snippets.

@Koenkk
Last active December 22, 2022 16:32
Show Gist options
  • Save Koenkk/e880d476d7267eb6c6b4caeac1c24f0c to your computer and use it in GitHub Desktop.
Save Koenkk/e880d476d7267eb6c6b4caeac1c24f0c 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 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: [{modelID: 'TS0202', manufacturerName: '_TZ3000_kmh5qpmb'}],
model: 'TS0202',
vendor: 'TuYa',
description: 'Motion sensor',
fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.ignore_basic_report, fz.ias_occupancy_alarm_1_report, fz.humidity, fz.temperature],
toZigbee: [],
exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.battery(), e.battery_voltage(), e.humidity(), e.temperature()],
configure: async (device, coordinatorEndpoint, logger) => {
await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
},
};
module.exports = definition;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment