Deconz: Stuck with Aqara sensors and 2.5.0 snapshot

Hi everyone,

I am lost with my deconz configuration. I read every possible post on the forum but I guess there is some basic mistake I make. I hope someone can help me find it. (Beware: I am still a newbie.)

My config: OH 2 running on Raspi 3B+, Conbee Stick running on another Raspi 3B+. Both are on the same network segment.

Here is what I did:

  • Phoscon app discovered all my Zigbee devices: Hue lights, Hue dimmers, Xiaomi Aqara Temperature sensors, motion and presence sensors. All values are displayed in the Phoscon app.
  • First I tried the Hue and Deconz bindings in Paper UI. I was able to get the API keys and the IDs of the devices using the REST API.
  • I did not get values for humidity and motion in Open Hab
  • I found this guide http://gsf.diphda.uberspace.de/smarthome/2019/03/24/teil-4-openhab2-frust-mit-zigbee/ and copied the 2.5.0 deconz snapshot into my addons directory. Before that, I uninstalled the hue and deconz bindings in Paper UI.

The guide says I should see the newly installed deconz binding in Paper UI now. However, it does not appear. Do I have to do anything to activate the jar file?

For

things show deconz:deconz:homeserver

I receive

Could not find thing with UID deconz:deconz:homeserver

What am I doing wrong? If you need any additional information, I will provide it. Thanks for your help.

You forgot to tell your openHAB version. Please note that OH 2.4 is not compatible to most OH 2.5 snapshot bindings, because dependencies do not match anymore.

Your log file or the karaf / openHAB console should tell you if the bundle “deconz” is started.

Hi David, I guess you named the problem. I am running OH 2.4. I will check how to upgrade to OH 2.5 and try if this solves my issue.

Can you tell me what I have to type in the openHAB console to find out whether the bundle is running?

Next step: I upgrade to openHab 2.5.0.M1-1

In console I list my installed bundles using bundle:list. For deconz I see

191 │ Installed │ 80 │ 2.5.0.201903261051 │ Dresden Elektronik Deconz Bin

However, I still get the error for show things deconz:deconz:homeserver. I activated 3rd party discovery mode but this does not solve the problem.

When I try to start the bundle with bundle:start 191 I receive

Error executing command: Error executing command on bundles:
Error starting bundle 191: Could not resolve module: org.openhab.binding.deconz [191]
Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:=“optional”
Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.upnp

You need a deconz.things file in the /things folder, containing:

Bridge deconz:deconz:homeserver [ host="127.0.0.1", apikey="0950775C33" ]

host & apikey will vary :slight_smile:
Note that the M1 version only supports Phoscon on port 80.

Also: from the doc.

deCONZ also acts as a HUE bridge. This binding is meant to be used together with the HUE binding which makes the lights and plugs available.

Thank you @OMR. I have my deconz.things setup and I was able to retrieve my API key while I was still running the 2.4 version of the binding. For the IP address, I set the address of my second Raspi where the Conbee stick is:

Bridge deconz:deconz:homeserver [ host=“192.168.178.77” , apikey=“my-api-key” ]

Controlling my lights was working fine and I also get temperature readings from the Aqara sensors (in one case very odd “2114 degrees” instead of “21”). But I can’t get humidity values and I don’t get anything from the vibrationsensor and the presencesensor:

deconz.things

temperaturesensor GF_Kueche_aquara_temperature "Küche Aq Temperatur" [ id="15" ] humiditysensor GF_Kueche_aquara_humidity "Küche Luftfeuchte" [ id="16" ] pressuresensor GF_Kueche_aquara_pressure "Küche Luftdruck" [ id="17" ] vibrationsensor C_Office_aquara_vibe "Büro Vibration" [ id="23" ] presencesensor C_FlurKg_bwm "Hall Presence" [ id="24"]

hue.items

Number:Temperature GF_Kitchen_Temperature “Küche Temperatur [%.1f °C]” (aqara_sensoren, GF_Kitchen) { channel=“deconz:temperaturesensor:homeserver:GF_Kueche_aquara_temperature:temperature” }
Number:Dimensionless GF_Kitchen_Humidity “Küche Luftfeuchte[%.1f %%]” (aqara_sensoren, GF_Kitchen) { channel=“deconz:humiditysensor:homeserver:GF_Kueche_aquara_humidity:humidity” }
Number:Pressure GF_Kitchen_Pressure “Küche Luftdruck [%.1f hPa]” (aqara_sensoren, GF_Kitchen) { channel=“deconz:pressuresensor:homeserver:GF_Kueche_aquara_pressure:pressure” }
DateTime C_Kitchen_Update “Letztes Update Hobby” (aqara_sensoren, GF_Kitchen) { channel=“deconz:temperaturesensor:homeserver:GF_Kueche_aquara_temperature:last_updated” }
Switch C_Office_Vibe “Office Vibration” (aqara_sensoren) { channel=“deconz:vibrationsensor:homeserver:C_Office_aquara_vibe:vibration” }
Switch C_FlurKg_BWM “Hall Presence [%s]” (aqara_sensoren, C_FlurKg) { channel=“deconz:presencesensor:homeserver:C_FlurKg_bwm:presence” }

Hmm, in cases like this, this is a invaluable tool:


Many other plugins also proved the same, but I’m very happy with this one.
It let you poll the REST api of deconz and in your case the /sensors group is of interest:

This enables you to check the ids and also check that values are updated from the sensors. (append an id at the end of the url in order to poll just one sensor)

Your strange 2114 value is just the 2 decimals. Value is 21.14

I am using YARC. It helped me to determine my IDs. It reads all sensors and lights well and I get all values.

