Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new fingerprint for ZY-M100-S #5990

Merged
merged 5 commits into from
Jul 27, 2023
Merged

new fingerprint for ZY-M100-S #5990

merged 5 commits into from
Jul 27, 2023

Conversation

arteck
Copy link
Contributor

@arteck arteck commented Jul 21, 2023

fingerprint: tuya.fingerprint('TS0601', ['_TZE204_sxm7l9xa', '_TZE204_qasjif9e']),

@rpearl
Copy link

rpearl commented Jul 23, 2023

Hello, I just got one of these sensors yesterday and this doesn't work.

This particular version of the sensor has different datapoints for at least a few pieces of state.

I poked around and a working external converter looks like this:

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: tuya.fingerprint('TS0601', ['_TZE204_qasjif9e']),
    model: 'ZY-M100-S',
    vendor: 'TuYa',
    description: 'Mini Human Breathe Sensor',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    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: [
            [1, 'presence', tuya.valueConverter.trueFalse1],
            [9, 'target_distance', tuya.valueConverter.divideBy100],
            [104, 'illuminance_lux', tuya.valueConverter.raw],
            [106, 'radar_sensitivity', tuya.valueConverter.raw],
            [107, 'maximum_range', tuya.valueConverter.divideBy100],
            [108, 'minimum_range', tuya.valueConverter.divideBy100],
            [110, 'fading_time', tuya.valueConverter.divideBy10],
            [111, 'detection_delay', tuya.valueConverter.divideBy10],
        ],
    },
};

module.exports = definition;

Note that target_distance appears to be datapoint 9 and presence is datapoint 1. This differs from other versions of this sensor.

I believe the settings datapoints are still correct.

There are some unidentified datapoints 2, 3, 4, 101 and 102 that I haven't figured out: I don't have a tuya gateway. I just guessed about 1 and 9 but they're definitely right.

I can create a new pull request for this if necessary but I figured I'd chime in here because this doesn't work.

@Koenkk
Copy link
Owner

Koenkk commented Jul 23, 2023

@arteck can you update the PR based on the comment of @rpearl ?

@arteck
Copy link
Contributor Author

arteck commented Jul 24, 2023

done

@Koenkk
Copy link
Owner

Koenkk commented Jul 24, 2023

Could you rebase this pr, it has recently been added in #5891

@DaanVT86
Copy link

@rpearl The datapoints for the settings are not correct anymore for this device. I have changed the convertor, tested it and now everything seems to work correctly.

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: tuya.fingerprint('TS0601', ['_TZE204_qasjif9e']),
    model: 'ZY-M100-S',
    vendor: 'TuYa',
    description: 'Mini Human Breathe Sensor',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    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: [
            [1, 'presence', tuya.valueConverter.trueFalse1],
            [9, 'target_distance', tuya.valueConverter.divideBy100],
            [104, 'illuminance_lux', tuya.valueConverter.raw],
            [2, 'radar_sensitivity', tuya.valueConverter.raw],
            [4, 'maximum_range', tuya.valueConverter.divideBy100],
            [3, 'minimum_range', tuya.valueConverter.divideBy100],
            [102, 'fading_time', tuya.valueConverter.divideBy10],
            [101, 'detection_delay', tuya.valueConverter.divideBy10],
        ],
    },
};

module.exports = definition;

Copy link

@DaanVT86 DaanVT86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The datapoints for the are not correct. They should be:

        tuyaDatapoints: [
            [1, 'presence', tuya.valueConverter.trueFalse1],
            [9, 'target_distance', tuya.valueConverter.divideBy100],
            [104, 'illuminance_lux', tuya.valueConverter.raw],
            [2, 'radar_sensitivity', tuya.valueConverter.raw],
            [4, 'maximum_range', tuya.valueConverter.divideBy100],
            [3, 'minimum_range', tuya.valueConverter.divideBy100],
            [102, 'fading_time', tuya.valueConverter.divideBy10],
            [101, 'detection_delay', tuya.valueConverter.divideBy10],
        ],

@rpearl
Copy link

rpearl commented Jul 26, 2023

my apologies. I thought I had tested that by changing some settings and observing the values persist, but perhaps that's not enough; I just didn't know how else to check. Thanks for the update.

arteck and others added 5 commits July 27, 2023 07:24
@Koenkk Koenkk merged commit 90519ec into Koenkk:master Jul 27, 2023
1 check passed
@Koenkk
Copy link
Owner

Koenkk commented Jul 27, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants