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

LXX60-CS27LX1.0 and LXN59-CS27LX1.0 smart curtain switch #2489

Closed
a-bailey opened this issue Apr 18, 2021 · 34 comments
Closed

LXX60-CS27LX1.0 and LXN59-CS27LX1.0 smart curtain switch #2489

a-bailey opened this issue Apr 18, 2021 · 34 comments
Labels

Comments

@a-bailey
Copy link
Contributor

a-bailey commented Apr 18, 2021

Hello, I hope someone might be able to help me. Yagusmart started selling really good prices curtain switch zigbee actuators on amazon.de https://www.amazon.de/gp/product/B08BFL1HDN/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&psc=1.

I bought one a few weeks ago to do aa test implementation and managed to get up/ down running relatively easily (just treating the device like a switch) using the following code in the devices.js

{
        zigbeeModel: ['LXX60-CS27LX1.0'],
        model: 'LXX60-CS27LX1.0',
        vendor: '3A Smart Home DE',
        description: 'Zigbee Smart Curtain Switch',
        extend: preset.switch(),
        whiteLabel: [{vendor: 'Zemismart', model: 'ZW-EC-01', description: 'Zigbee Smart Curtain Switch'}],
        meta: {configureKey: 2},
        configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint1 = device.getEndpoint(1);
            await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff']);
            await reporting.bind(endpoint1, coordinatorEndpoint, ['closuresWindowCovering'])
            await reporting.onOff(endpoint1);
            device.powerSource = 'Mains (single phase)';
            device.type = 'EndDevice';
            device.save();
        },
  }

now comes the tricky part.
Since I got that to work I ordered 13 more to fit all of my switches.
I connected the first of the modules and to my suprise they look identical but are a different model number.
The first "test" one is LXX60-CS27LX1.0 the new ones are LXN59-CS27LX1.0.

Those new ones don't respond to anything I do. They seem to send the same messages to the network for example:

Debug Received Zigbee message from 'buero_rollladen_rechts', type 'attributeReport', cluster 'closuresWindowCovering', data '{"currentPositionLiftPercentage":0,"tuyaMovingState":2}' from endpoint 1 with groupID 0 Debug No converter available for 'LXN59-CS27LX1.0' with cluster 'closuresWindowCovering' and type 'attributeReport' and data '{"currentPositionLiftPercentage":0,"tuyaMovingState":2}' Debug Received Zigbee message from 'buero_rollladen_rechts', type 'attributeReport', cluster 'closuresWindowCovering', data '{"currentPositionLiftPercentage":0,"tuyaMovingState":2}' from endpoint 1 with groupID 0 Debug No converter available for 'LXX60-CS27LX1.0' with cluster 'closuresWindowCovering' and type 'attributeReport' and data '{"currentPositionLiftPercentage":0,"tuyaMovingState":2}'

But I can't control the 59er models only the 60s.

Can anyone give me a hint how to approach this problem? I can provide any data needed please feel free to ask.

@a-bailey
Copy link
Contributor Author

a-bailey commented Apr 18, 2021

Additional: also it seems that while on the "60" model currentPositionLiftPercentage does nothing. on the "59" it seems to "work" saying when I go aall the way up by switch then down and I stop it after a few seks currentPositionLiftPercentage will be for example "90" instead of 100

edit:

also tried the debug options in https://www.zigbee2mqtt.io/how_tos/how_to_support_new_tuya_devices.html but I get no debug tuya information

@a-bailey
Copy link
Contributor Author

a-bailey commented Apr 18, 2021

Another update:

got it working with the following configuration

{
        zigbeeModel: ['LXN59-CS27LX1.0'],
        model: 'LXN59-CS27LX1.0',
        vendor: 'Nue / 3A',
        description: 'Smart Zigbee 3.0 curtain controller',
        fromZigbee: [fz.tuya_cover_options],
        toZigbee: [tz.cover_state],
        whiteLabel: [{vendor: 'Zemismart', model: 'ZW-EU-01', description: 'Smart light relay - 1 gang'}],
        meta: {configureKey: 2},
        exposes: [e.cover_position(), exposes.enum('moving', ea.STATE, ['UP', 'STOP', 'DOWN'])],
        configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint1 = device.getEndpoint(1);
            await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff']);
            await reporting.onOff(endpoint1);

            await reporting.bind(endpoint1, coordinatorEndpoint, ['closuresWindowCovering'])
            //await reporting.currentPositionLiftPercentage(endpoint);
            
            device.powerSource = 'Mains (single phase)';
            device.type = 'EndDevice';
            device.save();
        },
    },

