deconz-rest-plugin icon indicating copy to clipboard operation
deconz-rest-plugin copied to clipboard

added DDF for thirdreality 3RMS16BZ motion sensor

Open taby1 opened this issue 3 years ago • 20 comments

Does not appear to read battery percentage correctly

taby1 avatar Jan 18 '22 01:01 taby1

Hello, the DDF solve the issue or have the issue ?

Smanar avatar Jan 18 '22 12:01 Smanar

Previously the sensor didn’t work at all; now it works, but the battery reads 0%.

taby1 avatar Jan 18 '22 14:01 taby1

Ooooo, I did that device request #5337 - if there is a fix for the battery, I'll test it too. Thanks for doing this DDF!

majorsl avatar Jan 18 '22 16:01 majorsl

        {
          "name": "config/battery",
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "cppsrc": "power_configuration.cpp:192",
            "ep": 1,
            "eval": "Item.val = Attr.val"
          }
        },

Have you made the DDF with the editor or editing the text file ? I think something more classic can work (without "cppsrc"), and perhaps need a bind to this cluster/attribute ?

If you are using editor, can you show the result when seleting the config/battery ?

        {
            "bind": "unicast",
            "src.ep": 1,
            "cl": "0x0001",
            "report": [ {"at": "0x0021", "dt": "0x20", "min": 7200, "max": 7200, "change": "0x00" } ]
        }
                {
                    "name": "config/battery",
                    "parse": {"ep": 1, "cl": "0x0001", "at": "0x0021", "eval": "Item.val = Attr.val"}
                },

Smanar avatar Jan 18 '22 17:01 Smanar

I'm using the DDF editor; here's the battery power cluster information: image

and here it is as shown in the DDF editor: image image

It is worth noting that sometimes, when the battery percentage field is manually read (after double-clicking it, etc.), it does read out correctly. So I guess the issue is that it is inconsistent and unreliable, rather than being completely broken.

Also, I'm not sure how much this matters, but I did notice that in the issue ticket above the manufacturer is "Third Reality, Inc", which is what the device enumerates itself as: image While the company appears to brand itself as THIRDREALITY (which is what this DDF uses).

taby1 avatar Jan 19 '22 00:01 taby1

It is worth noting that sometimes, when the battery percentage field is manually read (after double-clicking it, etc.), it does read out correctly. So I guess the issue is that it is inconsistent and unreliable, rather than being completely broken.

Ok, so nice, it's normal, if it work when you read the value it mean the setting are good, just miss the bind/report for the device report them naturally periodically

You are missing something like that in the json

        {
            "bind": "unicast",
            "src.ep": 1,
            "cl": "0x0001",
            "report": [ {"at": "0x0021", "dt": "0x20", "min": 7200, "max": 7200, "change": "0x00" } ]
        }

With the editor https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/DDF-cheat-sheet#bindings-panel

Also, I'm not sure how much this matters, but I did notice that in the issue ticket above the manufacturer is "Third Reality, Inc", which is what the device enumerates itself as:

Yes, there is 2 devices, clones, same model id but different manufacture name. I need to check but it's probably possible to put the 2 manufactures in the DDF.

Smanar avatar Jan 19 '22 09:01 Smanar

BTW there is an issue for the manufacture "Third Reality, Inc" we have this result on the ddf

  "manufacturername": [
    "Third Reality",
    " Inc"
  ],

Sp not sure it will work

Smanar avatar Jan 20 '22 13:01 Smanar

According to the DDF this one seems to use THIRDREALITY as manufacturer name. When the battery binding is added I think it's good to merge.

manup avatar Jan 27 '22 00:01 manup

But on the capture here we can see "Third Reality, Inc" as manufacture name

image

So IDK if "manufacturername": "THIRDREALITY",

Can work ? And not possible to add "Third Reality, Inc" because of comma issue.

Smanar avatar Jan 27 '22 14:01 Smanar

