RaspBee binding compatibility

Thanks for your effort! I already installed your Snapcast binding. Afterwards i tried to search for new things, without any finding. Do i have to configure your binding or do something else?
I am using the openHabian Image with deconz/raspbee installed. I already connected a working xiaomi door sensor to deconz and want to use it with openHab.

Thanks for your work!

@David_Graeff Do you have any plans for additional sensor types like humidity and air pressure?

I donā€™t have those sensor types so not planning to add anything at the moment.

Cheers, David

I have no clue how your binding works but do you really need to manually add each sensor Type? As deconz is already providing all the Information, couldnā€™t you make some kind of dynamic classes in your binding based on the deConz information? Maybe this thought is just to simple and therefore not working but I just wanted to mention.

Apart from this, is the only reason for not integrating the lights that you can already access them via the Hue Binding? The benefit of having the lights in your binding would be the realtime external change information (i. e. zigbee wall switches which could trigger rules).

Yes the reason for not supporting lights is the original hue binding, I donā€™t want to duplicate code. The devonz binding is more like a temporary thing until rasbees are directly supported by the ZigBee binding (which might take a few years).

I still hope that Philips adds a websocket connection to their API, that was the two bindings could be united.

It is not possible to dynamically generate channels without applying a ton of heuristics. And then the cleaner approach is just to add the sensor in question, I mean it is a finite amount of devonz supported sensors.

Cheers David

Hi @David_Graeff

I have a bunch of Xiaomi ZigBee sensors/switches already paired with my deconz/raspbee, but they are actually not (completely) supported in your new binging. What do you exactly need to add the sensors/values to your deconz binding? I already got the responses from the raspbee REST API for my sensors, except my water detection sensor, which cannot be paired in the moment, but should be fixed in deconz 2.05.51ā€¦

I also took a short look into your binding source code and perhaps I can try to help adding my sensors, if this is okay for you? Java programming is some time ago, but maybe I can help :wink:

Thanks and best regards.

I know weā€™ve had this discussion in the past, but if someone was to actually spend some time to work on it, it would likely take a few days - not years. Of course, if no-one spends any time, then yes, it will be years or longer :wink:

The majority of code is written, it just needs someone to pick it up and try get it working reliably.

If thereā€™s someone out there interested, then please feel free to contact me, or discuss on this issue -:

Thatā€™s the issue. So far nobody jumped in, and I have the mqtt subsystem to maintain, busy with extending the hue emulation to the state that even the original hue app canā€™t tell any difference, and writing a new binding for coap.

It was faster for me to write the deconz binding than to dive into the zigbee code base.

It would help a lot of you put together a small instruction list for building, debugging and where you think that unstable code is located or more testing is required.

Time :smiley: You can help by creating a pull request where you add all the missing sensor things and channels to the thing xml file already and add missing fields to the sensor value class.

Sure - I was simply trying to advertise the issue here so that people are aware of it.

Maybe - maybe notā€¦

Just to reiterate (again, for anyone who wants to look at this) that you donā€™t need to jump in to the whole codebase. The driver fundamentally works, and is quite self contained. You had thought that the writing of the code would take a LONG time (I think you said many man months of work when we discussed this on GH) and really I donā€™t think this is the case.

Please see the issue I referenced above. Iā€™m happy to answer questions etc if someone wants to look at it - that was the purpose of this issue.

Iā€™m not sure where the ā€œunstableā€ code is as it was a long time ago that I looked at this. However, there are only a couple of Java files that form the main part of the driver (yes - that really is 2 files, and under 1000 lines of code!), so itā€™s a pretty small codebase (there are maybe another dozen or so that are used for formatting frames, but I doubt the issue is there).

Hi Jens,

I am happy to read someone else tries the same. Currently, I am struggling with getting xiaomi aqara things recognized by deconz binding in OH. Of course without success, then I found your comment while looking for helpful hints. For now it seems, the best way for me is to use http binding until someone implements the additional sensor types (water, window/door).

Regards,
Marek

If you follow github a little, youā€™ll notice that sensor types are added like crazy recently. I recommend the binding instead of http for real-time updates. Polling is never a good solution, but you probably know that.

Cheers, David

Hi @David_Graeff, thanks for the hint. I am aware of that and would prefer the binding. To be honest, I havenā€™t seen the github repository but only that the currently delivered deconz binding version in OH2.4 does not offer the device types I need. Do you know when will be an update provided which will be easier for me than pulling the github repository and compiling all the code for my raspberry?

This looks pretty hopefull in terms of getting towards a soution for about 10 sensors. Iā€™m pretty sure Iā€™m missing someting here thoughā€¦ The URL points to a file thatā€™s not a deconz binding, but when I skip up a couple of levels I find this one: org.openhab.binding.deconz-2.5.0-SNAPSHOT

I copied it into my openhab addons folder, gave it a reboot, no luck. What steps do I take to get this addon available? Even openHAB documentation is a little vague about thisā€¦

Actually that should work, dropping the file in. At least if you are on Oh 2.5 snapshots (maybe also on OH 2.5 M1). It will not work on OH 2.4

Right. That would be the issue then, Iā€™m on 2.4.
Will upgrade and try again, thanks!

