zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

IKEA Vindstyrka Reporting

Open MaxMSchneider opened this issue 1 year ago • 18 comments

What happened?

Not able to set the reporting intervals for the measured value PM25 in the frontend. So far this sensor is spanning into the Zigbee-Network multiple times second causing delays in other actions in the ZigBee network.

What did you expect to happen?

Reporting action value being accepted, reporting less often.

How to reproduce it (minimal and precise)

Setting reporting action value to any number via the frontend

Zigbee2MQTT version

1.35.0-dev commit: b17c22b

Adapter firmware version

20210708

Adapter

Sonoff_Zigbee_3.0_USB_Dongle_Plus

Setup

Add-On in HA, RasPi 4B 8GB

Debug log

When setting the Attribute measuredValue:

Request 'zigbee2mqtt/bridge/request/device/configure_reporting' failed with error: 'ConfigureReporting 0x943469fffe7c1626/1 pm25Measurement([{"attribute":"measuredValue","minimumReportInterval":60,"maximumReportInterval":120,"reportableChange":10}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'INVALID_DATA_TYPE')

After checking the IKEA.ts https://github.com/koenkk/zigbee-herdsman-converters/blob/master/src%2Fdevices%2Fikea.ts#L1146-L1170 trying to set for measuredValueIkea:

Request 'zigbee2mqtt/bridge/request/device/configure_reporting' failed with error: 'ConfigureReporting 0x943469fffe7c1626/1 pm25Measurement([{"attribute":"measuredValueIkea","minimumReportInterval":60,"maximumReportInterval":120,"reportableChange":10}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":4476,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE')'

MaxMSchneider avatar Jan 13 '24 11:01 MaxMSchneider

I get 1 update every second. When trying to change the intervall I get the same responses as above.

dedors avatar Jan 17 '24 20:01 dedors

