dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.89k stars 498 forks source link

Tuya Scene Switch TS0044 TZ3000_a4xycprs #7619

Closed wunni1 closed 3 months ago

wunni1 commented 7 months ago

Is there already an existing issue for this?

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

Smanar commented 7 months ago

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": [
wunni1 commented 7 months ago

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.

Smanar commented 7 months ago

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.

wunni1 commented 7 months ago

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

Smanar commented 7 months ago

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 ?

wunni1 commented 7 months ago

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

Smanar commented 7 months ago

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.

wunni1 commented 6 months ago

@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!

github-actions[bot] commented 5 months ago

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] commented 5 months ago

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.

wunni1 commented 4 months ago

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

Mimiix commented 4 months ago

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

Smanar commented 4 months ago

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.

Zehir commented 4 months ago

@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

wunni1 commented 4 months ago

@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?

Smanar commented 4 months ago

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.

wunni1 commented 4 months ago

Thank you very much!