Tuya TS0002 and openHAB

Hi,
I just got a Tuya TS0002 clone (Avatto ZWSM16-2) which is a 2 Gang Zigbee Switch Module. Installation in openHAB works fine, the device is discovered as “Unknown ZigBee Device” and a thing is created with 6 channels (Current, Metering Summation Delivered, two ON_OFF_LIGHT: Switch, Total Active Power, Voltage).
I added the two switches as points and tried to control the switch state via the WebGUI. However, every time, I turn on switch 1, switch 2 is turned on as well and the other way around. This means, the two switches are always in the same position, no matter what I do. This way, my roller shutter, which I’m trying to control, is not moving an inch.
Any ideas what I could do?

… supported by Zigbee2MQTT: AVATTO ZWSM16-2-Zigbee control via MQTT | Zigbee2MQTT

Two options:

  • Post a fingerprint from your device (modifications to the Zigbee binding might be required).
  • Install Zigbee2MQTT, MQTT broker, openHAB MQTT binding.

Getting Zigbee2MQTT and MQTT broker working is a pain. I would post a fingerprint if there is a docu how to do that …

No pain, no gain. :slight_smile: SCNR

Please read the documentation: ZigBee - Bindings | openHAB

Thanks for the docu link. Here is the fingerprint:

openhab> zigbee fingerprint 27140
|>| Node Descriptor
| |> Logical Type               ROUTER
| |> MAC Capabilities           [FULL_FUNCTION_DEVICE, MAINS_POWER, RECEIVER_ON_WHEN_IDLE]
| |> Stack Compliance           21
| |> Server Capabilities        []
| |> Buffer Size                66
| |> Incoming Transfer Size     66
| |> Outgoing Transfer Size     66
|
|>| Power Descriptor
| |> Available Power Sources    [MAINS]
| |> Current Power Source       MAINS
| |> Current Power Mode         RECEIVER_ON_IDLE
| |> Power Level                FULL
|
|>| ZDO
| |> ManagementBindRequest      SUCCESS
| |> IeeeAddressRequest         SUCCESS
| |> ManagementLqiRequest       SUCCESS
| |> ManagementRoutingRequest   TIMEOUT
|
|>| Basic Information
| |> Generic Device Class
| |> Generic Device Type
| |> Manufacturer Name          _TZ3000_mtnpt6ws
| |> Model Indentifier          TS0002
| |> Product Code
| |> Product URL
| |> Date Code
| |> Application Version        72
| |> Software Build ID
| |> Hardware Version           1
| |> Zcl Version                3
| |> Stack Version              0
| |
| |>| Endpoint 1
| | |> Profile                  0104  ZIGBEE_HOME_AUTOMATION
| | |> Device Type              0100  ON_OFF_LIGHT
| | |> Device Version           1
| | |
| | |>| Input Clusters
| | | |
| | | |>| Cluster 0000 Basic
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> FAILURE
| | | | |
| | | | |>| Commands Received
| | | | |> FAILURE
| | | | |
| | | | |>| Attributes Supported
| | | | | |> 0000  ZCL Version                               >> UNSIGNED_8_BIT_INTEGER          3
| | | | | |> 0001  Application Version                       >> UNSIGNED_8_BIT_INTEGER          72
| | | | | |> 0002  Stack Version                             >> UNSIGNED_8_BIT_INTEGER          0
| | | | | |> 0003  HW Version                                >> UNSIGNED_8_BIT_INTEGER          1
| | | | | |> 0004  Manufacturer Name                         >> CHARACTER_STRING                _TZ3000_mtnpt6ws
| | | | | |> 0005  Model Identifier                          >> CHARACTER_STRING                TS0002
| | | | | |> 0006  Date Code                                 >> CHARACTER_STRING
| | | | | |> 0007  Power Source                              >> ENUMERATION_8_BIT               1
| | | | | |> FFDE                                            >> UNSIGNED_8_BIT_INTEGER          13
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         2
| | | | | |> FFFE  Attribute Reporting Status                >> ENUMERATION_16_BIT              0
| | | |
| | | |>| Cluster 0003 Identify
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0004 Groups
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0005 Scenes
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> FAILURE
| | | | |
| | | | |>| Commands Received
| | | | |> FAILURE
| | | | |
| | | | |>| Attributes Supported
| | | | | |> 0000  Scene Count                               >> UNSIGNED_8_BIT_INTEGER          0
| | | | | |> 0001  Current Scene                             >> UNSIGNED_8_BIT_INTEGER          0
| | | | | |> 0002  Current Group                             >> UNSIGNED_16_BIT_INTEGER         0
| | | | | |> 0003  Scene Valid                               >> BOOLEAN                         false
| | | | | |> 0004  Name Support                              >> BITMAP_8_BIT                    0
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         2
| | | |
| | | |>| Cluster 0006 On/Off
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> FAILURE
| | | | |
| | | | |>| Commands Received
| | | | |> FAILURE
| | | | |
| | | | |>| Attributes Supported
| | | | | |> 0000  On Off                                    >> BOOLEAN                         false
| | | | | |> 4001  On Time                                   >> UNSIGNED_16_BIT_INTEGER         0
| | | | | |> 4002  Off Wait Time                             >> UNSIGNED_16_BIT_INTEGER         0
| | | | | |> 5000                                            >> ENUMERATION_8_BIT               1
| | | | | |> 8001                                            >> ENUMERATION_8_BIT               1
| | | | | |> 8002                                            >> ENUMERATION_8_BIT               0
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         2
| | | |
| | | |>| Cluster 0702 Metering
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0B04 Electrical Measurement
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster E000
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster E001
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | |
| | |>| Output Clusters
| | | |
| | | |>| Cluster 000A Time
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0019 Ota Upgrade
| | | | |> Type                 Client [Output]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> FAILURE
| | | | |
| | | | |>| Commands Received
| | | | |> FAILURE
| | | | |
| | | | |>| Attributes Supported
| | | | | |> 0000  Upgrade Server ID                         >> IEEE_ADDRESS                    FFFFFFFFFFFFFFFF
| | | | | |> 0001  File Offset                               >> UNSIGNED_32_BIT_INTEGER         -1
| | | | | |> 0002  Current File Version                      >> UNSIGNED_32_BIT_INTEGER         72
| | | | | |> 0003  Current ZigBee Stack Version              >> UNSIGNED_16_BIT_INTEGER         2
| | | | | |> 0004  Downloaded File Version                   >> UNSIGNED_32_BIT_INTEGER         -1
| | | | | |> 0005  Downloaded ZigBee Stack Version           >> UNSIGNED_16_BIT_INTEGER         65535
| | | | | |> 0006  Image Upgrade Status                      >> ENUMERATION_8_BIT               0
| | | | | |> 0007  Manufacturer ID                           >> UNSIGNED_16_BIT_INTEGER         4417
| | | | | |> 0008  Image Type ID                             >> UNSIGNED_16_BIT_INTEGER         65535
| | | | | |> 0009  Minimum Block Request Period              >> UNSIGNED_16_BIT_INTEGER         0
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         3
| |
| |>| Endpoint 2
| | |> Profile                  0104  ZIGBEE_HOME_AUTOMATION
| | |> Device Type              0100  ON_OFF_LIGHT
| | |> Device Version           1
| | |
| | |>| Input Clusters
| | | |
| | | |>| Cluster 0004 Groups
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |> Unsupported locally
| | | |
| | | |>| Cluster 0005 Scenes
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> FAILURE
| | | | |
| | | | |>| Commands Received
| | | | |> FAILURE
| | | | |
| | | | |>| Attributes Supported
| | | | | |> 0000  Scene Count                               >> UNSIGNED_8_BIT_INTEGER          0
| | | | | |> 0001  Current Scene                             >> UNSIGNED_8_BIT_INTEGER          0
| | | | | |> 0002  Current Group                             >> UNSIGNED_16_BIT_INTEGER         0
| | | | | |> 0003  Scene Valid                               >> BOOLEAN                         false
| | | | | |> 0004  Name Support                              >> BITMAP_8_BIT                    0
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         2
| | | |
| | | |>| Cluster 0006 On/Off
| | | | |> Type                 Server [Input]
| | | | |> Manufacturer Spec.   No
| | | | |
| | | | |>| Commands Generated
| | | | | |> FAILURE
| | | | |
| | | | |>| Commands Received
| | | | |> FAILURE
| | | | |
| | | | |>| Attributes Supported
| | | | | |> 0000  On Off                                    >> BOOLEAN                         false
| | | | | |> 4001  On Time                                   >> UNSIGNED_16_BIT_INTEGER         0
| | | | | |> 4002  Off Wait Time                             >> UNSIGNED_16_BIT_INTEGER         0
| | | | | |> FFFD  Cluster Revision                          >> UNSIGNED_16_BIT_INTEGER         2
| | |
| | |>| Output Clusters
| |
| |>| Endpoint 242
| | |> Profile                  A1E0  ZIGBEE_GREEN_POWER
| | |> Device Type              0061
| | |> Device Version           0

There are major differences between Endpoint 1 and Endpoint 2 in terms of supported clusters and supported attributes, which could explain the behavior. @chris Could you confirm this (and adjust the Zigbee binding if possible)?

What does zigbee nodes say (cf. Aqara button not working anymore after OH3 upgrade - #15 by bartkummel)? Are there two different endpoints (EP)?

Here the output of zigbee nodes

openhab> zigbee nodes
Total known nodes in network: 2
Network  Addr  IEEE Address      Logical Type  State      EP   Profile                    Device Type                Manufacturer     Model
      0  0000  E0798DFFFEB3D751  COORDINATOR   ONLINE
  27140  6A04  A4C13859E675C5A1  ROUTER        ONLINE      1  ZIGBEE_HOME_AUTOMATION     ON_OFF_LIGHT               _TZ3000_mtnpt6ws  TS0002
                                                           2  ZIGBEE_HOME_AUTOMATION     ON_OFF_LIGHT
                                                         242  ZIGBEE_GREEN_POWER         0061

Looks OK to me. Let’s wait for input from forum members more knowledgeable than me.

Would anybody be able to help here?

Okay, I got it working using zigbee2mqtt. I don’t like this solution because it takes up resources (close to 1GB of SD storage and half of my available RAM) but it works. I really hope the zigbee binding will be enhanced to support more devices, this way would more be a lot more resource efficient.
Mostly, I followed this guide: openHAB 3 - Zigbee über MQTT steuern - Hoerli.NET (german but can be translated well).
The tricky part at the end was to set the channels up correctly. I managed to get things working with the following channel config:

channels:
  - id: Switch1
    channelTypeUID: mqtt:switch
    label: Switch1
    description: ""
    configuration:
      commandTopic: zigbee2mqtt/TS0002/set
      formatBeforePublish: '{"state_l1": "%s"}'
      stateTopic: zigbee2mqtt/TS0002
      transformationPattern: JSONPATH:$.state_l1
      off: OFF
      on: ON
  - id: Switch2
    channelTypeUID: mqtt:switch
    label: Switch2
    description: null
    configuration:
      commandTopic: zigbee2mqtt/TS0002/set
      formatBeforePublish: '{"state_l2": "%s"}'
      stateTopic: zigbee2mqtt/TS0002
      transformationPattern: JSONPATH:$.state_l2
      off: OFF
      on: ON

TS0002 needs to be replaced with whatever your device friendly_name is in /opt/zigbee2mqtt/data/configuration.yaml
Hope this helps anyone …

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.