Hi @nayelyz
I’m curious to know how the addition of the temperatureRange attribute (MinMeasuredValue and MaxMeasuredValue attributes) will affect the temperatureMeasurement capability, I can’t find any information in the documentation and I see a lot of code changes in the stock drivers code and 54.x libraries.
I see that this attribute has been added to the temperatureMeasurement capability and in its presentation it is now used as temperature supportedValues .
What is it and how will this supportedValues field limit the temperature values? nothing is explained in the documentation, capability presentation section.
temperatureMeasurement Presentation
{
"dashboard": {
"states": [
{
"label": "{{temperature.value}} {{temperature.unit}}",
"alternatives": [
{
"key": "C",
"value": "°C",
"type": "active"
},
{
"key": "K",
"value": "°K",
"type": "active"
},
{
"key": "F",
"value": "°F",
"type": "active"
}
]
}
],
"actions": [],
"panelItems": []
},
"detailView": [
{
"label": "{{i18n.label}}",
"displayType": "slider",
"slider": {
"range": [
-20,
50
],
"unit": "temperature.unit",
"supportedValues": "temperatureRange.value",
"value": "temperature.value",
"valueType": "number"
}
}
],
"automation": {
"conditions": [
{
"label": "{{i18n.label}}",
"displayType": "numberField",
"numberField": {
"value": "temperature.value",
"valueType": "number",
"unit": "temperature.unit",
"range": [
-20,
50
],
"supportedValues": "temperatureRange.value"
}
}
],
"actions": []
},
"id": "temperatureMeasurement",
"version": 1
}
According to the zigbee 3.0 cluster libarary specification, MinMeasuredValue and MaxMeasuredValue attributes are used in all measurement clusters and determine the range of values between which the device operates, in this case minimum and maximum temperature range.
Although they are mandatory attributes, they are allowed to not have a minimum and maximum value defined and those attributes will have a value of 0x8000.
My doubt about how this will affect users comes from:
- There is a PR that has modified 38 files of different stock drivers, which have temperature measurement, to add the handling of these attributes to emit them in the temperatureMeasurement capability, temperatureRange attribute, as an object type, which includes the MinMeasuredValue and MaxMeasuredValue values.
- In the 54.x libraries, the handling of the temperatureRange attribute has been added to the temperatureMeasurement defaults library This makes most of the changes in the stock drivers of the previous PR unnecessary, since it will be handled by default now, in fact you can see that attribute emitted by default on the advanced users page.
- the presentation of temperatureMeasurement has a range of -20º to 50º. Is this range going to be replaced by the “supportedValues” range of the temperatureRange attribute when there are valid values or with what criteria will they be applied?
I say all this because in the devices I have installed I see a very different behavior of these MinMeasuredValue and MaxMeasuredValue attributes and I am worried about how this will affect when it works, maybe in the next app update?
- For example, the Aeotec (smartthings, samjin) multipurpose and motion sensors do not comply with the zigbee specification since they emit a value = 0 for MinMeasuredValue and MaxMeasuredValue, which prevents those values from being emitted in the temperatureRange attribute since one condition is that MinMeasuredValue must always be less than MaxMeasuredValue.
2024-10-14T18:09:28.997582978Z INFO Zigbee Contact Mc <ZigbeeDevice: d5c46aef-8f26-4442-a671-2f36f00e42e5 [0xD599] (Puerta Casa)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xD599, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: TemperatureMeasurement >, lqi: 0xD8, rssi: -74, body_length: 0x0009, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x3B, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0002, ZclStatus: SUCCESS, DataType: Int16, MaxMeasuredValue: 0 > > > >
2024-10-14T18:09:29.103696603Z DEBUG Zigbee Contact Mc Puerta Casa device thread event handled
2024-10-14T18:09:29.233272270Z TRACE Zigbee Contact Mc Received event with handler zigbee
2024-10-14T18:09:29.241767562Z INFO Zigbee Contact Mc <ZigbeeDevice: d5c46aef-8f26-4442-a671-2f36f00e42e5 [0xD599] (Puerta Casa)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xD599, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: TemperatureMeasurement >, lqi: 0xD8, rssi: -74, body_length: 0x0009, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x3C, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0001, ZclStatus: SUCCESS, DataType: Int16, MinMeasuredValue: 0 > > > >
- There are Tuya TS0201 sensors, widely used in the community, which store in these attributes the minimum and maximum values that the sensor has been measuring during its operation.
This also does not meet the specification, but it does meet the condition for the temperatureRange attribute to be emitted with values that have nothing to do with the device’s operating limits.
Could this restrict device operation?
EDIT: I have another device a sonoff SNZB02 (manufacturer: eWeLink, model :TH01), and It seems that this one does comply with the Zigbee 3.0 specification and has a defined operating range between -10ºC and 50ºC
2024-10-14T19:16:53.275667619Z INFO Zigbee Temp Sensor with Thermostat Mc <ZigbeeDevice: 18f2c16e-ab66-4e51-be10-77c261ffd14e [0x103C] (Temp Humid Cocina)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x103C, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: TemperatureMeasurement >, lqi: 0xD2, rssi: -67, body_length: 0x0009, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x0A, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0002, ZclStatus: SUCCESS, DataType: Uint16, MaxMeasuredValue: 5000 > > > >
2024-10-14T19:16:53.444419286Z DEBUG Zigbee Temp Sensor with Thermostat Mc Temp Humid Cocina device thread event handled
2024-10-14T19:16:53.817998411Z TRACE Zigbee Temp Sensor with Thermostat Mc Received event with handler zigbee
2024-10-14T19:16:53.857533536Z INFO Zigbee Temp Sensor with Thermostat Mc <ZigbeeDevice: 18f2c16e-ab66-4e51-be10-77c261ffd14e [0x103C] (Temp Humid Cocina)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x103C, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: TemperatureMeasurement >, lqi: 0xD4, rssi: -68, body_length: 0x0009, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x0B, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0001, ZclStatus: SUCCESS, DataType: Int16, MinMeasuredValue: -1000 > > > >
- I don’t have any other models of temperature measuring devices, but there are many more models in the drivers with possible non-standard operations.
Will this have any consequences on future operation?
I wouldn’t understand so much code change for nothing and perhaps it would be good to know how this is going to be implemented.
Maybe I’m putting the bandage on before I have the wound, but I want to try to be clear about what I can do so that these automatic temperature ranges, which I understand are intended to be applied at some point, do not affect me negatively.
Maybe you could get some information about from the team for us?
Thanks