dresden-elektronik / deconz-rest-plugin

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

AVATTO ZWSM16-2-Zigbee #7646

Closed LeoeLeoeL closed 6 months ago

LeoeLeoeL commented 8 months ago

Is there already an existing issue for this?

Product name

AVATTO ZWSM16-2-Zigbee

Manufacturer

_TZ3000_mtnpt6ws

Model identifier

TS0002

Device type to add

Light

Node info

image

Endpoints and clusters

image

Basic

image

Further relevant clusters

Power Configuration

On/Off

image image

Level Control

Color Control

Thermostat

Simple Metering

image

Electrical Measurement

image image image image

Any other cluster of relevance/interest

LeoeLeoeL commented 8 months ago

image If I set ON light 10 , light 11 switches to ON too.

SirBarkAlot commented 8 months ago

i have one to, if there is support i would realy love it if you would need somone to test it PM me

LeoeLeoeL commented 8 months ago

I have 4 of them. 2 are paired to zigbee2Mqtt and work OK. image I think the energy meter is disabled by firmware

LeoeLeoeL commented 7 months ago

Is there any "work in progress" regarding this device? I need to buy and install 2 more.

github-actions[bot] commented 7 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.

LeoeLeoeL commented 7 months ago

It could be a good thing to integrate this device because is not expensive.

Mimiix commented 7 months ago

@Smanar Can you take a look if you have time :)?

Smanar commented 7 months ago

Hello can you try this DDF


{
  "schema": "devcap1.schema.json",
  "manufacturername": [
    "_TZ3000_zmy4lslw",
    "_TZ3000_lmlsduws",
    "_TZ3000_mtnpt6ws",
    "_TZ3000_nuenzetq"
  ],
  "modelid": [
   "TS0002",
   "TS0002",
   "TS0002",
   "TS0002"
  ],
  "product": "Tuya 2 output module",
  "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",                   
          "refresh.interval": 86400,
          "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": "state/reachable"
        },
        {
          "name": "config/tuya_unlock"
        }
      ]
    },
    {
      "type": "$TYPE_ON_OFF_OUTPUT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x02"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",                   
          "refresh.interval": 86400,
          "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": "state/reachable"
        }
      ]
    }
  ]
}

Or if you want, just edit this DDF devices\tuya_TZ3000_2channel_module.json

You need to re-include the DDF after that, because the tuya unlock sequence is done at inclusion or every 24h (you can wait 24h too)

LeoeLeoeL commented 7 months ago

It has been impossible to load your DDF so I copied your items (violet, blue and green) and generated this one:

{ "schema": "devcap1.schema.json", "manufacturername": "_TZ3000_mtnpt6ws", "modelid": "TS0002", "product": "TS0002", "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" }, { "name": "attr/type" }, { "name": "attr/uniqueid" }, { "name": "config/tuya_unlock", "public": false, "description": "Tuya sequence to unlock some device.", "refresh.interval": 86400, "default": false }, { "name": "state/on", "description": "True when device is on; false when off.", "refresh.interval": 5 }, { "name": "state/reachable" } ] }, { "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" }, { "name": "attr/type" }, { "name": "attr/uniqueid" }, { "name": "state/on", "description": "True when device is on; false when off.", "refresh.interval": 5 }, { "name": "state/reachable" } ] } ] }

Now the two ON/OFF switches are separated; If I switch on number 1 the number 2 stays off. Too much easy. What's the catch?

LeoeLeoeL commented 7 months ago

I successfully overwrote your DDF over the mine and works.

Smanar commented 7 months ago

So it mean the first DDF is working ? Can add your device to the previous DDF officialy ?

LeoeLeoeL commented 7 months ago

Both DDF work but I'm using yor DDF because I think it's better. My DDF has something strange for me: ... { "type": "$TYPE_ON_OFF_OUTPUT", "restapi": "/lights", "uuid": [ "$address.ext", "0x01" ... { "type": "$TYPE_ON_OFF_OUTPUT", "restapi": "/lights", "uuid": [ "$address.ext", "0x01" ], ... while yours has ... { "type": "$TYPE_ON_OFF_OUTPUT", "restapi": "/lights", "uuid": [ "$address.ext", "0x01" ], ... { "type": "$TYPE_ON_OFF_OUTPUT", "restapi": "/lights", "uuid": [ "$address.ext", "0x02" ], ... My DDF doesn't have 0x02 for the 2nd switch. Is it normal?

Smanar commented 7 months ago

My DDF doesn't have 0x02 for the 2nd switch. Is it normal?

No ^^. It's the endpoint, it's the number on title node, on your you have "01" "02 "F2", 0x01 is for the first gand and 0x02 for the second one. So strange your DDF are working ....

BTW have added the device here https://github.com/dresden-elektronik/deconz-rest-plugin/pull/7712

LeoeLeoeL commented 7 months ago

Thank you