Failed to configure '0x287681fffe6f2bb1', attempt 3 (Error: ConfigureReporting 0x287681fffe6f2bb1/1 pm25Measurement([{"attribute":"measuredValueIkea","minimumReportInterval":60,"maximumReportInterval":120,"reportableChange":2}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":4476,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE') at Endpoint.checkStatus (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:331:28) at Endpoint.configureReporting (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:684:22) at Object.configure (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/devices/ikea.ts:1168:13) at Configure.configure (/opt/zigbee2mqtt/lib/extension/configure.ts:120:13) at Configure.onMQTTMessage (/opt/zigbee2mqtt/lib/extension/configure.ts:55:21) at EventEmitter.wrappedCallback (/opt/zigbee2mqtt/lib/eventBus.ts:174:17))

sanyafifa avatar Jan 19 '24 18:01 sanyafifa

I have the same problem. Is this a thing of defining the right values somewhere? I want to use this but it's flooding my HA-install, MQTT and logfiles with values in logfiles and history.

rippiedoos avatar Jan 22 '24 16:01 rippiedoos

@sjorge do you know if it's possible to change this?

Koenkk avatar Jan 22 '24 19:01 Koenkk

I think the PR/issue file on zh having to do with the data type for type pm25 might be related to this.

I’ll see if I can find my vindstyrke, to check but mine never worked very well to begin with.

sjorge avatar Jan 22 '24 20:01 sjorge

I can test it on my device :)

sanyafifa avatar Jan 22 '24 20:01 sanyafifa

I can confirm I see the error during pairing on mine too:

Zigbee2MQTT:error 2024-01-22 21:20:26: Failed to configure '0x90ab96fffefa5d91', attempt 1 (Error: ConfigureReporting 0x90ab96fffefa5d91/1 pm25Measurement([{"attribute":"measuredValueIkea","minimumReportInterval":60,"maximumReportInterval":120,"reportableChange":2}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":4476,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE')
    at Endpoint.checkStatus (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:319:28)
    at Endpoint.configureReporting (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:672:22)
    at Object.configure (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/devices/ikea.ts:1168:13)
    at Configure.configure (/Users/sjorge/Documents/repos/zigbee2mqtt/lib/extension/configure.ts:120:13)
    at EventEmitter.wrappedCallback (/Users/sjorge/Documents/repos/zigbee2mqtt/lib/eventBus.ts:174:17))
Zigbee2MQTT:info  2024-01-22 21:20:27: Configuring '0x90ab96fffefa5d91'

Which definitely was not the case before, probably related to https://github.com/Koenkk/zigbee-herdsman/issues/828

Edit:

@Koenkk Yep, I can confirm it's because the cluster.ts got update. I'm not sure on what the proper fix is :(

Zigbee2MQTT:debug 2024-01-22 21:23:58: Received Zigbee message from '0x90ab96fffefa5d91', type 'attributeReport', cluster 'msRelativeHumidity', data '{"measuredValue":4700}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2024-01-22 21:23:58: MQTT publish: topic 'zigbee2mqtt/0x90ab96fffefa5d91', payload '{"humidity":47,"linkquality":149,"pm25":3,"temperature":21,"voc_index":59}'
Zigbee2MQTT:debug 2024-01-22 21:24:01: Received MQTT message on 'zigbee2mqtt/bridge/request/device/configure_reporting' with data '{"attribute":"measuredValueIkea","cluster":"pm25Measurement","id":"0x90ab96fffefa5d91/1","maximum_report_interval":120,"minimum_report_interval":60,"reportable_change":2,"transaction":"88uyc-2"}'
Zigbee2MQTT:info  2024-01-22 21:24:01: Configured reporting for '0x90ab96fffefa5d91/1', 'pm25Measurement.measuredValueIkea'
Zigbee2MQTT:info  2024-01-22 21:24:01: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/configure_reporting', payload '{"data":{"attribute":"measuredValueIkea","cluster":"pm25Measurement","id":"0x90ab96fffefa5d91/1","maximum_report_interval":120,"minimum_report_interval":60,"reportable_change":2},"status":"ok","transaction":"88uyc-2"}'

For this one I commented pm25Measurement.measuredValue and removed the manufacturerCode from measuredValueIkea.

Sadly both conflict on the attributeID and have a different datatype :(

Edit2:

Zigbee2MQTT:error 2024-01-22 21:25:56: Request 'zigbee2mqtt/bridge/request/device/configure_reporting' failed with error: 'ConfigureReporting 0x90ab96fffefa5d91/1 pm25Measurement([{"attribute":"measuredValueIkea","minimumReportInterval":60,"maximumReportInterval":120,"reportableChange":2}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'INVALID_DATA_TYPE')'
Zigbee2MQTT:debug 2024-01-22 21:25:56: Error: ConfigureReporting 0x90ab96fffefa5d91/1 pm25Measurement([{"attribute":"measuredValueIkea","minimumReportInterval":60,"maximumReportInterval":120,"reportableChange":2}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'INVALID_DATA_TYPE')
    at Endpoint.checkStatus (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:319:28)
    at Endpoint.configureReporting (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:672:22)
    at Bridge.deviceConfigureReporting (/Users/sjorge/Documents/repos/zigbee2mqtt/lib/extension/bridge.ts:439:9)
    at Bridge.onMQTTMessage (/Users/sjorge/Documents/repos/zigbee2mqtt/lib/extension/bridge.ts:128:34)
    at EventEmitter.wrappedCallback (/Users/sjorge/Documents/repos/zigbee2mqtt/lib/eventBus.ts:174:17)

This was with the datatype set to unit16, just to dot all I's.

Ikea uses cluster 0x042a attribute 0x0000 with a datatype of singlePrec without a manufacturer code, which conflicts with the other one that has a datatype of uint16. I vaguely remember a PR for this to change that and rename the ikea one and add a manfacturerCode.

https://github.com/Koenkk/zigbee-herdsman/commit/c413c02ef4f7e8be9cd300da17cb9fb305f28f5a seems to be the commit, but I'm not sure how this ever worked then. I guess this is another one for the pile of having somehow having the same non-ZCL clusters be somehow linked to a model could have fixed :(

@koenkk not sure how to cleanly fix this, let me think on this. If you have an idea but no device to test, I can always test.

sjorge avatar Jan 22 '24 20:01 sjorge

So if I understand correctly it works after changing to:

measuredValueIkea: {ID: 0x0000, type: DataType.singlePrec},

Koenkk avatar Jan 23 '24 18:01 Koenkk

So if I understand correctly it works after changing to:

measuredValueIkea: {ID: 0x0000, type: DataType.singlePrec},

Yes, but then it overlaps with the regular measuredValue which has the same id but different datatype

sjorge avatar Jan 23 '24 18:01 sjorge

What if we swap them like this:

            measuredValue: {ID: 0x0000, type: DataType.uint16},
            measuredValueIkea: {ID: 0x0000, type: DataType.singlePrec, manufacturerCode: ManufacturerCode.IKEA_OF_SWEDEN},
            //default cluster spec: values reported as uint16

Koenkk avatar Jan 23 '24 18:01 Koenkk

I don’t think that will work, yesterday i tried with just measuredValue commented and it didn’t pick the ikea one. I’m guessing because there is no manufacturerCode send by the device.

sjorge avatar Jan 23 '24 19:01 sjorge

I think the best way to fix is probably removing the ikea one from cluster.ts and specifying the data type during the configure reporting. For decoding the dt doesn’t seem to matter ?

sjorge avatar Jan 23 '24 19:01 sjorge

I think the best way to fix is probably removing the ikea one from cluster.ts and specifying the data type during the configure reporting. For decoding the dt doesn’t seem to matter ?

Sounds good! (if the received value is still correct)

Koenkk avatar Jan 24 '24 20:01 Koenkk

This should hopefully be fixed in the february release (https://github.com/Koenkk/zigbee-herdsman-converters/pull/6972)

sjorge avatar Jan 28 '24 14:01 sjorge

Zigbee2MQTT version 1.35.2-dev commit: 6621f6fd

Error 2024-02-01 22:49:43Failed to configure '0xa4c13828302637fa', attempt 2 (Error: Read 0xa4c13828302637fa/1 hvacUserInterfaceCfg(["programmingVisibility"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE') at Endpoint.checkStatus (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:319:28) at Endpoint.read (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:469:22) at setupAttributes (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:63:13) at configure (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/lib/modernExtend.ts:84:17) at Object.configure (/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/src/index.ts:140:25) at Configure.configure (/opt/zigbee2mqtt/lib/extension/configure.ts:120:13) at EventEmitter.wrappedCallback (/opt/zigbee2mqtt/lib/eventBus.ts:174:17))

sanyafifa avatar Feb 01 '24 19:02 sanyafifa

ZigBeee2MQTT version 1.36 ufortunately the problem still happens so the february release (https://github.com/Koenkk/zigbee-herdsman-converters/pull/6972) does not seem to help. Any idea on hoy to solve How to write an external definition to solve this issue? Request 'zigbee2mqtt/bridge/request/device/configure_reporting' failed with error: 'ConfigureReporting 0x943469fffe814aa4/1 pm25Measurement([{"attribute":"measuredValue","minimumReportInterval":60,"maximumReportInterval":120,"reportableChange":2}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'INVALID_DATA_TYPE')'

Request 'zigbee2mqtt/bridge/request/device/configure_reporting' failed with error: 'ConfigureReporting 0x943469fffe814aa4/1 pm25Measurement([{"attribute":"measuredValueIkea","minimumReportInterval":60,"maximumReportInterval":120,"reportableChange":2}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Don't know value type for 'undefined')'

FranciscoSGPa avatar Mar 13 '24 19:03 FranciscoSGPa

Reporting configuration resolved with MQTT message according https://github.com/Koenkk/zigbee2mqtt/issues/21807

FranciscoSGPa avatar Mar 22 '24 18:03 FranciscoSGPa

In the dev release / next release in may, it should now be possible to configure reporting via the frontend again.

sjorge avatar Apr 28 '24 18:04 sjorge