Can ChatGPT be used to create a DDF?

I had already created a PR for a request to support a pilot wire heating control device.

Winter is coming :sweat_smile:, and I wanted to try to move forward by creating a DDF file with the help of ChatGPT. But when I load it from “Edit DDF” in deCONZ, I get the error message : Failed to load…

With this json file, did ChatGPT put me on the right track or do I have to give up ?

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE204_d6i25bwg",
  "modelid": "TS0601",
  "vendor": "Tuya",
  "product": "ContrĂ´leur chauffage fil pilote",
  "status": "Draft",
  "subdevices": [
    {
      "type": "Heater",
      "restapi": "/sensors",
      "uuid": ["dp1026"],
      "items": [
        {
          "name": "heatmode",
          "type": "enum",
          "values": [
            "off",
            "eco",
            "comfort",
            "frost_protection",
            "comfort-1",
            "comfort-2"
          ],
          "default": "off",
          "read": {
            "fn": "tuya.datapoint",
            "dp": 1026
          },
          "write": {
            "fn": "tuya.datapoint",
            "dp": 1026
          },
          "description": "Mode de chauffage (fil pilote)",
          "refresh.interval": 3600
        }
      ]
    }
  ],
  "bindings": [],
  "reporting": [],
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_id": "0x0051",
      "device_version": 1,
      "input_clusters": [
        "0x0000",
        "0x0004",
        "0x0005",
        "0xEF00",
        "0x000A",
        "0x0019"
      ],
      "output_clusters": []
    }
  }
}

You can forget IA to make work at your place ^^.
It can help, but not making the job, it’s a tool.

Better to ask “how to do” instead of “make it”.

It use existing stuff to reproduce code, and there is not DDF for TRV using tuya cluster, it can"t create from nothing.

If you have a new project, and IA are not able to help you, it’s perfect it mean you have an original idea. If IA is able to finish your project it mean someone else have already do it.

For DDF, it’s something too much specific for IA are interested in it.

There is an “how to do” for DDF, for exemple DDF cheat sheet · dresden-elektronik/deconz-rest-plugin Wiki · GitHub
You will have better result with the “instructions for use”, that asking help to a IA.

Here you have a sample that can help you deconz-rest-plugin/devices/nodon/SIN-4-FP-21.json at master ¡ dresden-elektronik/deconz-rest-plugin ¡ GitHub

It don’t use tuya cluster, but there is only some line to edit to have the “mode” command working.

For information, this device use the DPID = 127 for mode.
0 = confort
1 = confort-1
2 = confort -2
3 = eco
4 = antigel
5 = off

    {
      "name": "config/mode",
      "parse": {
        "fn": "tuya",
        "dpid": 127,
        "eval": "Item.val = Attr.val;"
      },
      "write": {
        "fn": "tuya",
        "dpid": 127,
        "dt": "0x30",
        "eval": "Item.val ;"
      },
      "read": {
        "fn": "tuya"
      }
    },

So I’m not going to give up just yet and use the AI and the information you’ve given me. If I succeed I will make a point here to provide the ddf file of course and also give my opinion on the suitability of the AI for this task.

Thanks again @smanar

Fifteen days later…

I finished building the DDF file for my pilot wire heating controller. It doesn’t allow you to view and use all of the device’s capabilities, but the main functions I wanted are there. :smiling_face_with_sunglasses:

ChatGPT didn’t actually give me the right answers, but it helped me understand better and get answers faster when querying the various documentation available on deCONZ, Phoscon, the forum, and GitHub.

I’m going to create a new topic about the device.