-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Legrand 067776(A): Support calibration + Venetian mode #6333
Conversation
Can you try to include the manufacturer code when configuring the attribute reporting?
Can you provide the herdsman debug log when this is reported?
You can merge them, the |
Just to clarify the previous question (which you've probably edited), the function in exposes is required due to the self reference to meta (i.e. _067776.getCalibrationModes(this.meta)). When not wrapped in a function, the scope is different, and "this" undefined.
|
2927466
to
6230569
Compare
Regarding reporting: I've updated the code, and added the manufacturer code back to the configuration.
The reported attributes remain "generic":
Logs:
As can bee seen, those attributes were never requested and are "generic", not Manufacturer specific. |
I've isolated 2 frames that depict the situation pretty well. The first is the reply to the readrequest that was requested via the "calibration_mode" TZ converter (specifying the manufacturer code): The second is a simple attribute report (command 10) that happens to report the same attribute (61442) |
The white label also contains a description, this will be used if the fingerprint matches
I see the issue, I will check this later, or is this blocking this pr from being merged? |
Please disregard my comment regarding the whitelabel and merging the devices. No please merge, this is not blocking. The only feature that doesn't work (yet) is the reporting of the blind position when the switch is in "Venetian Mode". Other than that, everything is OK and unchanged. I will work on the missing reporting and converters once reporting works as expetected. I may have a patch for ZH regarding the reporting issue, i simply need a but more time.... unless you can fix it faster :) |
Hi @Koenkk, |
test/index.test.js
Outdated
@@ -313,7 +313,7 @@ describe('index.js', () => { | |||
|
|||
|
|||
if (device.meta) { | |||
containsOnly(['disableActionGroup', 'multiEndpoint', 'multiEndpointSkip', 'multiEndpointEnforce', 'applyRedFix', 'disableDefaultResponse', 'supportsEnhancedHue', 'timeout', 'supportsHueAndSaturation', 'battery', 'coverInverted', 'turnsOffAtBrightness1', 'coverStateFromTilt', 'pinCodeCount', 'tuyaThermostatSystemMode', 'tuyaThermostatPreset', 'tuyaDatapoints', 'tuyaThermostatPresetToSystemMode', 'thermostat', 'separateWhite', 'publishDuplicateTransaction', 'tuyaSendCommand'], Object.keys(device.meta)); | |||
containsOnly(['disableActionGroup', 'multiEndpoint', 'multiEndpointSkip', 'multiEndpointEnforce', 'applyRedFix', 'disableDefaultResponse', 'supportsEnhancedHue', 'timeout', 'supportsHueAndSaturation', 'battery', 'coverInverted', 'turnsOffAtBrightness1', 'coverStateFromTilt', 'pinCodeCount', 'tuyaThermostatSystemMode', 'tuyaThermostatPreset', 'tuyaDatapoints', 'tuyaThermostatPresetToSystemMode', 'thermostat', 'separateWhite', 'publishDuplicateTransaction', 'tuyaSendCommand', 'supportsLevelDetection'], Object.keys(device.meta)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, supportsLevelDetection
is Legrand specific, I propose to name it legrandSupportsLevelDetection
src/devices/legrand.ts
Outdated
.withDescription('Blinks the built-in LED to make it easier to identify the device'), | ||
e.binary('led_in_dark', ea.ALL, 'ON', 'OFF') | ||
.withDescription('Enables the built-in LED allowing to see the switch in the dark'), | ||
_067776.getCalibrationModes(this.meta), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the whole expose()
function only needed to read from this.meta
? If yes, I propose to drop the whole supportsLevelDetection
and do something like this:
exposes: [_067776.getCover(), e.action(['moving', 'identify']), _067776.getCalibrationModes(true)]
Where true
indicates it supportsLevelDetection
d3b86a8
to
1ce7721
Compare
Hi @Koenkk, |
src/lib/legrand.ts
Outdated
'Specific (NLLV)': {ID: 1, onlyNLLV: true}, | ||
'Up/Down/Stop': {ID: 2, onlyNLLV: false}, | ||
'Temporal': {ID: 3, onlyNLLV: false}, | ||
'Venetian (BSO)': {ID: 4, onlyNLLV: false}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last thing before this can be merged, could you make these snake_case
? e.g. classic_nllv
, venetian_bso
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those strings are required in the frontend, but let me change the structure somewhat, it is not optimum indeed.
I suppose you wish to avoid having string literals (containing special characters) as keys, right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the values itself (the structure is fine). No special characters indeed, no spaces and only lower case, e.g. Venetian (BSO)
should become venetion_bso
, Up/Down/Stop
-> up_down_stop
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all people use the frontend, e.g. when you publish directly to MQTT, you don't want to deal with special chars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point, thanks @Koenkk
Introduced a Legrand specific library
* Added array of supported calibration modes * Added FZ/TZ to support calibration modes * Added 067776(A) specific helper methods
Requires zigbee-herdsman PR#784
* Support calibration mode switching * Support Venetian (BSO) mode
Added manufacturer code to reporting
Avoid the usage of string litterals as keys
Changed description to snake_case
Thanks! |
hello, I use the Bticino N4027C switches. Since last night's update from Zigbee2MQTT in HA, my Bticino N4027C switches have had the Legrand picture automatically replaced (which I don't like) and I'm suddenly finding all the settings with calibration etc. The calibration of the blinds also works, but also with the blinds I find the tilt angle, which makes little sense (how can I remove it), with the venetian I have not managed to perform the calibration or change the tilt angle? Greetings Philipp |
Thank you FabianMangold, very well explained. |
I have also the same problem, my K4027C is recognized as 067776A and calibration does not work well. I also tried to calibrate, but classic_nllv is not working, with specific it starts calibrating but fails, tried with temporal but fails... The firmware seems equal but I think there are some differences... The other problem I found is that after the association with Z2Mqtt, the LED does not change color from RED or power off... |
This is a log extraction: With K4027C classic_nllv not working, with specific it calibrates but I think some parameter is not he same as 067776... |
Hi @philippk75, This is very unfortunate indeed. The 067776A were integrated in the Legrand device library using the following fingerprint:
Those attributes get reported by my actual Legrand 067776A devices. Given the fact the BTicino devices use the very same Legrand NLLV firmware (or it might be the otherway arround actually), i suppose that your BTicino devices report the same attributes. |
@philippk75 and @syntesys87, @philippk75: You are absolutely right regarding the tilt. This is only relevant when the switch is operating in venetian mode. Let's check if this option can be made conditional. And last but not least, the changes were tested on Legrand 067776 and 067776A. I cannot vouch for the BTicino devices, as i have none available for testing. In case those changes really don't work, we should fingerprint the devices and ensure the BTicino devices get detected and treated as such. |
hello, could you explan how send the attributes? |
The problem is that in every mode I set, the switch works as up/down/close. With classic_nllv the calibration does not start, also not in temporal mode. The switch operates as before. I think I have logs before and after the update, if you need. |
The easiest way is to use the Z2M frontend. Click on the device, open the "Dev Console" tabsheet, select the GenBasic Cluster, then select the attributes (please limit it to 4 items per iteration) and click Read. |
hello, i confirm, my Bticino N4027C ist able to control the tile inclination :-) |
@syntesys87: It could very well be, that the BTicino switches simply do not support those modes. Only Legrand / BTicino could tell really. Is there any way your could check if the official "App" supports those modes with those devices? |
Oh interesting @philippk75 (CC: @syntesys87). So it does work on BTicino devices too. |
hello, this ist the log, is this enough? für he other attibutes i get an erroer while reading? 2023-11-02 20:54:42Read result of 'genBasic': {"zclVersion":2,"appVersion":0,"stackVersion":67,"hwVersion":13} |
i understand, we were involuntarily added after the update and suddenly we no longer have bticino buttons but legrand :-) can this be reversed? |
The N4027C and K4027C seems to have the same firmware, for Zigbee2MQTT documentation. These are the screenshots of my configuration from Home+Control app of one switch and it's equal to all the others: I can provide also the logs from Netatmo integration. |
at the moment i can only change the inclination of the tile physically on the switch by holding longer the up or down buttom... i cannont selct a venetian mode in the driver of the device, ist there an option in the legrand driver? i didn't understand how to make the calibaration of the device, the procedure was too complex for me ;-) i only applyid the venetian calibration, but they change anything, the tilt option seems not to work |
Ja, deshalb frage ich nach den Details! Those attributes can be used to differentiate the devices in Z2M. Should Bticino devices get the feature set as well, or should we "try" to revert back to the former behaviour ? |
@philippk75: The calibration procedure is necessary, otherwise the "switch" cannot apply the tilt angle. |
I would like the bticino to be able to control the inclination of the slats. it would be nice to see the old picture back and the old name of the device :-) maybee you could me explan in german how to calibrate and how to set the ebenetian mode? |
maybee in german it's easier to understand? i have venetians and traditional roller shutter, it would be fine that the tile option would be visible only für venetians |
i tried your procedure for the venetian mode, but it doesn't work, maybee because i have an automatic calibration mode? for the calibration i only hd to push simultanly the up an down buttom, than the led lights yellow and the shutter movs up an down an then the led turn to blue. |
Well, the procedure may differ. The problem is that those are not officially documented. Regarding the remaining open items, I have to check with @Koenkk as Z2m doesn't support this (AFAIK) out of the box:
|
@FabianMangold how did you approach the debug of NLLV firmware and the tries you did for make this working? I would debug how it works in the app and replicate it in Zigbee2MQTT. I see from logs of Netatmo plugin in Home Assistant this: 2023-11-03 11:47:33.293 DEBUG (MainThread) [pyatmo.home] Setting state for home (62134d6bd95995623b03a8ba) according to {'modules': [{'id': '---', 'target_position': 49, 'bridge': ---'}]} (I removed MAC addresses from component and bridge). |
Hi @syntesys87; We still need to tackle the two points above however:
|
hello, temporal seems to work, at least the rollo corrket reacts accordingly... with classical.nllv and specific.nllv the calibration process also starts automatically and does everything by itself. what are your next activities? |
Hi @philippk75 , The next step is to identify the devices properly, so that the names match again. Would you mind opening another issue for that, so that we can work on it ? Thanks |
hello, i said that the specific calibration mode works and i can stwich to positions, not only 0%, 50% or 100%. I can not check if the temporal mode works, after that the rollo shutters worked. i found this document that explains the calibration for venetian in italian, the procedure sesms different: https://professionisti.bticino.it/sites/default/files/2022-08/2022_Novit%C3%A0%20impianto%20Smart_gestione%20tapparelle%20frangisole.pdf |
hello, thanks, this means that we have to wait the next zibee2mqtt update? or can we start somethings manuel? |
hi @FabianMangold, |
Hi, |
This PR:
@Koenkk: A couple of questions / remarks:
1.) The reporting does not work reliably yet. I am somewhat puzzled with the reporting of attributes. Can you give me pointers as how to fix this or where to look for potential issues ?
As an example, this is an excerpt from database.db for one of the devices:
Attribute 61444 (0xF004) should read "calibrationMode" following zigbee-herdsman PR#784, which as mentioned, works for readAttributes but not for reports.
2.) In order to avoid code duplication, i wanted to merge 067776 / 067776A devices in the device definition.
Shouldn't the following work ?
Thanks a lot.
P.S: I'll take a look at the failing test shortly. Looks like:
my new Meta definitionand including a function in "exposes"causes troubles.