Skip to content

Commit

Permalink
feat: Support sensitivity for ADEO LDSENK08. Koenkk/zigbee2mqtt#16574
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Jul 18, 2023
1 parent 302d15e commit 95b3407
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/devices/adeo.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {Definition, Fz} from '../lib/types';
import {Definition, Fz, Tz} from '../lib/types';
import * as exposes from '../lib/exposes';
import fz from '../converters/fromZigbee';
import * as reporting from '../lib/reporting';
import extend from '../lib/extend';
import tz from '../converters/toZigbee';
const e = exposes.presets;
const ea = exposes.access;

const fzLocal = {
LDSENK08: {
Expand All @@ -22,15 +23,26 @@ const fzLocal = {
} as Fz.Converter,
};

const tzLocal = {
LDSENK08_sensitivity: {
key: ['sensitivity'],
convertSet: async (entity, key, value, meta) => {
await entity.write('ssIasZone', {0x0013: {value, type: 0x20}});
return {state: {sensitivity: value}};
},
} as Tz.Converter,
};

const definitions: Definition[] = [
{
zigbeeModel: ['LDSENK08'],
model: 'LDSENK08',
vendor: 'ADEO',
description: 'ENKI LEXMAN wireless smart door window sensor with vibration',
fromZigbee: [fzLocal.LDSENK08, fz.battery],
toZigbee: [],
exposes: [e.battery_low(), e.contact(), e.vibration(), e.tamper(), e.battery()],
toZigbee: [tzLocal.LDSENK08_sensitivity],
exposes: [e.battery_low(), e.contact(), e.vibration(), e.tamper(), e.battery(),
e.numeric('sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(4).withDescription('Sensitivity of the motion sensor')],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
Expand Down

0 comments on commit 95b3407

Please sign in to comment.