However, I can’t transfer them to openHAB. Do you have an idea what I am doing wrong?

So, your problem now on M1, is that you cannot activate the binding?

openhab> list | grep -i deconz
225 │ Active   │  80 │ 2.5.0.M1               │ Dresden Elektronik Deconz Binding
openhab>

Just realized our addons are not on the same version!

Try:

sudo apt-get install openhab2-addons=2.5.0~M1-1

I am running the right version now:

225 │ Installed │ 80 │ 2.5.0.M1 │ Dresden Elektronik Deconz Bin

When I bundle:start 225 I do now receive

Error executing command: **Error executing command on bundles:** Error starting bundle 225: Could not resolve module: org.openhab.binding.deconz [225] Another singleton bundle selected: osgi.identity; osgi.identity="org.openhab.binding.deconz"; type="osgi.bundle"; version:Version="2.5.0.201903261051"; singleton:="true"

Any idea?

The only thing I can think of is trying to flush the cache:

sudo openhab-cli clean-cache

And do a reboot/OH2 restart

Good idea. I cleared the cache and reinstalled the deconz binding.

Result in bundle:list:
191 │ Active │ 80 │ 2.5.0.201903261051 │ Dresden Elektronik Deconz Bin

Thank you very much, @OMR.

However, I am still not getting the additional sensor values and the one temperature is still misinterpreted. Two sensors have the right decimals, one doesn’t.
I read that humidity should work, right? And presence and vibration, too. I wonder what I am still doing wrong …

Each sensor value (the “temperature”, “battery”, “on” values you can see in the deconz returned json response) must be implemented in the deconz binding. It might be that your vibration sensor reports a not yet recognized value type.

The “2.5.0.201903261051” version should be recent enough for presence and humidity sensors though.

Could you please open a bug report (and mention the binding authors, you get those via the CODEOWNERS file in the openhab2-addons repository)?

Hi @David_Graeff, you might be right. I have never opened a bug report. Can you please tell me how and where I can do this? And what do I have to do to reveal the codeowners? (sorry, here’s the newbie)

I saw that my sensors are listed among the Deconz supported devices:

Xiaomi Aqara motion sensor Mbt, Lbt
Xiaomi Aqara weather sensor Tb, Hb, Pb
Xiaomi Aqara door/window sensor Obt
Xiaomi Aqara vibration sensor Vbt 748
Xiaomi Mi motion sensor Mbt
Xiaomi Mi door/window sensor Obt
Xiaomi Mi temperature/humidity sensor Tb, Hb
Xiaomi Mi water leakage sensor Wbt

However, they might not have been implemented in the deconz binding.

I only have a presence sensor on my deconz network and the REST json looks like this:

  "15": {
    "config": {
      "alert": "none",
      "battery": 100,
      "delay": 0,
      "ledindication": false,
      "on": true,
      "pending": [],
      "reachable": true,
      "sensitivity": 2,
      "sensitivitymax": 2,
      "usertest": false
    },
    "ep": 2,
    "etag": "d1bd564757369b0e5a4d81f7a110eb85",
    "manufacturername": "Philips",
    "modelid": "SML001",
    "name": "Motion Sensor Bad",
    "state": {
      "lastupdated": "2019-05-22T19:47:40",
      "presence": false
    },
    "swversion": "6.1.0.18912",
    "type": "ZHAPresence",
    "uniqueid": "00:17:88:01:04:b5:29:aa-02-0406"
  },

My REST json looks similar to yours:

{
“config”: {
“battery”: 100,
“duration”: 62,
“on”: true,
“reachable”: true,
“temperature”: 2900
},
“ep”: 1,
“etag”: “058347022753c05c7a44e20b76f5ffca”,
“manufacturername”: “LUMI”,
“modelid”: “lumi.sensor_motion.aq2”,
“name”: “Aqara BWM Keller”,
“state”: {
“lastupdated”: “2019-05-22T20:50:35”,
“presence”: true
},
“swversion”: “20170627”,
“type”: “ZHAPresence”,
“uniqueid”: “00:15:8d:00:03:13:cd:f9-01-0406”
}

Can you please post your thing and item for your presence sensor?

Not exactly.
Maybe the parsing gets confused because there is a temperature entry in “config”?
My sensor has a dedicated id for temperature:

  "16": {
    "config": {
      "alert": "none",
      "battery": 100,
      "ledindication": false,
      "offset": 0,
      "on": true,
      "pending": [],
      "reachable": true,
      "usertest": false
    },
    "ep": 2,
    "etag": "ad30d04f140eb4e6e39dc38dcd224349",
    "manufacturername": "Philips",
    "modelid": "SML001",
    "name": "Motion Sensor Bad",
    "state": {
      "lastupdated": "2019-05-22T19:51:15",
      "temperature": 2474
    },
    "swversion": "6.1.0.18912",
    "type": "ZHATemperature",
    "uniqueid": "00:17:88:01:04:b5:29:aa-02-0402"
  },

A bug report is to be created here:

If you navigate the files of this repository you will find the CODEOWNERS file right in the root directory. Look for a “bundles/…deconz…” entry and just copy the @authors into your report. This makes sure that they get a mail.

I just realised that my Aqara cubes reports temperature in the “config” section just as yours and it works fine:

My things was auto-discovered in paperUI when I was on a quite recent snapshot, before it was broken. On older snapshots and M1, auto-discover do not work. Related?

My sensors are not auto discovered in Paper UI. I tried a manual search and selected the Deconz binding. Nothing gets discovered.

Just a side note for anyone who might read this thread later:
things show deconz:deconz:homeserver is working now.