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

Failed to configure - UNREPORTABLE-ATTRIBUTE - LeGrand 412171 #7831

Closed
glenharris opened this issue Aug 6, 2024 · 15 comments
Closed

Failed to configure - UNREPORTABLE-ATTRIBUTE - LeGrand 412171 #7831

glenharris opened this issue Aug 6, 2024 · 15 comments

Comments

@glenharris
Copy link

Hi there,

I have 2x Legrand 412171 (DIN rail mounted contactors - NZ, 230V). Both of them are giving 'Failed to configure' errors, however they seem to be working in Z2M with basic functionality. Z2M is identifying them as:
https://www.zigbee2mqtt.io/devices/412171.html#legrand-412171

The error I am receiving is:
2024-08-07 09:40:06Failed to configure 'R19 HTR Studio Guest', attempt 3 (Error: ZCL command 0x000474000084bf94/1 haElectricalMeasurement.configReport([{"minimumReportInterval":10,"maximumReportInterval":65000,"reportableChange":5,"attribute":"activePower"},{"minimumReportInterval":10,"maximumReportInterval":65000,"reportableChange":null,"attribute":"rmsCurrent"},{"minimumReportInterval":10,"maximumReportInterval":65000,"reportableChange":null,"attribute":"rmsVoltage"}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNREPORTABLE_ATTRIBUTE') at Endpoint.checkStatus (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:315:28) at Endpoint.zclCommand (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:770:26) at Endpoint.configureReporting (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:556:9) at setupAttributes (/app/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:76:13) at result.configure (/app/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:1482:29) at Object.configure (/app/node_modules/zigbee-herdsman-converters/src/index.ts:172:21) at Configure.configure (/app/lib/extension/configure.ts:121:13) at EventEmitter.wrappedCallback (/app/lib/eventBus.ts:174:17))

Formatted payload is:
[{"minimumReportInterval":10,"maximumReportInterval":65000,"reportableChange":5,"attribute":"activePower"},{"minimumReportInterval":10,"maximumReportInterval":65000,"reportableChange":null,"attribute":"rmsCurrent"},{"minimumReportInterval":10,"maximumReportInterval":65000,"reportableChange":null,"attribute":"rmsVoltage"}],{"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}

Running Zigbee2MQTT(1.37.1 commit: ea39d86) via a docker container, have about 60 other Zigbee devices that are working fine.

Please let me know any other information you require.

@glenharris
Copy link
Author

And forgot to say - thanks for an awesome piece of software!

@Koenkk
Copy link
Owner

Koenkk commented Aug 7, 2024

Does the power reporting work?

@glenharris
Copy link
Author

Partially. It appears to be reporting valid values for 'power' and 'power_apparent'. 'current' and 'voltage' are constantly shown as zero in the UI.

I have verified that power and power_apparent are changing in response to loads being added/removed. I have not seen non-zero values for current or voltage.

For completeness, here is a representative 'state' output:
{ "current": 0, "device_mode": "switch", "linkquality": 32, "power": 27, "power_apparent": 29, "power_on_behavior": "previous", "state": "ON", "update": { "installed_version": 5456895, "latest_version": 5916159, "state": "available" }, "voltage": 0, "auto_mode": null, "update_available": null }

Note 1: It is worth noting that I have also seen it report zero for power, when there should have been a small load of a few Watts. I mention this just in case someone sees a zero for power and thinks that value is not being reported. I have seen it report 1W for power, so I know it does report low values (but I haven't checked the actual load, so I dont know how accurate this is).
Note 2: I dont know how much precision these types of devices would normally report for current, but we are 230V here and I have had a 1kW power report, so I would have thought if current was being reported I should have seen 4A, so I am assuming a zero value means nothing has been reported by the unit.

@Koenkk
Copy link
Owner

Koenkk commented Aug 9, 2024

What value does it return when reading the voltage from the dev console?

Screenshot 2024-08-09 at 14 39 04

@glenharris
Copy link
Author

I tried most attributes that seemed plausible, and here is the list of attributes that I could read successfully:
image

A definite 'smoking gun' (that may not be related to the original UNREPORTABLE_ATTRIBUTE error above) is that the multiplier and divisor for the current and voltage is set to zero. I HAVE NOT tried modifying those attributes (in case it affects the state for your troubleshooting), but I suspect that if I set those to '1', then the current and voltage would start returning valid values.

Given that I can successfully query the attributes listed in the original error report (activePower, rmsCurrent, rmsVoltage), I wonder if there is some logic in the firmware that barfs (only for reporting) when the divisor/multiplier is zero?

@Koenkk
Copy link
Owner

Koenkk commented Aug 12, 2024

but I suspect that if I set those to '1', then the current and voltage would start returning valid values.

It's not something you can set on the device, as you can see the device returns 0 for rmsVoltage, so looks to me the device is broken.

@glenharris
Copy link
Author

Yes, I think you are correct. If I attempt to write any of the voltage/divisor attributes (including acPowerMultiplier, which has a non-zero value) I get a READ_ONLY error.

How can I test removing the rmsVoltage and rmsCurrent attributes from the device configuration (assuming that this might be the root cause of the original UNREPORTABLE_ATTRIBUTE error above)?

I am pretty sure I have found the current definition in /node_modules/zigbee-herdsman-converters/devices/legrand.js. Do I have to modify this in-place, or can I override this definition somehow?

(Note that I will be out of contact for a few weeks, so dont expect a quick update).

Thanks again for all your help.

@Koenkk
Copy link
Owner

Koenkk commented Aug 14, 2024

This should be disabled with the following ext converter: https://gist.github.com/Koenkk/e55c624617f8ecb0af52bb31bec4a929

  • save this as file next to configuration.yaml as ext_converter.js
  • add it to configuration.yaml:
external_converters:
  - ext_converter.js
  • start z2m,
  • in the frontend, check if the description of this device now ends with CUSTOM (this indicates the external converter has been loaded correctly)
  • check if issue is fixed

@glenharris
Copy link
Author

That seems to work. In particular, when I re-add the device using that new converter, I get:

[2024-08-29 15:16:16] info: 	zh:controller: Interview for '0x000474000084bf99' started
[2024-08-29 15:16:16] info: 	z2m: Device '0x000474000084bf99' joined
[2024-08-29 15:16:18] info: 	z2m: Starting interview of '0x000474000084bf99'
[2024-08-29 15:16:20] info: 	zh:controller: Succesfully interviewed '0x000474000084bf99'
[2024-08-29 15:16:20] info: 	z2m: Successfully interviewed '0x000474000084bf99', device has successfully been paired
[2024-08-29 15:16:20] info: 	z2m: Device '0x000474000084bf99' is supported, identified as: Legrand DIN contactor module CUSTOM (412171)
[2024-08-29 15:16:22] info: 	z2m: Configuring '0x000474000084bf99'
[2024-08-29 15:16:23] info: 	z2m: Successfully configured '0x000474000084bf99'

Reporting is then configured with OnOff/onOff and haElectricalMeasurement/activePower. Note that on the 'Exposes' page it is still showing acVoltage and acCurrent as 'null'.

When I revert back to use the original converter, I get:

[2024-09-01 10:04:23] info: 	zh:controller: Interview for '0x000474000084bf99' started
[2024-09-01 10:04:23] info: 	z2m: Device '0x000474000084bf99' joined
[2024-09-01 10:04:25] info: 	z2m: Starting interview of '0x000474000084bf99'
[2024-09-01 10:04:29] info: 	zh:controller: Succesfully interviewed '0x000474000084bf99'
[2024-09-01 10:04:29] info: 	z2m: Successfully interviewed '0x000474000084bf99', device has successfully been paired
[2024-09-01 10:04:29] info: 	z2m: Device '0x000474000084bf99' is supported, identified as: Legrand DIN contactor module (412171)
[2024-09-01 10:04:31] info: 	z2m: Configuring '0x000474000084bf99'
[2024-09-01 10:04:33] error: 	z2m: Failed to configure '0x000474000084bf99', attempt 1 (Error: ZCL command 0x000474000084bf99/1 haElectricalMeasurement.configReport([{"minimumReportInterval":10,"maximumReportInterval":65000,"reportableChange":5,"attribute":"activePower"},{"minimumReportInterval":10,"maximumReportInterval":65000,"reportableChange":null,"attribute":"rmsCurrent"},{"minimumReportInterval":10,"maximumReportInterval":65000,"reportableChange":null,"attribute":"rmsVoltage"}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNREPORTABLE_ATTRIBUTE')
    at Endpoint.checkStatus (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:315:28)
    at Endpoint.zclCommand (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:770:26)
    at Endpoint.configureReporting (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:556:9)
    at setupAttributes (/app/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:76:13)
    at result.configure (/app/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:1482:29)
    at Object.configure (/app/node_modules/zigbee-herdsman-converters/src/index.ts:172:21)
    at Configure.configure (/app/lib/extension/configure.ts:121:13)
    at EventEmitter.wrappedCallback (/app/lib/eventBus.ts:174:17))
(repeated 2 more times)

Reporting shows no elements configured to report. Note that on the 'Exposes' page it shows acVoltage and acCurrent as '0' rather than 'null'.

As far as I can tell, that means success.

Question: Can we update the custom converter to suppress the acVoltage and acCurrent attributes, or will that run the risk of degrading functionality for other devices (that identify using the same model strings)?

@Koenkk
Copy link
Owner

Koenkk commented Sep 3, 2024

Note that on the 'Exposes' page it is still showing acVoltage and acCurrent as 'null'.

Could you provide a screenshot of this?

@glenharris
Copy link
Author

Sure. When it is first added & configured, the values show up as 'Null V' and 'Null A'. After some time (variable, sometimes seconds, sometimes minutes, maybe reporting interval?), they change to 'N/A V' and 'N/A A'. If I press the 'refresh' button next to either of those elements (say the voltage value) they update as '0 V' and 'Null A'
image
image
image
image

@Koenkk
Copy link
Owner

Koenkk commented Sep 4, 2024

Found and fixed the issue!

Changes will be available in the dev branch in a few hours from now.

@glenharris
Copy link
Author

Thanks for this, much appreciated.

Do any changes need to be committed for the actual device (devices/legrand.ts), or is that custom converter you shared with me a one-off for my specific variant?

@Koenkk
Copy link
Owner

Koenkk commented Sep 5, 2024

Do any changes need to be committed for the actual device (devices/legrand.ts)

No, it was fixed somewhere else (the device code was correct). You can remove the external converter, the issue itself will be fixed after the next z2m release.

@glenharris
Copy link
Author

glenharris commented Sep 5, 2024 via email

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

No branches or pull requests

2 participants