Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuya Fingerbot Plus #7094

Closed
beyondzvincent opened this issue Jul 8, 2023 · 72 comments
Closed

Tuya Fingerbot Plus #7094

beyondzvincent opened this issue Jul 8, 2023 · 72 comments

Comments

@beyondzvincent
Copy link

beyondzvincent commented Jul 8, 2023

  • Product name: Fingerbot Plus
  • Manufacturer: _TZ3210_dse8ogfy
  • Model identifier: TS0001
  • Device type : Switch

i first add new switch in phoscon, then press pair in device, no response for 3 mins, but when i go to decoz, it appear as 0xXXX, i click on it i can control the on off, but not appear at phoscon so also not in HA.

2
1
4

6
5
9
8
7

@Smanar
Copy link
Collaborator

Smanar commented Jul 8, 2023

It's normal, device not supported, but need more information.
Wired or battery device ?

https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Request-Device-Support

@Mimiix
Copy link
Collaborator

Mimiix commented Jul 8, 2023

Please add all screenshots.

@beyondzvincent
Copy link
Author

its a battery device
5
6

@Mimiix
Copy link
Collaborator

Mimiix commented Jul 9, 2023

We need screenshots of all clusters. Also, please add them in the first post.

@beyondzvincent
Copy link
Author

edited

@beyondzvincent
Copy link
Author

added new pic

@Smanar
Copy link
Collaborator

Smanar commented Jul 9, 2023

Hello, can try this DDF

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZ3210_dse8ogfy",
  "modelid": "TS0001",
  "vendor": "Tuya",
  "product": "Fingerbot",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_ON_OFF_OUTPUT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = Attr.val;" },
          "write": {"fn": "tuya", "dpid": 1, "dt": "0x10", "eval": "Item.val == 1 ? 1 : 0;"},
          "read": {"fn": "tuya"}
        },
        {
          "name": "config/battery",
          "parse": {"fn": "tuya", "dpid": 105, "eval": "Item.val = Attr.val;" },
          "read": {"fn": "none"},
          "default": 0
        },
        {
          "name": "config/tuya_unlock"
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ]
}

Support for on/off and battery

@beyondzvincent
Copy link
Author

Hello, can try this DDF

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZ3210_dse8ogfy",
  "modelid": "TS0001",
  "vendor": "Tuya",
  "product": "Fingerbot",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_ON_OFF_OUTPUT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = Attr.val;" },
          "write": {"fn": "tuya", "dpid": 1, "dt": "0x10", "eval": "Item.val == 1 ? 1 : 0;"},
          "read": {"fn": "tuya"}
        },
        {
          "name": "config/battery",
          "parse": {"fn": "tuya", "dpid": 105, "eval": "Item.val = Attr.val;" },
          "read": {"fn": "none"},
          "default": 0
        },
        {
          "name": "config/tuya_unlock"
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ]
}

Support for on/off and battery

hi, thanks for yr advice, now it shows on HA and phoscon, but i cannot control it in home assistant, when i press it, it just no response and turn back to the previous state, also it shows at lights category while its a switch. At deconz app it has a name now
b
a
c

@Smanar
Copy link
Collaborator

Smanar commented Jul 10, 2023

Ha, my bad the request use enum type and not bool.
Try with replacing

        {
          "name": "state/on",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = Attr.val;" },
          "write": {"fn": "tuya", "dpid": 1, "dt": "0x10", "eval": "Item.val == 1 ? 1 : 0;"},
          "read": {"fn": "tuya"}
        },

by

        {
          "name": "state/on",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = Attr.val==1;" },
          "write": {"fn": "tuya", "dpid": 1, "dt": "0x30", "eval": "Item.val == 1 ? 1 : 0;"},
          "read": {"fn": "tuya"}
        },

@beyondzvincent
Copy link
Author

Ha, my bad the request use enum type and not bool. Try with replacing

        {
          "name": "state/on",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = Attr.val;" },
          "write": {"fn": "tuya", "dpid": 1, "dt": "0x10", "eval": "Item.val == 1 ? 1 : 0;"},
          "read": {"fn": "tuya"}
        },

by

        {
          "name": "state/on",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = Attr.val==1;" },
          "write": {"fn": "tuya", "dpid": 1, "dt": "0x30", "eval": "Item.val == 1 ? 1 : 0;"},
          "read": {"fn": "tuya"}
        },

um....i tried this code but still the same, deconz log shows this:
00:21:16:516 writeTuyaData, dpid: 0x01, type: 0x30, expr: Item.val == 1 ? 1 : 0;
00:21:16:516 Tuya write expression: Item.val == 1 ? 1 : 0; --> 0

@Smanar
Copy link
Collaborator

Smanar commented Jul 11, 2023

00:21:16:516 Tuya write expression: Item.val == 1 ? 1 : 0; --> 0

And you have the reverse when using "on=true" instead of "on=false" ?

Something you can do, is enabling/disabling the device yourself using "manual mode". You will see tuya return (with "info"), perhaps need to use another dpid.

@beyondzvincent
Copy link
Author

00:21:16:516 Tuya write expression: Item.val == 1 ? 1 : 0; --> 0

And you have the reverse when using "on=true" instead of "on=false" ?

Something you can do, is enabling/disabling the device yourself using "manual mode". You will see tuya return (with "info"), perhaps need to use another dpid.

22:55:58:959 SC tick --> StateCallFunction
22:55:58:960 writeTuyaData, dpid: 0x01, type: 0x30, expr: Item.val == 1 ? 1 : 0;
22:55:58:960 Tuya write expression: Item.val == 1 ? 1 : 0; --> 1
22:55:59:249 ZCL attribute report 0x50325FFFFE29D2E3 for cluster: 0x0000, ep: 0x01, frame control: 0x18, mfcode: 0x0000
22:56:04:386 emit event/tick: 0xa4c1385b20a60d38
22:56:04:386 SC tick --> StateCallFunction
22:56:04:387 writeTuyaData, dpid: 0x01, type: 0x30, expr: Item.val == 1 ? 1 : 0;
22:56:04:387 Tuya write expression: Item.val == 1 ? 1 : 0; --> 0

this is the log when i turn it on and off at HA, no response at the device, but when i turn it on and off at deconz page or at the device physical button, the log didnt show up anything about that but the device did work

@Smanar
Copy link
Collaborator

Smanar commented Jul 13, 2023

but when i turn it on and off at deconz page

You know how to do that on deconz ? using the tuya cluster ?

or at the device physical button, the log didnt show up anything about that but the device did work

Not good, when you use it manualy, the device need to make a return to say his state have moved .....

Edit:
Or pehraps I m wrong and you are using the on/off cluster ? the 0x0006 ? if yes, the DDF need to be.

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZ3210_dse8ogfy",
  "modelid": "TS0001",
  "vendor": "Tuya",
  "product": "Fingerbot",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_ON_OFF_OUTPUT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "refresh.interval": 86400
        },
        {
          "name": "config/battery",
          "parse": {"fn": "tuya", "dpid": 105, "eval": "Item.val = Attr.val;" },
          "read": {"fn": "none"},
          "default": 0
        },
        {
          "name": "config/tuya_unlock"
        },
        {
          "name": "state/reachable"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0006"
    }
  ]
}

Have set a bind for cluster 0x0006 but no reporting (hoping it was native like lot of Aqara device), and a 24h refresh for poll, for deconz don't poll the battery device.

@beyondzvincent
Copy link
Author

this works! thanks alot

@aldoushx
Copy link

this works! thanks alot

Hi,
Can you tell us which DDF is working ?
Is Smanar's DDF (in his last edit) fully working ?

Because as you previously said, for me with this DDF, in deconz the fingerbot is displayed as a light, and in home assistant when you activate the fingerbot, it stays on, and do not go back to off (you have to activate it again so it goes off).

@beyondzvincent
Copy link
Author

this works! thanks alot

Hi, Can you tell us which DDF is working ? Is Smanar's DDF (in his last edit) fully working ?

Because as you previously said, for me with this DDF, in deconz the fingerbot is displayed as a light, and in home assistant when you activate the fingerbot, it stays on, and do not go back to off (you have to activate it again so it goes off).

yes the last one he provided, now at the phoscon app it shows as light, but at ha it shows as switch. The situation that stays on is no response, not work at all, it happens at prevoius ddf but at the last ddf, it works
nt

@Smanar
Copy link
Collaborator

Smanar commented Jul 17, 2023

On the last DDF the device is reconised as "TYPE_ON_OFF_OUTPUT", so it's not realy a light for me, third app can display it as they want.

@aldoushx
Copy link

aldoushx commented Aug 6, 2023

Any idea on how to customize the up and down positions, and the sustain time with deconz ?

@Smanar
Copy link
Collaborator

Smanar commented Aug 6, 2023

For the sustain time can try

        {
          "name":"config/delay",
          "read":{
            "fn":"none"
          },
          "write":{
            "dpid":103,
            "dt":"0x2b",
            "eval":"Item.val;",
            "fn":"tuya"
          },
          "parse":{
            "dpid":103,
            "eval":"Item.val = Attr.val;",
            "fn":"tuya"
          },
          "default":1
        },

But from that I m reading this device use raw mode, and it's not implemented in deconz (I have see another issue with the same problem today), 0x2b is for s32 value.

Can make a try, I can update the c++ code if needed but I need you (with a linux machine with full OS) to make test.

@aldoushx
Copy link

aldoushx commented Aug 7, 2023

No, the code below does not work for the sustain time (i tried 3 and 10 as values, no change on the sustain time)

I am OK with the test, I have a debian test machine available, but I will not have access to the fingerbot in 2 days for some time.

@Smanar
Copy link
Collaborator

Smanar commented Aug 7, 2023

I m with another user that have a device that use raw value, but for him it's sure #7151 (comment)

If you have the GUI, can you try to take a look in logs with flag "info" and "ddf" and try the "config/delay" request ?
We will see the request made by deconz and I hope a return from the device with the correct synthax to use.

@aldoushx
Copy link

aldoushx commented Aug 7, 2023

OK, I am not familiar with the use of the REST API so maybe I have done it wrong.

I sent the following command through the terminal after hot reloading the updated DDF (with the delay parameter) :
curl -H 'Content-Type: application/json' -X PUT -d '{"delay": 5}' http://IP:port/api/****/lights/7/config

the following error was returned in the terminal :
[{"error":{"address":"/lights/7/config/delay","description":"parameter, delay, not available","type":6}}]

@Smanar
Copy link
Collaborator

Smanar commented Aug 8, 2023

How have you updated the DDF ? (not something easy on HA)
And the problem is "config" field are hidden on "light" device, so I don't thing they can be visible on the API ...

Else for me your request is fine.

@BabaIsYou
Copy link
Contributor

There is so much stuff than can be controlled for this device : Koenkk/zigbee2mqtt#17841 (comment) ;-)

@jordibsk10
Copy link

jordibsk10 commented Aug 31, 2023

Hi all,
I'd love to also be able to control this new device, but unfortunately I'm not that expert yet and I don't know exactly what to do to make it work like @beyondzvincent .
I've also managed to see it in the Deconz Panel, but I'm not sure what else to do :(

Can any one shortly guide me (and for sure others in the near future) on how to make it work?

Thank you all!!

@Smanar
Copy link
Collaborator

Smanar commented Sep 1, 2023

Hello, have you installed the DDF, what is your OS ?

@jordibsk10
Copy link

jordibsk10 commented Sep 11, 2023

Hello, @Smanar,
Apologies, I don't know what is the DDF :(
I'm using deconz version 6.20.0, with a conbee stick (with latest version). And for the Home Assistant version, I'm using:
Home Assistant 2023.9.1
Supervisor 2023.08.3
Operating System 10.5

As said, I can see it in the deConz application, but i can't see it anywhere else :(

image

Trying to connect to it scanning new devices, I've managed to "pair" it with other devices (as can be seen in the image above with the green line), but it does'nt appear anywhere.

Hope this helps and thank you very much for your help,
Jordi

@Smanar
Copy link
Collaborator

Smanar commented Sep 11, 2023

You need a DDF to use this device, and as the support is not yet official you need to put the DDF yourself.
It's something easy, just need to create a text file in a "devices" folder, unfortunately you have HA https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839

@Smanar
Copy link
Collaborator

Smanar commented Apr 6, 2024

Can you try this DDF (if you are using the one in this post for the "_TZ3210_dse8ogfy")

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZ3210_dse8ogfy",
  "modelid": "TS0001",
  "vendor": "Tuya",
  "product": "Fingerbot",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_ON_OFF_OUTPUT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/on",
          "parse": {"fn": "tuya", "dpid": 1, "eval": "Item.val = Attr.val;" },
          "write": {"fn": "tuya", "dpid": 1, "dt": "0x10", "eval": "Item.val == 1 ? 1 : 0;"},
          "read": {"fn": "tuya"}
        },
        {
          "name": "config/tuya_unlock"
        },
        {
          "name": "state/reachable"
        }
      ]
    },
   {
      "type": "$TYPE_BATTERY_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0001"
      ],
     "meta": {
        "values": {
          "config/mode": {"clic": 0, "switch": 1, "program": 2}
        }
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "config/mode",
          "values": [
              ["clic", 0], ["switch", 1], ["program", 2]
          ],
          "parse": {"fn": "tuya", "dpid": 101, "eval": "if (Attr.val == 0) { Item.val = 'clic' } else if (Attr.val == 1) { Item.val = 'switch' } else { Item.val = 'program' }"},
          "write": {"fn": "tuya", "dpid": 101, "dt": "0x30", "eval": "if (Item.val == 'clic') { 0 } else if (Item.val == 'switch') { 1 } else { 3 }"},
          "read": {"fn": "none"}
        },
        {
          "name": "config/battery",
          "parse": {"fn": "tuya", "dpid": 105, "eval": "Item.val = Attr.val;" },
          "read": {"fn": "none"},
          "default": 0
        },
        {
          "name":"config/delay",
          "read":{
            "fn":"none"
          },
          "write":{
            "dpid":103,
            "dt":"0x2b",
            "eval":"Item.val;",
            "fn":"tuya"
          },
          "parse":{
            "dpid":103,
            "eval":"Item.val = Attr.val;",
            "fn":"tuya"
          },
          "default":1
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }
  ]
}

You will have a "config/mode" fiel with 3 possibles values

["clic", 0], ["switch", 1], ["program", 2]

@KatyPurry
Copy link

KatyPurry commented Apr 6, 2024

Thank you ! I updated the DDF by your DDF with deCONZ VNC GUI, but now how to change the mode in homebridge/homekit ? 😅
Do I have to delete the accessory in Deconz/Homebridge and pair it again? DDF file is persistent ?

@Smanar
Copy link
Collaborator

Smanar commented Apr 7, 2024

Lol, depend of OS, if you have edited the one in the folder /usr/share/deCONZ/devices/ it will be replaced the next time you will update deconz, so no danger to make test with it.
After the change, better to relaod deconz, easier than using the DDF editor.

No need to re-include the device.

If you take a look in the API, for exemple with phoscon/help/debug view/sensor, you will found the new field on the ZHAbattery sensor.

To change the value, it depend of third app, IDK if you have a direct access to all fields, else you will need to use command line.

curl -H 'Content-Type: application/json' -X PUT -d '{"mode": "switch"}' http://IP:PORT/api/APIKEY/sensors/ID/config

https://dresden-elektronik.github.io/deconz-rest-doc/getting_started/

@KatyPurry
Copy link

KatyPurry commented Apr 7, 2024

Thank you for this valuable information. I made the changes but I have errors. I'm sorry I'm that guy who's not very comfortable with all this.

To sum up, I use unRAID. To use your JSON file. I would connect with deCONZ VNC, locate the Fingerbot sensor > Edit DDF > load JSON file and finally I did a Hot Reload.

Then I ran the command in the deCONZ container terminal: curl -H 'Content-Type: application/json' -X PUT -d '{"mode": "switch"}' http://192.168.1.9:8020/api/***/sensors/39/config, but it returned an error saying that the config field was not found.

I thought maybe I'd done the procedure wrong, so I went straight to updating the json file with the help of this message: /usr/share/deCONZ/devices/tuya/_TZ3210_dse8ogfy_fingerbot.json. Edited with nano, written then quit. I restarted deCONZ but since then the Fingerbot no longer appears in Phoscon.

That's where I'm at.

@Smanar
Copy link
Collaborator

Smanar commented Apr 7, 2024

Edited with nano, written then quit. I restarted deCONZ but since then the Fingerbot no longer appears in Phoscon.

You probably have done a typo in the file

but it returned an error saying that the config field was not found.

You are sure you are using the good ID ? You can check direcy in your browser http://192.168.1.9:8020/api/***/sensors/39 you need to have a "config" part.

@KatyPurry
Copy link

KatyPurry commented Apr 7, 2024

Okay, I've started the procedure again. I removed the Fingebot from DeCONZ VNC, stopped the deCONZ container and unplugged the Conbee stick for a few minutes.

I added the Fingerbot on Phoscon. I edited the file with nano, this is the start of the file (I write out the file of course):
image

I connected to deCONZ VNC for Hot Reload. Now, If I check directly in my browser, it displays :

{
    "config": {
        "delay": 1,
        "on": true,
        "reachable": true
    },
    "etag": "1d7cc0bdfe6bd79c2c18ea0a4dc57ba8",
    "lastannounced": null,
    "lastseen": "2024-04-07T18:01Z",
    "manufacturername": "_TZ3210_j4pdtz9v",
    "modelid": "TS0001",
    "name": "Battery 44",
    "state": {
        "battery": 0,
        "lastupdated": "none"
    },
    "swversion": "1.1.2",
    "type": "ZHABattery",
    "uniqueid": "a4:c1:38:7e:ce:a3:b0:e8-01-0001"
}

If I check the DDF in deCONZ VNC, it doesn't seem to use the version I edited:
image

I'm sure this is the right sensor, I have only one with "ZHABattery" and an uncommon name "Battery 44":
image

I don't dare restart the deCONZ container. What should I do?

@Smanar
Copy link
Collaborator

Smanar commented Apr 8, 2024

I don't dare restart the deCONZ container. What should I do?

You are using docker ? So it's not the same thing. What is your OS ?

And BTW, don't use the editor, you can use it to see something, but not not to edit, too much problem.
And deconz load DDF only at start, so need to reload it after a change, "hot reload" work only when you edit a file using the editor.

@KatyPurry
Copy link

KatyPurry commented Apr 8, 2024

Yes I'm using docker on unRAID OS.

By editor, you mean the DDF Editor in deCONZ GUI ? This was just to show you the json wasn't updated. I went through nano on terminal to edit the file.

I restarted the deCONZ container and checked what JSON file was used, this is the correct JSON you provided (preview):
image

Checked API, no config mode:
image

Once again after this restart, the Fingerbot has disappeared from the Phoscon interface, but still presents in the API and deCONZ GUI.

On my iPhone the accessory isn't a light switch anymore but returns an accessory with an error "not supported":

IMG_3426
IMG_3425

@Smanar
Copy link
Collaborator

Smanar commented Apr 9, 2024

So dockers have special working mode, all is virtual, I think you are using the official deconz docker image ?
So for DDF you need to use the folder "opt/deCONZ/devices/" deconz-community/deconz-docker#163

@KatyPurry
Copy link

KatyPurry commented Apr 9, 2024

So dockers have special working mode, all is virtual, I think you are using the official deconz docker image ?

I'm using the official one yes: deconzcommunity/deconz:stable

So for DDF you need to use the folder "opt/deCONZ/devices/" deconz-community/deconz-docker#163

I have one file in the folder (the one I uploaded to access through deCONZ VNC GUI)
image
I'll try to create same structures/path (devices/tuya/_TZ3210_dse8ogfy_fingerbot.json) and restart the container.

Update: no change

@Smanar
Copy link
Collaborator

Smanar commented Apr 9, 2024

Strange the file is called "fingerbot1.json" but on the editor (on the window title) its the file "_TZ3210_dse8ogfy_fingerbot.json" that is used, and the one on the "opt" folder need to be prioritary.

@KatyPurry
Copy link

KatyPurry commented Apr 9, 2024

Strange the file is called "fingerbot1.json" but on the editor (on the window title) its the file "_TZ3210_dse8ogfy_fingerbot.json" that is used, and the one on the "opt" folder need to be prioritary.

These are not the same files.

  • I used fingerbot1.json to test load from a file in deCONZ VNC GUI. Forget this file.
  • _TZ3210_dse8ogfy_fingerbot.json is when I modified file in /usr/share/deCONZ/devices/tuya/_TZ3210_dse8ogfy_fingerbot.json

And to make it even more difficult to understand, here is what is displayed after the restart of deCONZ container:
image

@Smanar
Copy link
Collaborator

Smanar commented Apr 9, 2024

Your last picture is like deconz don't found DDF at all.
But on docker not possible to use "/usr/share/deCONZ/devices", this folder not exist in reality. Or you know how works dockers ? But I don't know what you have done (and honnestly I can't help you for docker management)

For me the better DDF you have is "fingerbot1.json" the one you have in the "opt" folder, but why this one is not picked by deconz ? You can try to load it using the editor, perhaps there is a typo ?
There is special logings in deconz for DDF (on help/debug view)

@gabriele-latino
Copy link

A dumb question, it's possibile to set the fingerbot's arm lenght and timing, just like can be done by Tuya?

@Smanar
Copy link
Collaborator

Smanar commented Sep 30, 2024

Can add a delay with for exemple

    {
      "name": "config/delay",
      "read": {
        "fn": "none"
      },
      "write": {
        "dpid": 103,
        "dt": "0x2b",
        "eval": "Item.val;",
        "fn": "tuya"
      },
      "parse": {
        "dpid": 103,
        "eval": "Item.val = Attr.val;",
        "fn": "tuya"
      },
      "default": 5
    },

With value from 0 to 10.
Problem, from my memory the DDF core don't support raw value, to write, ok to read them, need to make tries to be sure.

For the lenght you are talking about the min/max ? And here I have a new problem, I don't see which one fild to use, can create a config/min and config/max, but I think it will cause problems with existing fields.

@McElch
Copy link

McElch commented Jan 6, 2025

Hello, i got a question regarding the way the Fingerbot works. I have a Raspberry with Docker running the official deconz Container and a ConBee II. With the Informations found here and the DDF found there i managed to get my brand new Zigbee Fingerbot to pair.

Whatever I klick (On / Off / Toggle ) in the deconz GUI as in my Home Automation Software (FHEM), it works always the way "PowerOn - Auto PowerOff".

In the actual DDF is that delay-snippet included already, right? I modified the default value from 1 to 5, expecting that would cause the Fingerbot to stay longer (5 Seconds) in the On Position before returning to off, but it hast no effect.

I use it for the DoorOpener of my old Intercom. It works for me, but not for Visitors, as the On-Time is very short. To explain, what I want is a zzzzzzzzzzzzzzzzzzzzzt instead of a zzt - you all know that sound :)

This could be accomplished either by a on-for-timer Function (if on would move the Arm down an off would move it up again) of my smarthome, or with a slower return of the Fingerarm. For me it doesnt matter wich way of the two. How would you do that?

Thanks in advance! Great Infos and Support here!

@Smanar
Copy link
Collaborator

Smanar commented Jan 7, 2025

In the actual DDF is that delay-snippet included already, right? I modified the default value from 1 to 5, expecting that would cause the Fingerbot to stay longer (5 Seconds) in the On Position before returning to off, but it hast no effect.

Here we have a problem ^^. It's the "sustain time", so I think it's exaclty what you want ?
What is the used mode ? (in config/mode).
After a time, the value is still "5" or back to "1" ?
What is your deconz version ? If I remember its data on raw format, and deconz have problem with this kind of data type, if it's that, it will be visible on logs, but strange no one have the problem before.

@McElch
Copy link

McElch commented Jan 7, 2025

Thanks for your reply! Yes I wonder why i am the only one. Pretty sure, the Probleme is in front of screen... :)

To be honest, i had a very old deconz Version. Was suprised that it now know Blinds and Thermostaes... hehe.. I didnd dare to touch it, sorry. Now i have 2.29.1 beta.

But the behavior stays same. And im still confused: With the new Version, it recognizes the Device. It does not use my JSON file, but one that comes with the update. named tuy/....fingerbot.json. But that hasnt that ["clic", 0], ["switch", 1], ["program", 2] features included.
So i tried yours from here, but that did not work (device did not act, neither in Phoscon nor in my Smarthome).
And when I used yours with that ["clic", 0], ["switch", 1], ["program", 2], where should i look if the Sustain Value changes? And where to look for the used mode? Sorry for my confusion!

@Smanar
Copy link
Collaborator

Smanar commented Jan 8, 2025

Ha you are right, the official one is lighter https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/devices/tuya/_TZ3210_dse8ogfy_fingerbot.json

So we can presume you are using native setting, can you take a look on logs when using the config/delay ? (with flag "DDF" and both "INFO").

. It does not use my JSON file, but one that comes with the update

So ATM you have your json + the official one+ the one from this issue, what is your OS where have you put the DDF ? If you can edit the official one, it's better having only one, and after a change you need to restart deconz (it load DDF only at start)

@McElch
Copy link

McElch commented Jan 8, 2025

Hi, im running Raspian 11 bullseye with Docker (official deconz Image). For further testing, now I renamed the official _TZ3210......json in _TZ3210....bak. So now, deconz should always use my fingerbot3.json in opt/deconz/devices (for persitance).

Now i took the content of the official file into that place, only chaning the delay default to 5. Restarted deConz and checked if it uses my json now - it does.

Behavior is the same: whatever clicked in Phoscon or the GUI, the arm drives down und immidiatly up again. Here is what the Log says:

16:32:34:216 emit event/tick: 0xA4C138419B741F5A
16:32:34:235 SC tick --> StateCallFunction
16:32:34:238 SC tick --> StateCallFunction
16:32:37:042 0xA4C138419B741F5A force poll (2)
16:32:37:076 a4:c1:38:41:9b:74:1f:5a-01/state/on expression: Item.val = Attr.val --> false
16:32:37:079 ZCL attribute report 0xA4C138419B741F5A for cluster: 0x0006, ep: 0x01, frame control: 0x18, mfcode: 0x0000
16:32:37:082 SC state/on: synced
16:32:37:083 SC --> StateFinished
16:32:37:084 SC --> StateFinished
16:32:37:085 SC state change finished: a4:c1:38:41:9b:74:1f:5a-01
16:32:37:086 SC state change finished: a4:c1:38:41:9b:74:1f:5a-01

And here is my json:

