Skip to content

Problem communicating with 2 gang switch #259

@owl770

Description

@owl770

Hi,
I have a number of switches that I am able to communicate with - they include a 3 gang switch and dimmer switches. They work well.
I also have a 2 gang switch that I am having trouble communicating with. The "Smart Life" Android app controls all the switches OK.

The switch broadcasts UDP packets with the following data:
{"ip":"192.168.1.23","gwId":"0720009584f3eb84f920","active":2,"ability":0,"mode":0,"encrypt":true,"productKey":"kZbvCqK7zvFiCGl1","version":"3.1"}

tuya-cli --list-app returns:

Devices(s):
[ { name: 'C&E 2 Gang Switch',
    id: 'bf159f984c175cdccelh3p',
    key: '703a87d2b5c3eb33' },
  { name: 'C&E 3 Gang Switch',
    id: '02861367840d8ea29700',
    key: 'd81faac645a174ab' },
  { name: 'C&E Deck Downlights',
    id: '72016014bcddc2a363cf',
    key: '1b669c9ab7258abb' },
  { name: 'C&E Lounge Downlights',
    id: '72016014bcddc2a33505',
    key: '22726724a2948a77' },
  { name: 'C&E Wall Lights',
    id: '72016014bcddc2a3829e',
    key: 'f23a980a3836f837' } ]

Note that the ID of "C&E 2 Gang Switch" is 22 characters rather than 20. I have been able to ascertain that the 'real' ID is 0720009584f3eb84f920 (from the UDP broadcast packet).

tuya-cli get returns:

tuya-cli get --all --id 0720009584f3eb84f920 --key 703a87d2b5c3eb33
{ devId: '0720009584f3eb84f920', dps: { '1': false, '2': 0 } }

Note that dps 2 is a number rather than a bool.

I have hacked the "list-app" function to display all packets received and found the following...
Firmware is reported as:

{ result:
   [ { typeDesc: 'Wi-Fi Module',
       type: 0,
       currentVersion: '1.0.2',
       timeout: 60,
       upgradeStatus: 0,
       controlType: 0,
       lastUpgradeTime: 0 },
     { typeDesc: 'MCU Module',
       type: 9,
       currentVersion: '1.0.2',
       timeout: 60,
       upgradeStatus: 0,
       controlType: 0,
       lastUpgradeTime: 0 } ],
  t: 1571024307761,
  success: true,
  status: 'ok' }

Schema is reported as:

{ result:
   [ { code: 'countdown_2',
       dpId: 10,
       time: 1570778123867,
       type: 'value',
       value: '0' },
     { code: 'switch_1',
       dpId: 1,
       name: 'Path',
       time: 1571007033478,
       type: 'bool',
       value: 'false' },
     { code: 'switch_2',
       dpId: 2,
       name: 'Pitch',
       time: 1571024123423,
       type: 'bool',
       value: 'false' },
     { code: 'countdown_1',
       dpId: 9,
       time: 1570778123867,
       type: 'value',
       value: '0' } ],
  t: 1571024308235,
  success: true,
  status: 'ok' }

Note that there are 4 dps reported - two of them being "countdown" with a type of "value" and two being "switch" with a type of "bool".

Any suggestions on what further data I need to capture to get this problem investigated/fixed? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions