zigbee-herdsman-converters
zigbee-herdsman-converters copied to clipboard
feat: add support for Legrand 067761A
Add support for Legrand 067761A
- Device is described here
- Documentation PR: https://github.com/Koenkk/zigbee2mqtt.io/pull/2664
Questions
- 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
- 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 isbrightness_move_up
which is very far from what this is supposed to do :sweat_smile: - 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
Could you try with the generated external converter instead? Try this with the 1 April release tomorrow.
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
It does not seem that it detected anything really useful :shrug: 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
It does not seem that it detected anything really useful :shrug:
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.
As @mrskycriper mentioned, try again with the 1.36.1 release. This will generate more clean code.
Sure :+1:
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.
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?
@Diaoul if it works, please update the PR with it.