Config Constants

Global Network and File Settings

Module Attributes

MAXCOUNT

How many tries before stopping

SCANTIME

How many seconds to wait before stopping device discovery

UDPKEY

UDP packet payload decryption - md5("yGAdlopoPVldABfn") - credit to tuya-convert

UDPKEY_AP

UDP packet decryption for AP mode - md5("OXLvslCvUxcTPLGO")

UDPPORT

Tuya 3.1 UDP Port

UDPPORTS

Tuya 3.3 encrypted UDP Port

UDPPORTAPP

Tuya app encrypted UDP Port

TCPPORT

Tuya TCP Local Port

TIMEOUT

Seconds to wait for a broadcast

TCPTIMEOUT

Seconds to wait for socket open for scanning

DEFAULT_NETWORK

Default IP network to scan when force scanning

DEVICEFILE

File to save/load device list from

CONFIGFILE

File to save/load Cloud configuration from

RAWFILE

File to save raw Cloud responses to

SNAPSHOTFILE

File to save device snapshots to

DEVICEFILE_SAVE_VALUES

List of additional device properties to save in device list file

tinytuya.MAXCOUNT = 15

How many tries before stopping

tinytuya.SCANTIME = 18

How many seconds to wait before stopping device discovery

tinytuya.UDPKEY = b'l\x1e\xc8\xe2\xbb\x9b\xb5\x9a\xb5\x0b\r\xafd\x9bA\n'

UDP packet payload decryption - md5(“yGAdlopoPVldABfn”) - credit to tuya-convert

tinytuya.UDPKEY_AP = b'\xc6\xf2:\xef\x1c\xaf\xb1p\xb8\xd8\x12\xd7P\x9c\x8em'

UDP packet decryption for AP mode - md5(“OXLvslCvUxcTPLGO”)

tinytuya.UDPPORT = 6666

Tuya 3.1 UDP Port

tinytuya.UDPPORTS = 6667

Tuya 3.3 encrypted UDP Port

tinytuya.UDPPORTAPP = 7000

Tuya app encrypted UDP Port

tinytuya.TCPPORT = 6668

Tuya TCP Local Port

tinytuya.TIMEOUT = 3.0

Seconds to wait for a broadcast

tinytuya.TCPTIMEOUT = 0.4

Seconds to wait for socket open for scanning

tinytuya.DEFAULT_NETWORK = '192.168.0.0/24'

Default IP network to scan when force scanning

tinytuya.DEVICEFILE = 'devices.json'

File to save/load device list from

tinytuya.CONFIGFILE = 'tinytuya.json'

File to save/load Cloud configuration from

tinytuya.RAWFILE = 'tuya-raw.json'

File to save raw Cloud responses to

tinytuya.SNAPSHOTFILE = 'snapshot.json'

File to save device snapshots to

tinytuya.DEVICEFILE_SAVE_VALUES = ('category', 'product_name', 'product_id', 'biz_type', 'model', 'sub', 'icon', 'version', 'last_ip', 'uuid', 'node_id', 'sn', 'mapping')

List of additional device properties to save in device list file

  • category

  • product_name

  • product_id

  • biz_type

  • model

  • sub

  • icon

  • version

  • last_ip

  • uuid

  • node_id

  • sn

  • mapping