Skip to content

Instantly share code, notes, and snippets.

@RamonSmit
Created May 3, 2023 14:20
Show Gist options
  • Save RamonSmit/157f08633b8a05feb8e845d34872999f to your computer and use it in GitHub Desktop.
Save RamonSmit/157f08633b8a05feb8e845d34872999f 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: 'TS0601', manufacturerName: '_TZE200_ikvncluo'},
{modelID: 'TS0601', manufacturerName: '_TZE200_lyetpprm'},
{modelID: 'TS0601', manufacturerName: '_TZE200_jva8ink8'},
{modelID: 'TS0601', manufacturerName: '_TZE200_holel4dk'},
{modelID: 'TS0601', manufacturerName: '_TZE200_xpq2rzhq'},
{modelID: 'TS0601', manufacturerName: '_TZE200_wukb7rhc'},
{modelID: 'TS0601', manufacturerName: '_TZE204_ztc6ggyl'},
{modelID: 'TS0601', manufacturerName: '_TZE204_sxm7l9xa'},
{modelID: 'TS0601', manufacturerName: '_TZE200_ztc6ggyl'}],
model: 'TS0601_smart_human_presence_sensor',
vendor: 'TuYa',
description: 'Smart Human presence sensor',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
exposes: [
e.illuminance_lux(), e.presence(),
exposes.numeric('target_distance', ea.STATE).withDescription('Distance to target').withUnit('m'),
exposes.numeric('radar_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(9).withValueStep(1)
.withDescription('sensitivity of the radar'),
exposes.numeric('minimum_range', ea.STATE_SET).withValueMin(0).withValueMax(9.5).withValueStep(0.15)
.withDescription('Minimum range').withUnit('m'),
exposes.numeric('maximum_range', ea.STATE_SET).withValueMin(0).withValueMax(9.5).withValueStep(0.15)
.withDescription('Maximum range').withUnit('m'),
exposes.numeric('detection_delay', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(0.1)
.withDescription('Detection delay').withUnit('s'),
exposes.numeric('fading_time', ea.STATE_SET).withValueMin(0).withValueMax(1500).withValueStep(1)
.withDescription('Fading time').withUnit('s'),
// exposes.text('cli', ea.STATE).withDescription('not recognize'),
exposes.enum('self_test', ea.STATE, Object.values(tuya.tuyaHPSCheckingResult))
.withDescription('Self_test, possible resuts: checking, check_success, check_failure, others, comm_fault, radar_fault.'),
],
meta: {
tuyaDatapoints: [
[104, 'illuminance', tuya.valueConverter.raw],
[105, 'presence', tuya.valueConverter.boolean],
[106, 'radar_sensitivity', tuya.valueConverter.raw],
[107, 'maximum_range', tuya.valueConverter.raw],
[108, 'minimum_range', tuya.valueConverter.raw],
[109, 'target_distance', tuya.valueConverter.raw],
[110, 'detection_delay', tuya.valueConverter.raw],
[111, 'fading_time', tuya.valueConverter.raw],
],
},
};
module.exports = definition;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment