veonua / SmartThingsEdge-Xiaomi

SmartThings Edge drivers for XIaomi and Aqara devices
MIT License
67 stars 59 forks source link

Xiaomi aqara temp sensor pressure #12

Closed pxFIN closed 2 years ago

pxFIN commented 2 years ago

Taken from Smartthings CLI logcat:

(Aqara Weather)> emitting event {"attribute_id":"atmosphericPressure","capability_id":"atmosphericPressureMeasurement","component_id":"main","state":{"unit":"kPa","value":104}} (Aqara Weather)> emitting event {"attribute_id":"atmosPressure","capability_id":"legendabsolute60149.atmosPressure","component_id":"main","state":{"value":1041}}

So there seems to be two events and in Edge driver:

device:emit_event(capabilities.atmosphericPressureMeasurement.atmosphericPressure({value = utils.round(mBar/10), unit = "kPa"})) device:emit_event(atmos_Pressure.atmosPressure(mBar))

Thus i reckon the last emit in driver is always relevant ?

Future possibility to choose mbar or kPa ? (for example in device settings)

veonua commented 2 years ago

feel free to create a PR,

personally, I don't see any value in the pressure measurement personally, especially in different units.