Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.78k stars 1.64k forks source link

ZY-M100 human presence detector #21730

Open 537719-C opened 6 months ago

537719-C commented 6 months ago

What happened?

My device is reported as Zigbee Model : TS0601 Zigbee Manufacturer : _TZE204_qasjif9e Model : ZY-M100-S_2

It worked fine for a few weeks and suddenly there is no report but illuminance.

On the box, it is identified as ZY-M100-1 (side wall version), the ZY-M100-2 is ceilling version.

Looking at https://github.com/Koenkk/zigbee-herdsman-converters/tree/master/src/devices/tuya.ts I can see that the only dataPoint that is common between ZY-M100-S_1 and ZY-M100-S_2 is [104, 'illuminance_lux', tuya.valueConverter.raw] that is the only value that still works.

I tried to make an external conveter by copying the ZY-M100-S1 definition and declare it in configuration.yaml but it still is identified as ZY-M100-S_2.

My zy-m100-1.js : `const {} = require('zigbee-herdsman-converters/lib/modernExtend'); // Add the lines below 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 {} = 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 = { zigbeeModel: ['TS0601'], model: 'TS0601', vendor: '_TZE204_qasjif9e', description: 'Automatically generated definition', extend: [], exposes: [ e.illuminance_lux(), e.presence(), e.numeric('target_distance', ea.STATE).withDescription('Distance to target').withUnit('m'), e.numeric('radar_sensitivity', ea.STATE_SET).withValueMin(0).withValueMax(9).withValueStep(1) .withDescription('sensitivity of the radar'), e.numeric('minimum_range', ea.STATE_SET).withValueMin(0).withValueMax(9.5).withValueStep(0.15) .withDescription('Minimum range').withUnit('m'), e.numeric('maximum_range', ea.STATE_SET).withValueMin(0).withValueMax(9.5).withValueStep(0.15) .withDescription('Maximum range').withUnit('m'), e.numeric('detection_delay', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(0.1) .withDescription('Detection delay').withUnit('s'), e.numeric('fading_time', ea.STATE_SET).withValueMin(0.5).withValueMax(1500).withValueStep(1) .withDescription('Fading time').withUnit('s'), ], meta: { tuyaDatapoints: [

            [104, 'illuminance_lux', tuya.valueConverter.raw],
            [105, 'presence', tuya.valueConverter.trueFalse1],
            [106, 'radar_sensitivity', tuya.valueConverter.raw],
            [107, 'maximum_range', tuya.valueConverter.divideBy100],
            [108, 'minimum_range', tuya.valueConverter.divideBy100],
            [109, 'target_distance', tuya.valueConverter.divideBy100],
            [110, 'fading_time', tuya.valueConverter.divideBy10],
            [111, 'detection_delay', tuya.valueConverter.divideBy10],
        ],
    },

};

module.exports = definition;`

My configuration.yaml : `homeassistant: false permit_join: false mqtt: base_topic: zigbee2mqtt server: mqtt://192.168.51.149 keepalive: 60 reject_unauthorized: true version: 4 serial: port: /dev/ttyACM0 adapter: deconz advanced: network_key:

After restarting zigbee2mqqt nothing tells the converter is correctly loaded but no error is displayed in the log : debug 2024-03-09 09:17:43: Loaded state from file /app/data/state.json info 2024-03-09 09:17:43: Logging to console and directory: '/app/data/log/2024-03-09.09-17-42' filename: log.txt debug 2024-03-09 09:17:43: Removing old log directory '/app/data/log/2024-02-25.11-30-20' info 2024-03-09 09:17:43: Starting Zigbee2MQTT version 1.36.0 (commit #86ed71c) info 2024-03-09 09:17:43: Starting zigbee-herdsman (0.35.1) debug 2024-03-09 09:17:43: Using zigbee-herdsman with settings: '{"adapter":{"concurrent":null,"delay":null,"disableLED":false},"backupPath":"/app/data/coordinator_backup.json","databaseBackupPath":"/app/data/database.db.backup","databasePath":"/app/data/database.db","network":{"channelList":[11],"extendedPanID":[221,221,221,221,221,221,221,221],"networkKey":"HIDDEN","panID":6754},"serialPort":{"adapter":"deconz","path":"/dev/ttyACM0"}}' info 2024-03-09 09:17:44: zigbee-herdsman started (resumed) info 2024-03-09 09:17:44: Coordinator firmware version: '{"meta":{"maintrel":0,"majorrel":38,"minorrel":120,"product":0,"revision":"0x26780700","transportrev":0},"type":"ConBee2/RaspBee2"}' debug 2024-03-09 09:17:44: Zigbee network parameters: {"channel":11,"extendedPanID":"0xdddddddddddddddd","panID":6754} info 2024-03-09 09:17:44: Currently 47 devices are joined: info 2024-03-09 09:17:44: SP003 (0x7cb03eaa0a0bb394): AB3257001NJ - OSRAM Smart+ plug (Router) info 2024-03-09 09:17:44: RAD001 (0x00124b0024c351cb): ZBMINI - SONOFF Zigbee two way smart switch (Router)

What did you expect to happen?

I would expect the converter for ZY-M100-S_1 (in fact its copy) to be used and see if my sensor works fine or not.

Maybe the definition in tuya.js overwrites mine ? How can I test and determine if that device is effectively badly identified or not ?

I had a look at dev console but couldn't figure how to get the other dataPoints.

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.36.0 commit: 86ed71c

Adapter firmware version

0x26780700

Adapter

Conbee2

Setup

Docker on Raspberry pi 4B Bullseye

Debug log

No response

github-actions[bot] commented 1 week ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days