{
"schema": "devcap1.schema.json",
"uuid": "aeb64a3c-50c7-45c7-9dca-6378a5004200",
"manufacturername": [
"_TZ3210_dse8ogfy",
"_TZ3210_j4pdtz9v"
],
"modelid": [
"TS0001",
"TS0001"
],
"vendor": "Tuya",
"product": "Adaprox fingerbot (TS0001)",
"sleeper": false,
"status": "Gold",
"subdevices": [
{
"type": "$TYPE_ON_OFF_OUTPUT",
"restapi": "/lights",
"uuid": [
"$address.ext",
"0x01"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"parse": {
"fn": "zcl:attr",
"ep": 1,
"cl": "0x0000",
"at": "0x0001",
"script": "tuya_swversion.js"
},
"read": {
"fn": "zcl:attr",
"ep": 1,
"cl": "0x0000",
"at": "0x0001"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "state/on"
},
{
"name": "config/tuya_unlock"
},
{
"name": "state/reachable"
}
]
},
{
"type": "$TYPE_BATTERY_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0001"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion",
"parse": {
"fn": "zcl:attr",
"ep": 1,
"cl": "0x0000",
"at": "0x0001",
"script": "tuya_swversion.js"
},
"read": {
"fn": "zcl:attr",
"ep": 1,
"cl": "0x0000",
"at": "0x0001"
}
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/battery",
"parse": {
"fn": "tuya",
"dpid": 105,
"eval": "Item.val = Attr.val;"
},
"read": {
"fn": "none"
},
"default": 0
},
{
"name": "config/delay",
"read": {
"fn": "none"
},
"write": {
"dpid": 103,
"dt": "0x2b",
"eval": "Item.val;",
"fn": "tuya"
},
"parse": {
"dpid": 103,
"eval": "Item.val = Attr.val;",
"fn": "tuya"
},
"default": 5
},
{
"name": "state/lastupdated"
}
]
}
]
}

@Smanar
Copy link
Collaborator

Smanar commented Jan 9, 2025

This is fine for me, but I m hopping an error message when you try to use the config/delay , something like "bad format type".
With flag "Info" *2 and "DDF" on deconz/help/debug view, with the flag "DDF" you will be able to locate the command, and with both flag "info" you will see tuya request.

@McElch
Copy link

McElch commented Jan 9, 2025

Hmmm. What do you mean with "when i try to use the config/delay"? I just wrote it to the json, hoping it would use the default? Is that wrong?

As far as i can see there are no errors, but for me its is extremely hard to follow up that flood of messages, and check if they are from that device / my clicks on it. :(

Smanar, are you working at DD-elektronik? Than i bring you the device, its not far from Laubegast! LOL

@Smanar
Copy link
Collaborator

Smanar commented Jan 10, 2025

Hmmm. What do you mean with "when i try to use the config/delay"? I just wrote it to the json, hoping it would use the default? Is that wrong?

Just use the API to change the value, like you have one for the value "5" before.

And no ^^, I don't work for DD

@McElch
Copy link

McElch commented Jan 11, 2025

Well, I think the Problem is me, not the Device. I didnt use either a API (wich?) nor the VNC-GUI! As written, I just changed the default value in the DDF file. Is that the mistake?

If you mean the deConz GUI, there are some buttons in the on/off Cluster Info. Do you mean this? Sorry for Layer 8 Problems! :)

@Smanar
Copy link
Collaborator

Smanar commented Jan 12, 2025

Haaa, so yes ^^.

You need to make API call to change the value.
Depend on third app, some of them permit to change field else can use curl, with something like

curl -H 'Content-Type: application/json' -X PUT -d '{"duration": 900}' http://192.168.1.1:80/api/36EFF8291E/sensors/16/config

https://dresden-elektronik.github.io/deconz-rest-doc/getting_started/

@McElch
Copy link

McElch commented Jan 12, 2025

I tried. Read the getting-started-doc. I found the Sensor and the API Key in Phoscon/Help. Using the suggested curl command gave me an error:

