DDF Documentation

Hi all,

I recently bought a new device (a meter reader) that is currently not supported. General recommendation is to submit a feature request, but as this is a device specific to the Norwegian market, I decided to see what I could make of the DDFs on my own as a start.

Only thing is… DDF isn’t wery well documentet(?). Of course I read the DDF cheat sheet and looked at a few examples.

This got me to a point where I got the device working, but I’m certain I’ve lefte a few things out.

So what I’m looking for now, is a bit more in-depth documentation of the DDF to understand more and make sure what I do is both correct and complete.

@de_employees

Hi, the DDF support and capabilities is currently expanding, but a few core features are still in development, like easier support for switches, custom Tuya functions and more functionality in the DDF editor UI.

A meter device might be possible already though. Unfortunately the documentation is lacking behind, beside the wiki more details about the file and how it is processed can be found at:

https://dresden-elektronik.github.io/deconz-dev-doc/modules/ddf

This page will be updated with more complete picture of how it works and specific examples for certain devices which might be used as starting point / template.

Note for more complex devices it’s currently often needed to check Zigbee messages with a sniffer, in future there will be more UI support to see in and outgoing messages, hopefully simplifying the integration.

If you have already specific question feel free to ping me here.

1 Like

Thanks for your swift reply!

These questions are mostly for my understanding as I actually got the device working, but maybe someone elses DDF quest can be a bit easier with a bit more details.

First off:

  • I get the difference between the read and write. You define which attribute ID (at) from which cluster ID (cl) to read the state from. But where does the “parse” come into play? It’s also got an cid/aid address, so it seems it is called seperately from the read or write?
  • Endpoint - Guess this is referred to as “ep” in the file? I see some DDF files using endpoint 1 and some using endpoint 2. Also 0 is seen - is this the value for “auto”
  • Does the endpoint reffer to different endpoint on the physical device or different logical endpoints as seen by clients on top of deConz?
  • The bindings are to me the biggest mystery. I believe I read somewhere that bindings are required for the device to work. Not in my experience - I only have a very simple read operation from 1 attribute though.
  • Bindings seems to be reporting values to and from endpoints. Either to one or multiple endpoint. Should all values that are going to be exposed from a logical device on deconz, be in a binding to actually be seen by clients?

Best regards

1 Like

I get the difference between the read and write. You define which attribute ID (at) from which cluster ID (cl) to read the state from. But where does the “parse” come into play? It’s also got an cid/aid address, so it seems it is called seperately from the read or write?

The first implementation in fact had read/parse kind of combined but that reduced flexibility, as for some weird devices these two can be different and there are many devices which don’t support reading at all and the only thing we can do is parsing.

Another thing that it allows us is to have one item using read (and optional parse) but having the same incoming message processed by other items parse handlers. This works since all parse handlers are feedet with the message and this intentionally isn’t stopped after the first one processed a message. Here again this is done do gain a bit of flexibility.

Endpoint - Guess this is referred to as “ep” in the file? I see some DDF files using endpoint 1 and some using endpoint 2. Also 0 is seen - is this the value for “auto”

That’s right, 0 means the endpoint of the surrounding sub device will be used as convenience.
For example if a sub device has the following uuid set "uuid": [ "$address.ext", "0x02", "0xfc00"] the endpoint 0x02 will be used.

Currently I tend to use the exact endpoint as given by the device to speed things up a bit (albeit once extracted the auto endpoint is cached).

For “parse” there is also special endpoint 255, which means don’t care from which src endpoint an incoming message is received.

Does the endpoint reffer to different endpoint on the physical device or different logical endpoints as seen by clients on top of deConz?

It’s the endpoint of the physical device to which the related clusters belong. Note we also have a few devices which are representing one sub-device which grabs data from multiple endpoints, due the above mechanism this can be done on a per item base.

The bindings are to me the biggest mystery. I believe I read somewhere that bindings are required for the device to work. Not in my experience - I only have a very simple read operation from 1 attribute though.

Yes they can be tricky, there are many devices out there which don’t need any extra bindings in order to work, but also as much which won’t do anything without bindings :slight_smile:

For lights for example often polling via read/parse works but is slower as the combination of read/parse + a binding with reporting configuration. But for this reporting needs to be supported by the light, Philips Hue lights for example don’t support reporting and can only be polled.

Bindings seems to be reporting values to and from endpoints. Either to one or multiple endpoint. Should all values that are going to be exposed from a logical device on deconz, be in a binding to actually be seen by clients?

Similar to previous answer this depends a bit on the specific device. For sensors we often use unicast bindings to the gateway, for example to show battery or temperature values. For switches, if supported, we create group bindings if the switch doesn’t send commands out of the box.

For many devices is difficult to figure this out without a sniffer or studying the logs, there will be more GUI support for this in future to show more user friendly details about sending/receiving commands.

Hope this helps a bit :slight_smile:

Thanks a lot! This helps with my understanding.

A couple of follow-ups:

  • The parse - is that then to handle messages initiated from the device? I.e. not as a result of a poll from the machine connected to the conbee?
  • And is it the messages received by the parse command that are handled by the bindings? If so - this is starting to make sense to me :slight_smile:
  • Messages received via the read interface (polled) is then not affected by the bindings?
  • I see some DDF files using a “fingerprint”. I’m guessing this has to do with controlling which devices the DDF is used for? But how is this then done when the fingerprint is not in the file? Do you have to always manually set the DDF for the device? And how does the fingerprint work?
  • The DDF can be loaded from both the users home folder or a system-wide location. In which order are DDFs from each folder loaded?

And for information have found this video about DDF deCONZ News #02 - YouTube

For others good questions, I prefer let others answer to not say craps ^^.

Hi

I think a “How to DDF Guide” would be very nice to have.

I got a “chinese” window sensor which is not recognized by deconz and started to fiddle arround with a DDF File for it. And it did work. After a restart of deconz the sensor has gone offline and I can’t get it back to work.

I have stored the DDF file which was working. Questions:

  1. where do I have to place the DDF file to get it loaded at startup?
  2. what settings do I have to do to get DDF files working at startup?
  3. Is there a naming convention for DDF files?

Thank you for any help.

where do I have to place the DDF file to get it loaded at startup?

On classic OS (not dockers)

All DDF coming with deCONZ typically reside in /usr/share/deCONZ/devices/generic/ on a Linux system and are loaded first. However, files residing in the home directory of the user running deCONZ (e.g. /home/deconzuser/.local/share/dresden-elektronik/deCONZ/devices) will override the pre-packaged files to allow users to amend and keep their own files if desired.

Else just try to create one, you will see the path choosen by deconz on the editor title bar.

what settings do I have to do to get DDF files working at startup?

Set the status to “gold” . But it s brutal, you can select the level in Panels / Control / DDF
To start use “basic” as mode.

Is there a naming convention for DDF files?

I think not yet. Try Model-name_device_type.json like other sml001_motion_sensor.json, it’s more usefull to put in the good folder.

Ok thanks Smanar this did help and now it does find the ddf on restart.

Important is not to change the fields about Basic cluster identification. I did change the model ID and I think this was the problem.

Only change the vendor and product

I have now the problem that it does not report the open/close state. But I will open another post for this.

If the value are updated when you read them using the GUI, but not in “natural way”, it’s a binding/report missing.