So I updated openhab successfully and went on with the thingsā€¦ Had my first motion sensor up and running in no time, and then everything went nuts.

At this moment I have create an deconz ā€œthingā€ thatā€™s up and running, but created from dresdenā€™s binding (still unable to set up a deconz binding as suggested here and there).

When I create a thing, also pointing to dresdenā€™s binding, of type Motion Sensor it will first show me 2 channels. When I add the sensor id (1, 2 or 3, I currently have 3 sensors connected) it will sometimes recognize a third channel (switch channel: Dark). This implies that at least your code is touched, right?

All 3 sensors have at some point provided data, and it seems I am now stuck with the last value received. It shows some data, but doesnā€™t update at all.

I am done for today. Will definately be running additional tests and trials and update accordingly. If anyone has a hint, please do let me know :slight_smile:


Found this message in the log:
19:38:46.268 [WARN ] [e.core.thing.binding.BaseThingHandler] - Handler DeconzBridgeHandler tried updating the thing status although the handler was already disposed.


After reboots, removing some links, clicks here and there it now seems that the sensor data is coming in, but not being processed somehow.

from log:
09:59:38.705 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ā€˜deconz_presencesensor_16a0b968d7e_presenceā€™ received command REFRESH
09:59:38.710 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ā€˜deconz_presencesensor_16a0b968d7e_last_updatedā€™ received command REFRESH
09:59:38.724 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ā€˜deconz_presencesensor_16a0b968d7e_darkā€™ received command REFRESH
10:00:26.561 [WARN ] [org.jline ] - Failed to save history
java.nio.file.AccessDeniedException: /home/openhab
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:?]
at java.nio.file.Files.createDirectory(Files.java:674) ~[?:?]
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:?]
at java.nio.file.Files.createDirectories(Files.java:767) ~[?:?]
at org.jline.reader.impl.history.DefaultHistory.save(DefaultHistory.java:132) ~[273:org.jline.reader:3.9.0]
at org.jline.reader.impl.history.DefaultHistory.add(DefaultHistory.java:277) [273:org.jline.reader:3.9.0]
at org.jline.reader.impl.LineReaderImpl.finishBuffer(LineReaderImpl.java:944) [273:org.jline.reader:3.9.0]
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:594) [273:org.jline.reader:3.9.0]
at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.readCommand(ConsoleSessionImpl.java:445) [270:org.apache.karaf.shell.core:4.2.2]
at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:403) [270:org.apache.karaf.shell.core:4.2.2]
at java.lang.Thread.run(Thread.java:748) [?:?]
10:06:01.561 [WARN ] [org.jline ] - Failed to save history
java.nio.file.AccessDeniedException: /home/openhab
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:?]
at java.nio.file.Files.createDirectory(Files.java:674) ~[?:?]
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:?]
at java.nio.file.Files.createDirectories(Files.java:767) ~[?:?]
at org.jline.reader.impl.history.DefaultHistory.save(DefaultHistory.java:132) ~[273:org.jline.reader:3.9.0]
at org.jline.reader.impl.history.DefaultHistory.add(DefaultHistory.java:277) [273:org.jline.reader:3.9.0]
at org.jline.reader.impl.LineReaderImpl.finishBuffer(LineReaderImpl.java:944) [273:org.jline.reader:3.9.0]
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:594) [273:org.jline.reader:3.9.0]
at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.readCommand(ConsoleSessionImpl.java:445) [270:org.apache.karaf.shell.core:4.2.2]
at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:403) [270:org.apache.karaf.shell.core:4.2.2]
at java.lang.Thread.run(Thread.java:748) [?:?]


Managed to get this one resolved as well, I now am able to connect to 1 of the presence sensors succesfully. Unfortunately there seems to be no way to connect any additional sensors here. Same issue: Sensor seems to be connected, but is not updated. Old (probably cached) data is shown. Data shown is from the first connection of the thing in openHAB. Senors work flawlessly in the PhosconGateway application.


Out of luck :dizzy_face: At some point I had to remove the 1 working sensor and now Iā€™m back to 0.

Iā€™ll reinstall anything that I come across and try again. Think theres something wrong in my setup, as I am running in circles.

Freshly installed openhabian image. Upgraded to latest (2.5) snapshot and dropped the .jar in the addons folder. Strange result: when manually adding things through habmin or paperUI it will state all compatible devices twice, except for alarm sensor. Now I tried both versions of the presence sensor. One gives me all 3 channels, but still wonā€™t update after initial connection. The other just does nothing.

You donā€™t have to put in the jar; the deconz binding is already part of 2.5 M1?? Iā€™m running deconz with manual things file for about a month now (migrated from homeseer) and rocksolid sinceā€¦

That explains a lotā€¦ thanks! Any tips on how to set up the things?

Like this:

Bridge deconz:deconz:raspbee "RaspBee" [ host="x.x.x.x", apikey="XXXXXXXXX" ] {
    presencesensor gastenwc_motionsensor "GastenWc Motionsensor" @ "Gasten Wc" [ id="9"]
    switch slaapkamer_tap "Slaapkamer Tap" @ "Slaapkamer" [ id="20"]
}

Put in your ip + apikey. then for each sensor you need the id within deconz. You can ask the api for these i think; i migrated from homeseer so i had them already.

Good luck