seems to work "fine" art first glance but getting some horrible timeout issues when switching between open/ close for example.

Publish 'set' 'state' to 'waschkueche_rollladen' failed: 'Error: Command 0x60a423fffe138c8a/1 closuresWindowCovering.downClose({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Timeout - 1138 - 1 - 95 - 258 - 11 after 10000ms)'

@Koenkk
Copy link
Owner

Koenkk commented Apr 18, 2021

Try changing meta to meta: {configureKey: 2, disableDefaultResponse: true},, this may prevent the errors.

@a-bailey
Copy link
Contributor Author

Try changing meta to meta: {configureKey: 2, disableDefaultResponse: true},, this may prevent the errors.

I'll try thanks, got the control "working" right now but having issues with the position since the modules seem to "remember" where they are. couldn't find a way to for example calibrate 0/100 yet and will keep trying.

@a-bailey
Copy link
Contributor Author

Try changing meta to meta: {configureKey: 2, disableDefaultResponse: true},, this may prevent the errors.

"disableDefaultResponse" seems to have fixed the timeout responses thank you :) could you elaborate why it did that? Still working on some other issues will create a pull request when I get it done

@Koenkk
Copy link
Owner

Koenkk commented Apr 21, 2021

This means the device doesn't confirm any received commands (happens with some quirky devices)

@a-bailey
Copy link
Contributor Author

Makes sense thanks :)

@oferwald
Copy link

oferwald commented May 1, 2021

Another update:

got it working with the following configuration

{
        zigbeeModel: ['LXN59-CS27LX1.0'],
        model: 'LXN59-CS27LX1.0',
        vendor: 'Nue / 3A',
        description: 'Smart Zigbee 3.0 curtain controller',
        fromZigbee: [fz.tuya_cover_options],
        toZigbee: [tz.cover_state],
        whiteLabel: [{vendor: 'Zemismart', model: 'ZW-EU-01', description: 'Smart light relay - 1 gang'}],
        meta: {configureKey: 2},
        exposes: [e.cover_position(), exposes.enum('moving', ea.STATE, ['UP', 'STOP', 'DOWN'])],
        configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint1 = device.getEndpoint(1);
            await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff']);
            await reporting.onOff(endpoint1);

            await reporting.bind(endpoint1, coordinatorEndpoint, ['closuresWindowCovering'])
            //await reporting.currentPositionLiftPercentage(endpoint);
            
            device.powerSource = 'Mains (single phase)';
            device.type = 'EndDevice';
            device.save();
        },
    },

seems to work "fine" art first glance but getting some horrible timeout issues when switching between open/ close for example.

Publish 'set' 'state' to 'waschkueche_rollladen' failed: 'Error: Command 0x60a423fffe138c8a/1 closuresWindowCovering.downClose({}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":false,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Timeout - 1138 - 1 - 95 - 258 - 11 after 10000ms)'

Does this configuration also work for the LXX60 cover switch that you have?

@a-bailey
Copy link
Contributor Author

a-bailey commented May 2, 2021

Right now I'm using these 2 configurations.

Luckily 99% of my devices are 59 because I managed to get open/close/ stop working.
One my one 60 I can only do open and close haven't figured stop out yet.

