-
Notifications
You must be signed in to change notification settings - Fork 3.8k
chore: LiXee ZLinky: move cluster definition to ZHC #10704
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
base: master
Are you sure you want to change the base?
Conversation
src/devices/lixee.ts
Outdated
| event.data.device | ||
| .getEndpoint(1) | ||
| .read("liXeePrivate", ["linkyMode", "currentTarif"], {manufacturerCode: null}) | ||
| .read("liXeeCustom", ["linkyMode", "currentTarif"], {manufacturerCode: null}) |
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.
This is where I see one of the failures:
[2025-11-09 20:13:58] warning: zhc:lixee: Failed to read zigbee attributes during startup: Error: Cluster with name 'liXeeCustom' does not exist
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.
Try keeping the name of the cluster same as before. It can create weird states with existing networks when "just" renaming a cluster. (same thing for below comment)
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 can try but I assume I need to patch cluster.js, otherwise, how do I know that https://github.com/svenjochems/zigbee-herdsman/blob/8fee7b14de74c3e2d62dd3d7a15c73e161ff742d/src/zspec/zcl/definition/cluster.ts#L4518 won't be used instead of my custom cluster?
In #8728 (comment), the recommendation was to rename the cluster, that's why I did it.
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.
You can override herdsman locally for ZHC. You clone the repo, install deps, remove the cluster from cluster.ts, build the project. And then in ZHC folder, you do pnpm link ../zigbee-herdsman (to proper location). Make sure it shows it linked the location (else repeat the command, sometimes the first try doesn't work with pnpm). And then build ZHC again.
We found out some issues in a PR a short while back when renaming a custom cluster due to how it is saved/cached in the database (no longer points to the right place). It broke a lot of installations. Easiest is just to not rename it.
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.
Thanks for the hints. I was still working with external converter but it was getting too much hassle so I spawned a completely separate Z2M instance, with the current branch and with Koenkk/zigbee-herdsman#1547.
While restoring the old name fixed the not able to detect the Linky linky_mode error, this one still remains:
[2025-11-10 00:11:27] warning: zhc:lixee: Failed to read zigbee attributes during startup: Error: Cluster with name 'liXeePrivate' does not exist
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.
The following changes fixes it, do we want to do this?
diff --git a/src/devices/lixee.ts b/src/devices/lixee.ts
index 989b84d18..2c29dd553 100644
--- a/src/devices/lixee.ts
+++ b/src/devices/lixee.ts
@@ -1999,7 +1999,7 @@ export const definitions: DefinitionWithExtend[] = [
if (event.type === "start") {
event.data.device
.getEndpoint(1)
- .read("liXeePrivate", ["linkyMode", "currentTarif"], {manufacturerCode: null})
+ .read(0xFF66, ["linkyMode", "currentTarif"], {manufacturerCode: null})
.catch((e) => {
// https://github.com/Koenkk/zigbee2mqtt/issues/11674
logger.warning(`Failed to read Zigbee attributes during startup: ${e}`, NS);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.
No we don't, should use liXeePrivate here. If that doesn't work, before this line do console.log(event.data.device._customClusters) and see if the cluster is in there.
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.
@Koenkk, event.data.device._customClusters is an empty object: {}.
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.
Then for some reason the m.deviceAddCustomCluster is not being executed, can you compare if its done the same way as for other devices?
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.
They seem quite similar:
zigbee-herdsman-converters/src/devices/heiman.ts
Line 1115 in 9d90c31
| m.deviceAddCustomCluster("RadarSensorHeiman", { |
| extend: [local.modernExtend.addCustomClusterManuSpecificNikoConfig()], |
| extend: [m.onOff({powerOnBehavior: false}), ...shellyModernExtend.shellyCustomClusters(), shellyModernExtend.shellyWiFiSetup()], |
I tried to make the code look as close as possible to other cluster move PRs which I checked.
How can I make it easier for you to debug this problem?
| // biome-ignore lint/suspicious/noImplicitAnyLet: ignored using `--suppress` | ||
| let lMode; | ||
| try { | ||
| lMode = endpoint.clusters[clustersDef._0xFF66].attributes.linkyMode; |
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.
And this is the other read failure:
[2025-11-09 20:14:08] warning: zhc:lixee: Was not able to detect the Linky linky_mode. Default to historique
5e85bd9 to
34f1b61
Compare
Also improve logs.
34f1b61 to
00e51a0
Compare
See Koenkk/zigbee-herdsman-converters#10704. Also update tests to use another cluster.
| /* 0x0227 */ "daysProfileCurrentCalendar", | ||
| /* 0x0228 */ "daysProfileNextCalendar", | ||
| ] as const; | ||
| const kWhP = options?.kWh_precision ? options.kWh_precision : 0; |
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.
Unrelated question: why is the default to round to the kWh? Other devices I have seem to default to 2 decimals. Could we change the default?
Hello,
This is a work-in-progress attempt to finish the cluster move, based on work from #8728 and the discussion in Koenkk/zigbee-herdsman#1310.
See also Koenkk/zigbee-herdsman#1547.
I haven't looked at the CI errors yet because the main problem is that the custom cluster doesn't work for some code paths:
And
@Koenkk, @Nerivec, could you please help me make this work? I assume the cluster definition should occur "earlier" or that the code doesn't properly use the newly-defined cluster?