Hello @nayelyz,
The accuracy of the atmospheric pressure information is very poor, (1 kPascal = 10 milli Bars).
Viewing the logs, the sensor sends the measurement with much more precision (1 mBars). It goes to kPascal dividing by 10 and rounding with math.floor () in order to it enters in the range of 0 to 110 kPa of the stock capability.
local pressure_value_attr_handler = function (driver, device, value, zb_rx)
local kPa = math.floor (value.value / 10)
device: emit_event (capabilities.atmosphericPressureMeasurement.atmosphericPressure ({value = kPa, unit = "kPa"}))
2021-11-14T19:09:25.145465484+00:00 INFO Zigbee Temp Humidity Sensor v2.3 <ZigbeeDevice: b40690d8-bbee-4f0e-affb-6885dca374c4 [0x7463] (Aqara Weather)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x7463, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: PressureMeasurement >, lqi: 0xFF, rssi: -61, body_length: 0x0011, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x3A, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Int16, MeasuredValue: 1011 >, < AttributeRecord || AttributeId: 0x0014, DataType: Int8, Scale: -1 >, < AttributeRecord || AttributeId: 0x0010, DataType: Int16, ScaledValue: 10111 > > > >
2021-11-14T19:09:25.154597256+00:00 TRACE Zigbee Temp Humidity Sensor v2.3 Found ZigbeeMessageDispatcher handler in st-zigbee-motion
2021-11-14T19:09:25.158213814+00:00 INFO Zigbee Temp Humidity Sensor v2.3 Executing ZclClusterAttributeValueHandler: cluster: PressureMeasurement, attribute: MeasuredValue
2021-11-14T19:09:25.162156200+00:00 INFO Zigbee Temp Humidity Sensor v2.3 <ZigbeeDevice: b40690d8-bbee-4f0e-affb-6885dca374c4 [0x7463] (Aqara Weather)> emitting event: {“component_id”:“main”,“capability_id”:“atmosphericPressureMeasurement”,“state”:{“value”:101,“unit”:“kPa”},“attribute_id”:“atmosphericPressure”}
With @milandjurovic71 have tried a custom capability to show atmospheric pressure in mBar and works well.
But it would be easier to remove the math.floor () so that it displays the information in kPa with 1 decimal place, since it is a numeric type and should allow decimals, but the standard presentation should prevent decimals from being displayed
Emit event is correct in logs, not errors, but shows 0 kPa in app.
2021-11-14T19:04:27.151607398+00:00 INFO Zigbee Temp Humidity Sensor v2.3 <ZigbeeDevice: b40690d8-bbee-4f0e-affb-6885dca374c4 [0x7463] (Aqara Weather)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x7463, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: PressureMeasurement >, lqi: 0xFF, rssi: -62, body_length: 0x0011, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x1A, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Int16, MeasuredValue: 1011 >, < AttributeRecord || AttributeId: 0x0014, DataType: Int8, Scale: -1 >, < AttributeRecord || AttributeId: 0x0010, DataType: Int16, ScaledValue: 10110 > > > >
2021-11-14T19:04:27.160876780+00:00 TRACE Zigbee Temp Humidity Sensor v2.3 Found ZigbeeMessageDispatcher handler in st-zigbee-motion
2021-11-14T19:04:27.163890870+00:00 INFO Zigbee Temp Humidity Sensor v2.3 Executing ZclClusterAttributeValueHandler: cluster: PressureMeasurement, attribute: MeasuredValue
2021-11-14T19:04:27.168215448+00:00 INFO Zigbee Temp Humidity Sensor v2.3 <ZigbeeDevice: b40690d8-bbee-4f0e-affb-6885dca374c4 [0x7463] (Aqara Weather)> emitting event: {“component_id”:“main”,“capability_id”:“atmosphericPressureMeasurement”,“state”:{“value”:101.1,“unit”:“kPa”},“attribute_id”:“atmosphericPressure”}
2021-11-14T19:04:27.181023849+00:00 DEBUG Zigbee Temp Humidity Sensor v2.3 Aqara Weather device thread event handled
2021-11-14T19:04:50.501043659+00:00 TRACE Zigbee Temp Humidity Sensor v2.3 Received event with handler zigbee health poll
Couldn’t this stock presentation be modified in order to give an acceptable precision for atmospheric pressure, showing xxx.x kPa?
Thanks