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

feat: add support for Legrand 067761A #7288

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Diaoul
Copy link

@Diaoul Diaoul commented Mar 31, 2024

Add support for Legrand 067761A

Questions

  1. Currently this devices is described as "on/off" and I imagine this is enough but maybe there is something more semantically close to the buttons? e.g. fan high speed and fan low speed
  2. The device also supports genLevelCtrl but in the context of this particular switch I think it's not supposed to work. Anyways, if I want to add support for it, what should I do? The closest I found is brightness_move_up which is very far from what this is supposed to do 😅
  3. How do I add support for OTA? It should be the same as the Wireless remote switch from Legrand as well as it's on the NLT device list from here

@Koenkk
Copy link
Owner

Koenkk commented Mar 31, 2024

Could you try with the generated external converter instead? Try this with the 1 April release tomorrow.

@Diaoul
Copy link
Author

Diaoul commented Apr 1, 2024

What is the difference supposed to be? Would that be better? I tried to stick to the way Legrand devices work.
IIRC I had an array extend with a few things inside, let me check

@Diaoul
Copy link
Author

Diaoul commented Apr 1, 2024

It does not seem that it detected anything really useful 🤷
Side note: The weird characters are not escaped correctly

const {batteryPercentage, identify} = require('zigbee-herdsman-converters/lib/modernExtend');

const definition = {
    zigbeeModel: [' Remote fan controller'],
    model: ' Remote fan controller',
    vendor: ' Legrand',
    description: 'Automatically generated definition',
    extend: [batteryPercentage(), identify()],
    meta: {},
};

module.exports = definition

@mrskycriper
Copy link
Contributor

It does not seem that it detected anything really useful 🤷

Side note: The weird characters are not escaped correctly

const {batteryPercentage, identify} = require('zigbee-herdsman-converters/lib/modernExtend');



const definition = {

    zigbeeModel: [' Remote fan controller'],

    model: ' Remote fan controller',

    vendor: ' Legrand',

    description: 'Automatically generated definition',

    extend: [batteryPercentage(), identify()],

    meta: {},

};



module.exports = definition

I've recently added necessary modern extends and they will be in release version soon. It is strongly advised to use them instead of older split style converters.

@Koenkk
Copy link
Owner

Koenkk commented Apr 1, 2024

As @mrskycriper mentioned, try again with the 1.36.1 release. This will generate more clean code.

@Diaoul
Copy link
Author

Diaoul commented Apr 1, 2024

Sure 👍

@FabianMangold
Copy link
Contributor

FabianMangold commented Apr 9, 2024

Hi all,
Sorry to jump in here , just wanted to get some more context about this and check on how to proceed best in future.
(I know this may not be the right place for such questions, thus happy to follow it elsewhere!).

While the advantages of ModernExtends are obvious, what are the intentions on the long run ?
Provide "initial" support for devices until those get fully supported (manually) or replace split definitions altogether ?

Legrand devices are somewhat different, in that they do not "always" follow standards. To address this, we've implemented those quirks in vendor specific libs so far. While not ideal, this decouples those features from the "generic" implementation. How should we address this best in future ?
Wouldn't a vendor specific template, that could be extended a slightly more flexible approach ?

Thanks a lot for your insights.

@Diaoul
Copy link
Author

Diaoul commented May 1, 2024

Generated code with latest:

const {identify, battery, commandsOnOff, commandsLevelCtrl} = require('zigbee-herdsman-converters/lib/modernExtend');

const definition = {
    zigbeeModel: [' Remote fan controller'],
    model: ' Remote fan controller',
    vendor: ' Legrand',
    description: 'Automatically generated definition',
    extend: [identify(), battery(), commandsOnOff(), commandsLevelCtrl()],
    meta: {},
};

module.exports = definition;

Is that better?

@Koenkk
Copy link
Owner

Koenkk commented May 1, 2024

@Diaoul if it works, please update the PR with it.

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.

None yet

4 participants