(EDGE Driver-Mc): Zigbee Temp Sensor and Child Thermostat Mc, Zigbee Temp Sensor with Thermostat Mc

The date of the latest version is this

Uninstalled and installed again. Same version “2021-11-09” not “2021-11-12” and the Battery is still 0%

My is 2021-11-09

When I installed Aqara driver first time, it took until next day to show battery status

It will appear.
It only has a small change in the calculation for underfloor heating with ° F.

Is the same Aqara weather model that @milandjurovic71?

I can`t get the exact model number but i think is the same model.

Remove the battery, wait a few minutes for the voltage to rise due to the lack of charge and re-install it.
Let’s see if it emits a new value event

@Catalin_S Same model

Good evening
Is it not possible to display the atmospheric pressure in mBar and not in kPascal?
I know that the capabilities.atmosphericPressureMeasurement uses only kPa and integers up to 130 but with this unit of measurement it makes no sense to measure atmospheric pressure

1 Like

Buona serata, Giacomo,

Multiplying the kPascals by 10, they are converted to milli Bars, but in effect you would need 1 decimal place to obtain a useful conversion to milli Bars for atmospheric pressure.
A precision of 10 mb is poor precision.

The default libraries are the ones that handle these events.

1 Like

I’ve been working on it for weeks but can’t find a way to convert the units of measure. I know that the dth I used converted it to mbar.

Unfortunately I can’t convert the dth to edge. I’m still learning, but I like the new system.

Hello, @GiacomoF

In my driver I use the default libraries to handle atmospheric pressure.

@veonua has an edge driver for the Aqara weather sensor, which he shared, and it uses a handler to emit the atmospheric pressure event and it seems that the value sent by the device is in mBars and it is converted to kPascals (value / 10 ) and then the event is emitted in kPascal.


If it is not divided by 10, when issuing the event the libraries could give an out of range error. I don’t know, since I don’t have a sensor to test it.

If this does not work, it is also possible to obtain the last value stored, which will be in mB and send it to a custom capability with text format in mBars.

I don’t know if you have the default LUA libraries of the 39x firmware.
They are not updated and There are no atmospheric pressure defaults, but they are essential to see how Hub Edge libraries work and write code.

Let’s see if they update with all the defaults and be able to do more things

I found custom capability much more difficult than to convert groovy to Lua.
there are so many little things that can go wrong.

At first the custom capabilities seemed very complicated to me, but now, the basic ones such as a capability with a attribute type string or numeric… and a seter command, are easy for me to handle.

In fact I think that in your driver with create a custom capability:

  • Name: Atm Pressure
  • Attribute: atmPressure
  • Type: number
  • Range 1 to 1500
  • units: mBar

Capability presentation create with this .json file

    "dashboard": {
        "states": [
                "label": "{{atmPressure.value}} {{atmPressure.unit}}"
        "actions": [],
        "basicPlus": []
    "detailView": [
            "label": "Atmospheric Pressure in mBar:",
            "displayType": "state",
            "state": {
                "label": "{{atmPressure.value}}",
                "unit": "atmPressure.unit"
    "automation": {
        "conditions": [
                "label": "Atmospheric Pressure in mBar:",
                "displayType": "numberField",
                "numberField": {
                    "value": "atmPressure.value",
                    "valueType": "number",
                    "unit": "atmPressure.unit",
                    "range": [
        "actions": []
    "id": "xxxxxxxxxxxx.atmPressure",
    "version": 1

and adding these lines to your code:

-- Custom Capability AtmPressure declaration
local atm_Pressure = capabilities ["xxxxxxxxxxxx.atmPressure"]

-- driver template
local zigbee_temp_driver_template = {
  supported_capabilities = {

-- attributte handler
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"}))

-- emit even for custom capability in mBar
local mBar = value.value
device: emit_event (atm_Pressure.atmPressure (mBar))


With this you would have a device that gives the atmospheric pressure in two different units kPpa and mBar

1 Like

I hope GiacomoF understood what needs to be done. because I don’t.

Perfect. I managed. Thanks I learned a new thing.

I’m glad it served for something! :grinning_face_with_smiling_eyes:

You should have achieved something similar to this that @milandjurovic71 tried yesterday, who is always willing to try new things and propose alternatives.

We are looking for another easier solution, which is to show the Kpa with 1 decimal place and that would be equivalent to having mBars without having to use a custom capability

@milandjurovic71 is going to try several things and tell us the result. Thanks Milan!

I generate the event in the history. but it does not display it. Display in kPa only. Where am I wrong?

2021-11-15T11:41:17.968428012+00:00 INFO Xiaomi Temperature <ZigbeeDevice: 36086131-c339-44d7-9cac-beebfc386081 [0x1D26] (Temperatura Divano)> emitting event: {“attribute_id”:“atmPressure”,“capability_id”:“breathgarden30215.atmPressure”,“component_id”:“main”,“state”:{“value”:1044}}

It seems correct.
Did you create the capability presentation with the .json file?