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

Tuya - M9-zigbee-SL #25318

Open
tzeryin1981 opened this issue Dec 25, 2024 · 0 comments
Open

Tuya - M9-zigbee-SL #25318

tzeryin1981 opened this issue Dec 25, 2024 · 0 comments
Labels
new device support New device support request

Comments

@tzeryin1981
Copy link

tzeryin1981 commented Dec 25, 2024

Link

https://www.zigbee2mqtt.io/devices/M9-zigbee-SL.html

Database entry

Zigbee Model: TS0601, Manufacturer: _TZE200_aymo2hx5

Zigbee2MQTT version

1.42.0-2

Comments

Trying to get it works, but fail.

External definition

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 e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');


const definition =    {
    fingerprint: tuya.fingerprint('TS0601', ['_TZE200_aymo2hx5']),
    model: 'M9-zigbee-SL',
    vendor: 'Tuya',
    description: 'Smart Switch (4 gang + 4 scene) with neutral wire and motion sensing',
    fromZigbee: [tuya.fz.datapoints, fz.ias_occupancy_only_alarm_2, tuya.fz.indicator_mode],
    toZigbee: [tuya.tz.datapoints, tuya.tz.power_on_behavior_1, tuya.tz.backlight_indicator_mode_1],
    configure: tuya.configureMagicPacket,
    exposes: [
        ...[1, 2, 3, 4, 5, 6, 7, 8].map((i) => tuya.exposes.switch().withEndpoint(`l${i}`)),
        ...[1, 2, 3, 4, 5, 6, 7, 8].map((i) => e.power_on_behavior().withAccess(ea.STATE_SET).withEndpoint(`l${i}`)),
        ...[1, 2, 3, 4, 5, 6, 7, 8].map((i) => tuya.exposes.switchMode().withEndpoint(`l${i}`)),
        ...[1, 2, 3, 4, 5, 6, 7, 8].map((i) => tuya.exposes.lightMode().withEndpoint(`l${i}`)),
        tuya.exposes.backlightModeOffOn().withAccess(ea.STATE_SET),
        e.action(['scene_1', 'scene_2', 'scene_3', 'scene_4', 'scene_5', 'scene_6', 'scene_7', 'scene_8']),
        e.presence(),
        new exposes.Numeric('delay', ea.STATE_SET).withUnit('sec').withDescription('light off delay').withValueMin(0).withValueMax(1000),
    ],
    endpoint: (device) => {
        return {l1: 1, l2: 1, l3: 1, l4: 1, l5: 1, l6: 1, state: 1, backlight: 1, l7: 1, l8: 1};
    },
    meta: {
        multiEndpoint: true,
        tuyaDatapoints: [
            [24, 'state_l1', tuya.valueConverter.onOff],
            [25, 'state_l2', tuya.valueConverter.onOff],
            [26, 'state_l3', tuya.valueConverter.onOff],
            [27, 'state_l4', tuya.valueConverter.onOff],
            [36, 'backlight_mode', tuya.valueConverter.onOff],
            [39, 'power_on_behavior_l1', tuya.valueConverter.powerOnBehaviorEnum],
            [40, 'power_on_behavior_l2', tuya.valueConverter.powerOnBehaviorEnum],
            [41, 'power_on_behavior_l3', tuya.valueConverter.powerOnBehaviorEnum],
            [42, 'power_on_behavior_l4', tuya.valueConverter.powerOnBehaviorEnum],
            [1, 'action', tuya.valueConverter.static('scene_1')],
            [2, 'action', tuya.valueConverter.static('scene_2')],
            [3, 'action', tuya.valueConverter.static('scene_3')],
            [4, 'action', tuya.valueConverter.static('scene_4')],
            [5, 'action', tuya.valueConverter.static('scene_5')],
            [6, 'action', tuya.valueConverter.static('scene_6')],
            [7, 'action', tuya.valueConverter.static('scene_7')],
            [8, 'action', tuya.valueConverter.static('scene_8')],            
            [18, 'switch_mode_l1', tuya.valueConverter.switchMode],
            [19, 'switch_mode_l2', tuya.valueConverter.switchMode],
            [20, 'switch_mode_l3', tuya.valueConverter.switchMode],
            [21, 'switch_mode_l4', tuya.valueConverter.switchMode],
        ],
    },
};

module.exports = definition;

What does/doesn't work with the external definition?

Nothing is work

@tzeryin1981 tzeryin1981 added the new device support New device support request label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new device support New device support request
Projects
None yet
Development

No branches or pull requests

1 participant