Openhab shows wrong Pressure in hPA from Zigbee pressure sensor

Hello everyone,

I have a zigbee sensor that reports both temperature and pressure, however, paperUI and Habpanel both show the pressure value inaccurately. For example, it is showing 1016.0 hPa instead of 101.6 hPA.

OH does in fact show the temperature accurately from the same sensor.

I confirmed from the logs that the sensor is sending the correct values for both temperature and pressure, see below:

2020-05-28 16:39:48.466 [DEBUG] [tsystems.zigbee.ZigBeeNetworkManager] - RX CMD: ReportAttributesCommand [Temperature Measurement: F3EF/1 -> 0000/1, cluster=0402, TID=00, reports=[AttributeReport [attributeDataType=SIGNED_16_BIT_INTEGER, attributeIdentifier=0, attributeValue=2710]]]
2020-05-28 16:39:48.479 [DEBUG] [tsystems.zigbee.ZigBeeNetworkManager] - RX CMD: ReportAttributesCommand [Pressure Measurement: F3EF/1 -> 0000/1, cluster=0403, TID=00, reports=[AttributeReport [attributeDataType=SIGNED_16_BIT_INTEGER, attributeIdentifier=0, attributeValue=1016]]]

How can I fix this?

Can you give us a clue what the sensor is please?

I think that the binding is using the standard definition for calculating this - I might be wrong though and will check, but it would be good to know what your sensor is as we recently found that the Xiaomi light sensor was providing the wrong calibration.

It’s a custom sensor that I built using the BMP280 module to measure the temperature and the pressure.

I just checked the code, and the binding seems to try and read the scale from the device. Have you implemented these attributes?

I’ve only implemented attributes 0x0000, 0x0001 and 0x0002 as those are the only ones that are mandatory.

Ok, can you tell me what the defaults are please? If not I’ll take a look next week, but if you can have a quick look I’ll see if I can check over the weekend. Maybe the default is not 1.

Sure… See below snippet from ZCL Spec, p.289:

This set provides for measurements with a fixed maximum resolution of 0.1 kPa.

4.5.2.2.1.1 MeasuredValue Attribute
MeasuredValue represents the pressure in kPa as follows:

MeasuredValue = 10 x Pressure

Where -3276.7 kPa <= Pressure <= 3276.7 kPa, corresponding to a MeasuredValue in the range 0x8001 to 0x7fff.

A MeasuredValue of 0x8000 indicates that the pressure measurement is invalid.

MeasuredValue is updated continuously as new measurements are made.

Please can you open an issue on GH and provide a debug log. I’ll try and look at it next week if I can find some time.

1 Like

I missed that you also mention temperature is not correct - this I’m really surprised about as there is no scaling required - it’s fixed at 2DP. Given that this works with a lot of other devices, I’m wondering how this is different here.

Again, please provide the logs so I can see what’s happening - this will allow me to see if it’s a problem with the binding, or something else.

Thanks.

No, I mentioned that the temperature IS correct :slight_smile:

Sorry - I misread when you said “both” - but it was referring to two UIs.

That’s good at least - if you can provide the logs for the pressure then I’ll try and find some time to look at it.

Logs attached. For troubleshooting purposes, I had the sensor send reports every 5-6 secs or so…

openhab - Copy.log (744.1 KB)

1 Like

From this log, it seems the binding is decoding this fine -:

2020-05-28 18:50:35.056 [DEBUG] [tsystems.zigbee.ZigBeeNetworkManager] - RX CMD: ReportAttributesCommand [Pressure Measurement: 99F6/1 -> 0000/1, cluster=0403, TID=00, reports=[AttributeReport [attributeDataType=SIGNED_16_BIT_INTEGER, attributeIdentifier=0, attributeValue=1016]]]
2020-05-28 18:50:35.078 [DEBUG] [ng.zigbee.handler.ZigBeeThingHandler] - 0013A20041A09CDB: Updating ZigBee channel state zigbee:device:04000BAB:0013a20041a09cdb:0013A20041A09CDB_1_pressure to 1016 hPa

Unless I’m missing something obvious (which is of course always possible :wink: ) it might be a problem with the UI?

you are right, I’m totally misinterpreting the UI… I was expecting to see units in kPa not in hPA. Nothing wrong with the UI either, Zigbee specifies the values in kPa but the UI shows values in hPA. If that’s by design, then false alarm :slight_smile:

Yes, it’s by design since hPa is the same as mbar and what you’d normally see on weather charts etc.

Anyway, glad it’s working :slight_smile: