Can anyone help me update the temp/humidity sensor for the Aqara and parse the pressure data?
The following lines need to be added:
under capabilities:
capability “Barometric Pressure”
under preferences:
input title: “Pressure Offset”, description: “This feature allows you to correct any pressure variations by selecting an offset. Ex: If your sensor consistently reports a pressure that’s 5 millibars too high, you’d enter ‘-5’. If 3 millibars too cold, enter ‘+3’. Please note, any changes will take effect only on the NEXT pressure change.”, displayDuringSetup: false, type: “paragraph”, element: "paragraph"
input “pressOffset”, “number”, title: “millibars”, description: “Adjust prssure by this many millibars”, range: “…”, displayDuringSetup: false
In the tiles section:
standardTile(“pressure”, “device.pressure”, inactiveLabel: false, decoration: “flat”, width: 2, height: 2) {
state “default”, label:’${currentValue} mb’, icon:“st.Weather.weather2”
What I don’t understand is how to parse the pressure message. From the log, it is as follows:
read attr - raw: 1DFC0104031C000029AC03140028FF100029BE24, dni: 1DFC, endpoint: 01, cluster: 0403, size: 1C, attrId: 0000, encoding: 29, value: 24be290010ff28001403ac
The format of the message is: 1DFC: zigbee network id
0104031C: device fingerprint, fixed
000029: filler
24be: pressure in tenths of millibars
290010ff280014: filler
03ac: pressure in millibars
It seems like the sensors are ALWAYS under reporting the pressure (based on my 4 sensors). The data of 0x24be is 9406 while the actual pressure is 1022mb, so an adjustment factor of 814 is required. Since the last section of data is just the first pressure measurement divided by 10. Since precision to the nearest tenth of a millibar isn’t required, the last data set could be used. In this case, an adjustment factor of 81 is required.
To convert to kPa, it’s simply the pressure in millibars divided by 10, so at least conversion on that is easy.
Thanks for the assistance.