UNPKG

homebridge-zigbee-v2

Version:

ZigBee Platform plugin for HomeBridge

40 lines (35 loc) 866 B
const HomeKitDevice = require('../HomeKitDevice') class XiaomiHumanBodySensor extends HomeKitDevice { static get description() { return { model: 'lumi.sensor_motion', manufacturer: 'LUMI', name: 'Xiaomi Human Body Sensor', } } getAvailbleServices() { return [{ name: 'Motion', type: 'MotionSensor', history: { type: 'motion', use: 'status', }, }] } onDeviceReady() { this.zigbee.update({ status: 'online', joinTime: Math.floor(Date.now() / 1000) }) this.mountServiceCharacteristic({ endpoint: 1, cluster: 'msOccupancySensing', service: 'Motion', characteristic: 'MotionDetected', reportMinInt: 1, reportMaxInt: 60, reportChange: 1, parser: 'occupancy', get: null, }) } } module.exports = XiaomiHumanBodySensor