{
        zigbeeModel: ['LXX60-CS27LX1.0'],
        model: 'LXX60-CS27LX1.0',
        vendor: '3A Smart Home DE',
        description: 'Zigbee Smart Curtain Switch',
        extend: extend.switch(),
        whiteLabel: [{vendor: '3A Smart Home DE', model: 'LXX60-CS27LX1.0', description: 'Smart Zigbee 3.0 curtain controller'}],
        meta: {configureKey: 2},
        configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint1 = device.getEndpoint(1);
            await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff']);
            await reporting.bind(endpoint1, coordinatorEndpoint, ['closuresWindowCovering'])
            await reporting.onOff(endpoint1);
            device.powerSource = 'Mains (single phase)';
            device.type = 'EndDevice';
            device.save();
        },
    },
    {
        zigbeeModel: ['LXN59-CS27LX1.0'],
        model: 'LXN59-CS27LX1.0',
        vendor: '3A Smart Home DE',
        description: 'Smart Zigbee 3.0 curtain controller',
        fromZigbee: [fz.cover_position_tilt],
        toZigbee: [tz.cover_state, tz.cover_position_tilt],
        whiteLabel: [{vendor: '3A Smart Home DE', model: 'LXN59-CS27LX1.0', description: 'Smart Zigbee 3.0 curtain controller'}],
        meta: {configureKey: 2, disableDefaultResponse: true},
        exposes: [e.cover_position(), exposes.enum('moving', ea.STATE, ['UP', 'STOP', 'DOWN'])],
        configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint1 = device.getEndpoint(1);
            await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff']);
            await reporting.onOff(endpoint1);

            await reporting.bind(endpoint1, coordinatorEndpoint, ['closuresWindowCovering'])
            await reporting.currentPositionLiftPercentage(endpoint);
            
            device.powerSource = 'Mains (single phase)';
            device.type = 'EndDevice';
            device.save();
        },
    },

@oferwald
Copy link

oferwald commented May 2, 2021

Thanks @a-bailey , this was the exact reason I asked because I wanted a configuration that supports stop on the LXX60. I guess I will have to wait or do some tweaking myself if I ever find the time for that. How about pushing your configurations to upstream?

@a-bailey
Copy link
Contributor Author

a-bailey commented May 2, 2021

I will push it/ open a PR but I wanted to try to get it a bit better, I got a zigbee sniffer running on my old usb stick and will try to progress from there! :) quite happy that stop is working on the 59 at least.

@oferwald
Copy link

oferwald commented May 2, 2021

That will be great! if you get to a point where stop is working on the 60, I will be more than happy to verify this on my setup.

@josi0815
Copy link

josi0815 commented May 13, 2021

Thanks @a-bailey, based on your work i got my LXN59 working . I changed a bit to get rid of a warning and to get better feedback into fhem`

{
zigbeeModel: ['LXN59-CS27LX1.0'],
model: 'LXN59-CS27LX1.0',
vendor: '3A Smart Home DE',
description: 'Smart Zigbee 3.0 curtain controller',
fromZigbee: [fz.cover_position_tilt, fz.LXN59_cover_state_via_onoff, fz.LXN59_tuya_cover_options],
toZigbee: [tz.cover_state, tz.cover_position_tilt],
whiteLabel: [{vendor: '3A Smart Home DE', model: 'LXN59-CS27LX1.0', description: 'Smart Zigbee 3.0 curtain controller'}],
meta: {configureKey: 2, disableDefaultResponse: true},
exposes: [e.cover_position(), exposes.enum('moving', ea.STATE, ['UP', 'STOP', 'DOWN'])],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint1 = device.getEndpoint(1);
await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint1);
await reporting.bind(endpoint1, coordinatorEndpoint, ['closuresWindowCovering'])
await reporting.currentPositionLiftPercentage(endpoint1);
device.powerSource = 'Mains (single phase)';
device.save();
},
},

added to "fromZigbee" :

LXN59_tuya_cover_options: {
    cluster: 'closuresWindowCovering',
    type: ['attributeReport', 'readResponse'],
    convert: (model, msg, publish, options, meta) => {
        const result = {};
        if (msg.data.hasOwnProperty('tuyaMovingState')) {
            const value = msg.data['tuyaMovingState'];
            const movingLookup = {0: 'DOWN', 1: 'UP', 2: 'STOP'};
            result.moving = movingLookup[value];
        }
        if (msg.data.hasOwnProperty('tuyaCalibration')) {
            const value = msg.data['tuyaCalibration'];
            const calibrationLookup = {0: 'ON', 1: 'OFF'};
            result.calibration = calibrationLookup[value];
        }
        if (msg.data.hasOwnProperty('tuyaMotorReversal')) {
            const value = msg.data['tuyaMotorReversal'];
            const reversalLookup = {0: 'OFF', 1: 'ON'};
            result.motor_reversal = reversalLookup[value];
        }
        return result;
    },
},
LXN59_cover_state_via_onoff: {
    cluster: 'genOnOff',
    type: ['attributeReport', 'readResponse'],
    convert: (model, msg, publish, options, meta) => {
        if (msg.data.hasOwnProperty('onOff')) {
            return {state: msg.data['onOff'] === 1 ? 'CLOSED' : 'OPEN'};
        }
    },
},`