Hmm good question I thought the THIRDREALITY was in the Basic Cluster for this DDF? If it is "Third Reality, Inc" the DDF won't be evaluated.

manup avatar Jan 27 '22 23:01 manup

Hmm good question I thought the THIRDREALITY was in the Basic Cluster for this DDF?

I can't be sure, this "device" have at least 3 clones with thoses manufacture name

  • Third Reality. Inc
  • Third Reality
  • a third brand I haven't found again but totaly different.

But for the one on the capture, it can't work.

If the code compare only the starting word, can work with "Third Reality" and for first both, else not possible.

Edit: Have checked the code, need to have exactly the same manufacture name. So not possible for the device that use "Third Reality. Inc"

Smanar avatar Jan 28 '22 09:01 Smanar

Ok so according to https://github.com/dresden-elektronik/deconz-rest-plugin/issues/5682#issuecomment-1025066191 It seem it can work even with a "bad DDF"

  "manufacturername": [
    "Third Reality",
    " Inc"
  ],
  "modelid": "3RWS18BZ",

Smanar avatar Jan 30 '22 10:01 Smanar

yeah not really sure what to say here; it works now, and doesn't with the DDF. Battery level is updating with the previous commit, but (as in #5682) appears to be divided by 2 for some reason. I will update the manufacturername to be an array as has been suggested.

taby1 avatar Jan 30 '22 20:01 taby1

He ... It's a "break" ^^ The correct synthax is

  "manufacturername": [
    "M1",
    "M2"
  ],
  "modelid": [
    "I1",
    "I2"
  ],

M1/I1 is one device and M2/I2 is another one, but the problem is the M1 is "Third Reality, Inc", and the DDF core don't escape the comma, so we have this result. From the code it can't work, because we need the exact manufacture name, so only "Third Reality" need not work, but it seem it work ...

Smanar avatar Jan 31 '22 17:01 Smanar

BTW, it's not possible using direclty a text editor ? To correct the manufacture name ?

Smanar avatar Feb 10 '22 16:02 Smanar

Shouldn't this limitation be fixed in deconz? ",inc" ",ltd" ",llc" and others would be common in company names that could be run into in the future.

majorsl avatar Feb 10 '22 16:02 majorsl

Shouldn't this limitation be fixed in deconz? ",inc" ",ltd" ",llc" and others would be common in company names that could be run into in the future.

Sure, but this part is probably coded on the deconz core, if yes, only manup can do something, he already know the problem, but his TODO list is huge . Ofc my proposition is just a workaround waiting for the corrective.

Smanar avatar Feb 10 '22 17:02 Smanar

Small update on this, I really like to get this in and tune the DDF handling to support "foo, bar" as one string within the DDF editor.

Not sure yet about the best approach, ideally this becomes multiple input fields but this is quite cumbersome. Perhaps as in-between solution a different separator which hasn't been used yet in manufacturer names and model ids can be used, for example ; or |.

manup avatar Mar 25 '22 00:03 manup

It's not possible to "escape" the "," ? Just with looking with " character ?

Edit : ha ok, have bad understanding, you mean to replace

  "manufacturername": [
    "M1",
    "M2"
  ],

by

"manufacturername": "M1|M2",

If it's that, I fear the day where tuya will make the device "TZ3000_a@|-/*,7"

Smanar avatar Mar 25 '22 16:03 Smanar

For information have made a PR for the manufacture name with the comma https://github.com/dresden-elektronik/deconz-rest-plugin/pull/5941 (it's not possible using DDF editor, but possible using text editor) So this PR can use just the classic manufacture name.

Smanar avatar Apr 06 '22 16:04 Smanar

Could this PR be closed as #5941 as been merged now ? This one will generated a duplicate in another folder.

BabaIsYou avatar Apr 06 '23 20:04 BabaIsYou

Yes.

Mimiix avatar Apr 06 '23 20:04 Mimiix