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

Tuya Scene Switch TS0044 TZ3000_a4xycprs

Open wunni1 opened this issue 1 year ago • 7 comments

Is there already an existing issue for this?

  • [X] I have searched the existing issues and there is none for my device

Product name

MOES ZigBee Scene Switch

Manufacturer

TZ3000_a4xycprs

Model identifier

TS0044

Device type to add

Switch

Node info

Bildschirm­foto 2024-02-18 um 00 40 10

Endpoints and clusters

Bildschirm­foto 2024-02-18 um 00 34 21

Basic

Bildschirm­foto 2024-02-18 um 00 32 20

Further relevant clusters

Power Configuration

Bildschirm­foto 2024-02-18 um 00 33 06

On/Off

Bildschirm­foto 2024-02-18 um 00 41 49 Bildschirm­foto 2024-02-18 um 00 42 04

Level Control

Color Control

Thermostat

Simple Metering

Electrical Measurement

Any other cluster of relevance/interest

wunni1 avatar Feb 17 '24 23:02 wunni1

Hello can try this DDF

{
  "schema": "devcap1.schema.json",
  "manufacturername": "TZ3000_a4xycprs",
  "modelid": "TS0044",
  "product": "Tuya remote 4 gangs locked version",
  "sleeper": true,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_SWITCH",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0006"
      ],
      "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/battery",
          "refresh.interval": 86400,
          "read": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0x0001",
            "at": "0x0021"
          },
          "parse": {
            "at": "0x0021",
            "cl": "0x0001",
            "ep": 1,
            "eval": "Item.val = Attr.val / 2;",
            "fn": "zcl:attr"
          }
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "config/tuya_unlock"
        }
        {
          "name": "state/buttonevent"
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0006"
    },
    {
      "bind": "unicast",
      "src.ep": 2,
      "dst.ep": 1,
      "cl": "0x0006"
    },
    {
      "bind": "unicast",
      "src.ep": 3,
      "dst.ep": 1,
      "cl": "0x0006"
    },
    {
      "bind": "unicast",
      "src.ep": 4,
      "dst.ep": 1,
      "cl": "0x0006"
    }
  ]
}

IDK how will react battery return, setting a bind will provoke a battery drain ...

Remember you need too add the Manufacture Name in the button_maps.json file

        "Tuya3gangMap": {
            "vendor": "Tuya",
            "doc": "3-gang remote",
            "modelids": ["_TZ3000_yw5tvzsk", "_TZ3000_czuyt8lz","_TZ3000_ee8nrt2l", "_TZ3000_ygvf9xzp", "_TZ3000_t8hzpgnd", "_TZ3000_wkai4ga5", "_TZ3000_bi6lpsew", "_TZ3400_keyjhapk", "_TYZB02_key8kk7r", "_TZ3400_keyjqthh", "_TZ3400_key8kk7r", "_TZ3000_vp6clf9d", "_TYZB02_keyjqthh", "_TZ3000_peszejy7", "_TZ3000_qzjcsmar", "_TZ3000_owgcnkrh", "_TZ3000_adkvzooy", "_TZ3000_arfwfgoa", "_TZ3000_a7ouggvs", "_TZ3000_rrjr1q0u", "_TZ3000_abci1hiu", "_TZ3000_dfgbtub0", "_TZ3000_rco1yzb1", "_TZ3000_gbm10jnj", "_TZ3000_5e235jpa", "_TZ3000_sj7jbgks", "_TZ3000_w8jwkczz", "_TZ3000_dziaict4", "_TZ3000_famkxci2", "_TZ3000_itb0omhv", "_TZ3000_tzvbimpq", "_TZ3000_mh9px7cq", "_TZ3000_b7bxojrg", "_TZ3000_ufhtxr59", "_TZ3000_4upl1fcj", "_TZ3000_i3rjdrwu", "_TZ3000_w3c7ouru", "_TZ3000_abci1hiu","_TZ3000_wqcbzbae", "_TZ3000_pkeqinnt", "_TZ3000_uaa99arv", "_TZ3000_wbfgbpxq", "_TZ3000_fa9mlvja", "_TZ3000_tk3s5tyg", "_TZ3000_mrpevh8p", "_TZ3000_qgwcxxws"],
            "map": [

Smanar avatar Feb 18 '24 08:02 Smanar

Thank you! But unfortunately i can’t find the file/folder according to the manuals I’ve found. Running DeConz as HASS Addon with an RPI4.

wunni1 avatar Feb 19 '24 13:02 wunni1

Ha bad luck, it's possible to add new DDF > https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839 But not possible to edit the button_maps.json file.

Smanar avatar Feb 19 '24 16:02 Smanar

This is exactly what I tried... :-(

wunni1 avatar Feb 19 '24 16:02 wunni1

It's an hidden folder /data/.local/share/dresden-elektronik/deCONZ/devices/

But to check if it's working you will need to use log as you can't edit the buttonmap file. Do you have access to deconz log on application ?

Smanar avatar Feb 19 '24 18:02 Smanar

Can’t find that folder. Access to the log is possible. Is there another way with the DDF?

wunni1 avatar Feb 20 '24 18:02 wunni1

Not on the HA docker :( But this folder is invisible, just try to access it.

Else I can make a PR in "blind mode" but without guarantees il will work.

Smanar avatar Feb 20 '24 18:02 Smanar

@Smanar : Sorry I’ve missed your answer… Tried again, but can’t access the folder. Could you make the PR “in blind mode”. Then I will try it out. Thank you!

wunni1 avatar Mar 10 '24 12:03 wunni1

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

github-actions[bot] avatar Apr 01 '24 01:04 github-actions[bot]

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.

github-actions[bot] avatar Apr 09 '24 01:04 github-actions[bot]

I'd like to open this issue again. Tried to upload the DDF mentioned from Smanar 18.02.24 with the new DDF upload feature. The switch is recognized as switch with 4 different buttons, but when I press the buttons nothing is happen.

I copied this text:

{ "schema": "devcap1.schema.json", "manufacturername": "TZ3000_a4xycprs", "modelid": "TS0044", "product": "Tuya remote 4 gangs locked version", "sleeper": true, "status": "Gold", "subdevices": [ { "type": "$TYPE_SWITCH", "restapi": "/sensors", "uuid": [ "$address.ext", "0x01", "0x0006" ], "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/battery", "refresh.interval": 86400, "read": { "fn": "zcl:attr", "ep": 1, "cl": "0x0001", "at": "0x0021" }, "parse": { "at": "0x0021", "cl": "0x0001", "ep": 1, "eval": "Item.val = Attr.val / 2;", "fn": "zcl:attr" } }, { "name": "config/on" }, { "name": "config/reachable" }, { "name": "config/tuya_unlock" } { "name": "state/buttonevent" }, { "name": "state/lastupdated" } ] } ], "bindings": [ { "bind": "unicast", "src.ep": 1, "dst.ep": 1, "cl": "0x0006" }, { "bind": "unicast", "src.ep": 2, "dst.ep": 1, "cl": "0x0006" }, { "bind": "unicast", "src.ep": 3, "dst.ep": 1, "cl": "0x0006" }, { "bind": "unicast", "src.ep": 4, "dst.ep": 1, "cl": "0x0006" } ] }

in a blank file and renamed it tuya_scene_switch.ddf

Did I something wrong? Thanks for help Thomas

wunni1 avatar May 16 '24 06:05 wunni1

This might have to do with the Button maps not updated. @Smanar can you check?

Mimiix avatar May 16 '24 10:05 Mimiix

Exactly, this device is missing in button_maps.json file, just need to add your model in this looonggg list.

        "Tuya3gangMap": {
            "vendor": "Tuya",
            "doc": "3-gang remote",
            "modelids": ["_TZ3000_yw5tvzsk", "_TZ3000_czuyt8lz","_TZ3000_ee8nrt2l", "_TZ3000_ygvf9xzp", "_TZ3000_t8hzpgnd", "_TZ3000_wkai4ga5", "_TZ3000_bi6lpsew", "_TZ3400_keyjhapk", "_TYZB02_key8kk7r", "_TZ3400_keyjqthh", "_TZ3400_key8kk7r", "_TZ3000_vp6clf9d", "_TYZB02_keyjqthh", "_TZ3000_peszejy7", "_TZ3000_qzjcsmar", "_TZ3000_owgcnkrh", "_TZ3000_adkvzooy", "_TZ3000_arfwfgoa", "_TZ3000_a7ouggvs", "_TZ3000_rrjr1q0u", "_TZ3000_abci1hiu", "_TZ3000_dfgbtub0", "_TZ3000_rco1yzb1", "_TZ3000_gbm10jnj", "_TZ3000_5e235jpa", "_TZ3000_sj7jbgks", "_TZ3000_w8jwkczz", "_TZ3000_dziaict4", "_TZ3000_famkxci2", "_TZ3000_itb0omhv", "_TZ3000_tzvbimpq", "_TZ3000_mh9px7cq", "_TZ3000_b7bxojrg", "_TZ3000_ufhtxr59", "_TZ3000_4upl1fcj", "_TZ3000_i3rjdrwu", "_TZ3000_w3c7ouru", "_TZ3000_abci1hiu","_TZ3000_wqcbzbae", "_TZ3000_pkeqinnt", "_TZ3000_uaa99arv", "_TZ3000_wbfgbpxq", "_TZ3000_fa9mlvja", "_TZ3000_tk3s5tyg", "_TZ3000_mrpevh8p", "_TZ3000_qgwcxxws"],
            "map": [

Else if you can't do nothing with your OS (docker), I can make a PR in blind mode, but without guarantees . For the moment still need to edit this file, sorry, but the procedure will be improved soon.

Smanar avatar May 16 '24 15:05 Smanar

@wunni1 the upload page in phoscon it for DDF Bundles, you can't use it to upload the JSON file Smanar gave you. But the current bundle format don't support button_maps file so for now you will still have to drop the json file in the devices directory and edit the button_maps.json file

Zehir avatar May 16 '24 16:05 Zehir

@Smanar thank you again. I have no opportunity to edit this file with my OS. So can you try a blind PR. And I will test it?

wunni1 avatar May 17 '24 17:05 wunni1

PR done here https://github.com/dresden-elektronik/deconz-rest-plugin/pull/7781 But you need the next version to have the correction on the button_maps.json file.

Smanar avatar May 18 '24 14:05 Smanar

Thank you very much!

wunni1 avatar May 18 '24 19:05 wunni1