@a-bailey
Copy link
Contributor Author

a-bailey commented May 13, 2021

Thanks @a-bailey, based on your work i got my LXN59 working . I changed a bit to get rid of a warning and to get better feedback into fhem`

{
zigbeeModel: ['LXN59-CS27LX1.0'],
model: 'LXN59-CS27LX1.0',
vendor: '3A Smart Home DE',
description: 'Smart Zigbee 3.0 curtain controller',
fromZigbee: [fz.cover_position_tilt, fz.LXN59_cover_state_via_onoff, fz.LXN59_tuya_cover_options],
toZigbee: [tz.cover_state, tz.cover_position_tilt],
whiteLabel: [{vendor: '3A Smart Home DE', model: 'LXN59-CS27LX1.0', description: 'Smart Zigbee 3.0 curtain controller'}],
meta: {configureKey: 2, disableDefaultResponse: true},
exposes: [e.cover_position(), exposes.enum('moving', ea.STATE, ['UP', 'STOP', 'DOWN'])],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint1 = device.getEndpoint(1);
await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint1);
await reporting.bind(endpoint1, coordinatorEndpoint, ['closuresWindowCovering'])
await reporting.currentPositionLiftPercentage(endpoint1);
device.powerSource = 'Mains (single phase)';
device.type = 'EndDevice';
device.save();
},
},

added to "fromZigbee" :

LXN59_tuya_cover_options: {
    cluster: 'closuresWindowCovering',
    type: ['attributeReport', 'readResponse'],
    convert: (model, msg, publish, options, meta) => {
        const result = {};
        if (msg.data.hasOwnProperty('tuyaMovingState')) {
            const value = msg.data['tuyaMovingState'];
            const movingLookup = {0: 'DOWN', 1: 'UP', 2: 'STOP'};
            result.moving = movingLookup[value];
        }
        if (msg.data.hasOwnProperty('tuyaCalibration')) {
            const value = msg.data['tuyaCalibration'];
            const calibrationLookup = {0: 'ON', 1: 'OFF'};
            result.calibration = calibrationLookup[value];
        }
        if (msg.data.hasOwnProperty('tuyaMotorReversal')) {
            const value = msg.data['tuyaMotorReversal'];
            const reversalLookup = {0: 'OFF', 1: 'ON'};
            result.motor_reversal = reversalLookup[value];
        }
        return result;
    },
},
LXN59_cover_state_via_onoff: {
    cluster: 'genOnOff',
    type: ['attributeReport', 'readResponse'],
    convert: (model, msg, publish, options, meta) => {
        if (msg.data.hasOwnProperty('onOff')) {
            return {state: msg.data['onOff'] === 1 ? 'CLOSED' : 'OPEN'};
        }
    },
},`

sounds promising! Does calibration work on your code? I'll try it out later but that would be awesome!
Edit: just tried it, seems to work better now the cover position actually seems to make a bit of sense, couldn't figure out how too calibrate it though to get a correct 0 - 100 cover handling

@josi0815
Copy link

josi0815 commented May 13, 2021

I use it to open a tilt window , so i do not use any calibration ( at least i'm not aware if i do ).
btw. i just removed the line device.type = 'EndDevice'; and it works as a router

@a-bailey
Copy link
Contributor Author

I'm using them for my shutters and they work quite well, still it would be great to calibrate the 0 - 100 position since they seem to support setting a position by value there has to be some way to tell the device where 0 and 100 is I suppose?

@cody82
Copy link

cody82 commented Jun 10, 2021

The code from @josi0815 works with my LXN59-CS27LX1.0. I did not try to calibrate it though. Just using open, close, stop.
The device gets quite warm, so I guess it draws quite a lot of power.

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the stale label Jul 11, 2021
@rrlevy
Copy link

rrlevy commented Jul 15, 2021

I'm trying to use this on my LXN59-CS27LX1.0, but since it's my first time setting up a non-supported zigbee device, I can't make it work.

I'm using zigbee2mqtt on Home Assistant, and I created a new external converter file zw-ec-01.js at the zigbee2mqtt folder like 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 e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['LXN59-CS27LX1.0'],
    model: 'LXN59-CS27LX1.0',
    vendor: '3A Smart Home DE',
    description: 'Smart Zigbee 3.0 curtain controller',
    fromZigbee: [fz.cover_position_tilt],
    toZigbee: [tz.cover_state, tz.cover_position_tilt],
    whiteLabel: [{vendor: '3A Smart Home DE', model: 'LXN59-CS27LX1.0', description: 'Smart Zigbee 3.0 curtain controller'}],
    meta: {configureKey: 2, disableDefaultResponse: true},
    exposes: [e.cover_position(), exposes.enum('moving', ea.STATE, ['UP', 'STOP', 'DOWN'])],
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint1 = device.getEndpoint(1);
        await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff']);
        await reporting.onOff(endpoint1);

        await reporting.bind(endpoint1, coordinatorEndpoint, ['closuresWindowCovering'])
        await reporting.currentPositionLiftPercentage(endpoint);
        
        device.powerSource = 'Mains (single phase)';
        device.type = 'EndDevice';
        device.save();
    },
};

module.exports = definition;

And I added the external converter declaration at the zigbee2mqtt configuration yml:

external_converters: ['zw-ec-01.js']

However, even after rebooting, my LXN59-CS27LX1.0 device still show up as "not compatible".

image

Are there any steps I'm missing here?

@github-actions github-actions bot removed the stale label Jul 15, 2021
@rrlevy
Copy link

rrlevy commented Jul 15, 2021

I justiced there was a typo on @a-bailey code:

            await reporting.currentPositionLiftPercentage(endpoint);

is supposed to be:

            await reporting.currentPositionLiftPercentage(endpoint1);

@rrlevy
Copy link

rrlevy commented Jul 15, 2021

My Open/Close commands to the switch are inverted but I couldn't find out how to change them. The state are read correctly, it's just the commands that are reversed.

I tried modifying this line to const reversalLookup = {1: 'OFF', 0: 'ON'}; but it still didn't work

Any tips on how to do that?

@Koenkk
Copy link
Owner

Koenkk commented Jul 15, 2021

You can mark the cover as being inverted by changing meta: {configureKey: 2, disableDefaultResponse: true}, to meta: {configureKey: 2, disableDefaultResponse: true, coverInverted: true},

@rrlevy
Copy link

rrlevy commented Jul 15, 2021

You can mark the cover as being inverted by changing meta: {configureKey: 2, disableDefaultResponse: true}, to meta: {configureKey: 2, disableDefaultResponse: true, coverInverted: true},

Well, this didn't work. I believe I will fix it by inverting the wires at the the switch.

@rrlevy
Copy link

rrlevy commented Jul 15, 2021

By the way, I declared the needed fromZigbee functions in the external converter itself. Is there a problem to do that or it should work? (I didn't want to change the node_modules folder to avoid being overwritten later)

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;

fz.LXN59_tuya_cover_options = {
    cluster: 'closuresWindowCovering',
    type: ['attributeReport', 'readResponse'],
    convert: (model, msg, publish, options, meta) => {
        const result = {};
        if (msg.data.hasOwnProperty('tuyaMovingState')) {
            const value = msg.data['tuyaMovingState'];
            const movingLookup = {0: 'DOWN', 1: 'UP', 2: 'STOP'};
            result.moving = movingLookup[value];
        }
        if (msg.data.hasOwnProperty('tuyaCalibration')) {
            const value = msg.data['tuyaCalibration'];
            const calibrationLookup = {0: 'ON', 1: 'OFF'};
            result.calibration = calibrationLookup[value];
        }
        if (msg.data.hasOwnProperty('tuyaMotorReversal')) {
            const value = msg.data['tuyaMotorReversal'];
            const reversalLookup = {0: 'OFF', 1: 'ON'};
            result.motor_reversal = reversalLookup[value];
        }
        return result;
    },
};

fz.LXN59_cover_state_via_onoff = {
    cluster: 'genOnOff',
    type: ['attributeReport', 'readResponse'],
    convert: (model, msg, publish, options, meta) => {
        if (msg.data.hasOwnProperty('onOff')) {
            return {state: msg.data['onOff'] === 1 ? 'CLOSED' : 'OPEN'};
        }
    },
};

const devices = [{
    zigbeeModel: ["LXN59-CS27LX1.0"],
    model: "LXN59-CS27LX1.0",
    vendor: "Zemismart",
    description: "Smart Zigbee 3.0 curtain controller",
    fromZigbee: [fz.cover_position_tilt, fz.LXN59_cover_state_via_onoff, fz.LXN59_tuya_cover_options],
    toZigbee: [tz.cover_state, tz.cover_position_tilt],
    whiteLabel: [{
        vendor: "3A Smart Home DE",
        model: "LXN59-CS27LX1.0",
        description: "Smart Zigbee 3.0 curtain controller"
    }],
    meta: { configureKey: 2, disableDefaultResponse: true, coverInverted: true },
    exposes: [
        e.cover_position(),
        exposes.enum("moving", ea.STATE, ["UP", "STOP", "DOWN"]),
    ],
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint1 = device.getEndpoint(1);
        await reporting.bind(endpoint1, coordinatorEndpoint, ["genOnOff"]);
        await reporting.onOff(endpoint1);
        await reporting.bind(endpoint1, coordinatorEndpoint, [
            "closuresWindowCovering",
        ]);
        await reporting.currentPositionLiftPercentage(endpoint1);
        device.powerSource = "Mains (single phase)";
        device.type = "EndDevice";
        device.save();
    },
},
];


module.exports = devices;

@Koenkk
Copy link
Owner

Koenkk commented Jul 16, 2021

Is there a problem to do that or it should work?

Nope, doesn't matter

@josi0815
Copy link

@rrlevy , you can try my modification I posted here. And please remove device.type = "EndDevice"; it works as a router , not as an endpoint

@e-i-k-e
Copy link

e-i-k-e commented Jul 19, 2021

Hello,
with help I got the device to work with me. (ioBroker / Zigbee)
I use the following.

const exposes = require('/opt/iobroker/node_modules/zigbee-herdsman-converters/lib/exposes');
const fz = {...require('/opt/iobroker/node_modules/zigbee-herdsman-converters/converters/fromZigbee'), legacy: require('/opt/iobroker/node_modules/zigbee-herdsman-converters/lib/legacy').fromZigbee};
const tz = require('/opt/iobroker/node_modules/zigbee-herdsman-converters/converters/toZigbee');
const extend = require('/opt/iobroker/node_modules/zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const reporting = require('/opt/iobroker/node_modules/zigbee-herdsman-converters/lib/reporting');

lfz = {
LXN59_tuya_cover_options: {
cluster: 'closuresWindowCovering',
type: ['attributeReport', 'readResponse'],
convert: (model, msg, publish, options, meta) => {
const result = {};
if (msg.data.hasOwnProperty('tuyaMovingState')) {
const value = msg.data['tuyaMovingState'];
const movingLookup = {0: 'DOWN', 1: 'UP', 2: 'STOP'};
result.moving = movingLookup[value];
}
if (msg.data.hasOwnProperty('tuyaCalibration')) {
const value = msg.data['tuyaCalibration'];
const calibrationLookup = {0: 'ON', 1: 'OFF'};
result.calibration = calibrationLookup[value];
}
if (msg.data.hasOwnProperty('tuyaMotorReversal')) {
const value = msg.data['tuyaMotorReversal'];
const reversalLookup = {0: 'OFF', 1: 'ON'};
result.motor_reversal = reversalLookup[value];
}
return result;
},
},
LXN59_cover_state_via_onoff: {
cluster: 'genOnOff',
type: ['attributeReport', 'readResponse'],
convert: (model, msg, publish, options, meta) => {
if (msg.data.hasOwnProperty('onOff')) {
return {state: msg.data['onOff'] === 1 ? 'CLOSED' : 'OPEN'};
}
},
},
}
module.exports = [
{
zigbeeModel: ['LXN59-CS27LX1.0'],
model: 'LXN59-CS27LX1.0',
vendor: '3A Smart Home DE',
description: 'Smart Zigbee 3.0 curtain controller',
fromZigbee: [fz.cover_position_tilt, lfz.LXN59_tuya_cover_options, lfz.LXN59_cover_state_via_onoff],
toZigbee: [tz.cover_state, tz.cover_position_tilt],
whiteLabel: [{vendor: '3A Smart Home DE', model: 'LXN59-CS27LX1.0', description: 'Smart Zigbee 3.0 curtain controller'}],
meta: {configureKey: 2, disableDefaultResponse: true},
exposes: [e.cover_position(), exposes.enum('moving', ea.STATE, ['UP', 'STOP', 'DOWN'])],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint1 = device.getEndpoint(1);
await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint1);

            await reporting.bind(endpoint1, coordinatorEndpoint, ['closuresWindowCovering'])
            await reporting.currentPositionLiftPercentage(endpoint1);

            device.powerSource = 'Mains (single phase)';
            device.type = 'EndDevice';
            device.save();
        },
    },

];

With a small script I can also open, stop and close the device.

sendTo("zigbee.0", "SendToDevice", {
"device": '60a423fffe7ddd1d',
"payload": {"state":"stop"}
});
// Befehle: open, stop, close

However, I have not yet found a solution on how to calibrate the device.
Has anyone already implemented something useful here?

@josi0815
Copy link

I wonder why device.type = 'EndDevice' is always used . They work as a router in my network. I believe for calibration you need a tuya gateway, but i am not sure. I won`t recommed these devices for shutters because of that. I use them for tilt windows, for my shutters i have a non zigbee solution.

@rrlevy
Copy link

rrlevy commented Jul 21, 2021

I use them for tilt windows, for my shutters i have a non zigbee solution.

@josi0815 could you share with us what do you use for shutters? I'm trying to figure out a solution for 5 shutters I have at home that are too heavy to use the motors with integrated zigbee/wifi and I was trying this device for this use case.

@josi0815
Copy link

@rrlevy I use 7 Rademacher RolloTube S-line shutters , connected via a DuoFern 9495 USB-Stick to my fhem backend running on a raspi 3

@cody82
Copy link

cody82 commented Jul 21, 2021

@rrlevy I have tried Lupus, Blaupunkt, LXN59-CS27LX1.0 shutter controllers and they are all crap in my opinion.
But the Tuya QS-Zigbee-C01 works very well and is cheap. They are rated up to 600W.

@rrlevy
Copy link

rrlevy commented Jul 22, 2021

@rrlevy I have tried Lupus, Blaupunkt, LXN59-CS27LX1.0 shutter controllers and they are all crap in my opinion.
But the Tuya QS-Zigbee-C01 works very well and is cheap. They are rated up to 600W.

That's great, @cody82 !! This is just what I was looking for! I'll get one to test with my shutters.

That makes me think, since it's also a Tuya device, if we can adapt its converter to the LXN59-CS27LX1.0
I'll take a look.

@rrlevy
Copy link

rrlevy commented Aug 18, 2021

I just bought the Lonsonho QS-Zigbee-C01 and it works perfectly well!

I don’t recommend this LXN59/LXX60 device. Just don’t buy it.

@github-actions
Copy link
Contributor

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

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

No branches or pull requests

7 participants