[{"error":{"address":"/sensors/58/config/duration","description":"parameter, duration, not available","type":6}}

Still not knowing what i do I assumed, that duration not exists, because its named delay. So I used delay instead of duration, and it seemed to work, givig me a success message:

[{"success":{"/sensors/58/config/delay":900}}]

(Why 900? is it millisecs? I tried 4000 too to be sure)

Phoscon recognizes the change:

{
"config": {
"delay": 900,
"on": true,
"reachable": true
},
"etag": "a551a7bf8c13c78c1bd9bd158d0c9f53",
"lastannounced": "2025-01-12T09:47:34Z",
"lastseen": "2025-01-12T14:31Z",
"manufacturername": "_TZ3210_j4pdtz9v",
"modelid": "TS0001",
"name": "Battery 58",
"state": {
"battery": 100,
"lastupdated": "2025-01-12T11:08:20.501"
},
"swversion": "1.1.3",
"type": "ZHABattery",
"uniqueid": "a4:c1:38:41:9b:74:1f:5a-01-0001"
}

The "Event" Tab in Phoscons help says after clicking toggle Button in my smarthomes GUI

 {
"15:18:04:847": {
    "attr": {
        "id": "58",
        "lastannounced": "2025-01-12T09:47:34Z",
        "lastseen": "2025-01-12T14:18Z",
        "manufacturername": "_TZ3210_j4pdtz9v",
        "mode": 1,
        "modelid": "TS0001",
        "name": "Battery 58",
        "swversion": "1.1.3",
        "type": "ZHABattery",
        "uniqueid": "a4:c1:38:41:9b:74:1f:5a-01-0001"
    },
    "e": "changed",
    "id": "58",
    "r": "sensors",
    "t": "event",
    "uniqueid": "a4:c1:38:41:9b:74:1f:5a-01-0001"
},

However, the behavior stays same: Arm gos down and up agin within one second. :(

@Smanar
Copy link
Collaborator

Smanar commented Jan 12, 2025

"Config/delay" take a value from 0 to 10 (in s)

@McElch
Copy link

McElch commented Jan 13, 2025

Now im really confused. So what is the suggested 900 for? And, however, I tried 4, 5 400, 900, 4000 .... nothing had any effect. So I think i drive the wrong screw, or a needed prerequisite is missing. After searching the web, for me it seems to be a question of "mode". In a youtube video about the device, its behavior was described as follows:

It has modes Click, switch and program. And in the click-mode, it act like mine: whatever you press (on, off or toggle) it just clicks and return arm to off.

As the mode parameters was described here before, I tried to change the mode. As the JSON earlyer here did not work for me, i just took the part with the mode and put it in my JSON and restarted deconz. After that, i wanted to set the mode with the curl command mentioned earlyer here, but it responded an error:

[{"error":{"address":"/sensors/58/config/mode","description":"Could not set attribute","type":608}}]

Without knowing what i did, i mentioned difference in Phoscons output:

{
"config": {
"delay": 5,
"mode": null,
"on": true,
"reachable": true
},
"etag": "db96ff938e4e2446826c15c1ebf05772",
"lastannounced": null,
"lastseen": "2025-01-13T12:55Z",
"manufacturername": "_TZ3210_j4pdtz9v",
"modelid": "TS0001",
"name": "Battery 58",
"state": {
"battery": 100,
"lastupdated": "2025-01-13T11:19:24.759"
},
"swversion": "1.1.3",
"type": "ZHABattery",
"uniqueid": "a4:c1:38:41:9b:74:1f:5a-01-0001"
}

It dos not say mode: 0, it says mode: null.

In the Phoscons Event Tab it says unchanged mode: 1:

"14:21:16:425": {
"attr": {
"id": "58",
"lastannounced": null,
"lastseen": "2025-01-13T13:21Z",
"manufacturername": "_TZ3210_j4pdtz9v",
"mode": 1,
"modelid": "TS0001",
"name": "Battery 58",
"swversion": "1.1.3",
"type": "ZHABattery",
"uniqueid": "a4:c1:38:41:9b:74:1f:5a-01-0001"
},
"e": "changed",
"id": "58",
"r": "sensors",
"t": "event",
"uniqueid": "a4:c1:38:41:9b:74:1f:5a-01-0001"
}

Does all that says anything helpful?

@Smanar
Copy link
Collaborator

Smanar commented Jan 13, 2025

The "config/duration" = 900 was just a sample from another device ^^

curl -H 'Content-Type: application/json' -X PUT -d '{"mode": "switch"}' http://192.168.1.1:80/api/36EFF8291E/sensors/16/config

You probably miss this part

     "meta": {
        "values": {
          "config/mode": {"clic": 0, "switch": 1, "program": 2}
        }
      },

The "config/delay" is working on the "clic" mode, so you have the good one, with a 1s delay the device need to return back after 1s, else can be 10s.

@McElch
Copy link

McElch commented Jan 14, 2025

You were right, I missed that part. Now I can set the modes clic, switch and program. But that dos not change anything. Whatever mode, whatever delay, Arm moves on and off in a second.

After one week try and error and watching lots of Youtube Videos about Zigbee and Fingerbot im little frustrated. Think I will buy sonoff stick and give mqtt2zigbee a try, as i do not have an idea what else to try next. :(

However, thank you very much for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants