Error Codes

Error messages and formatting

Module Attributes

ERR_JSON

Invalid JSON Response from Device

ERR_CONNECT

Network Error: Unable to Connect

ERR_TIMEOUT

Timeout Waiting for Device

ERR_RANGE

Specified Value Out of Range

ERR_PAYLOAD

Unexpected Payload from Device

ERR_OFFLINE

Network Error: Device Unreachable

ERR_STATE

Device in Unknown State

ERR_FUNCTION

Function Not Supported by Device

ERR_DEVTYPE

Device22 Detected: Retry Command

ERR_CLOUDKEY

Missing Tuya Cloud Key and Secret

ERR_CLOUDRESP

Invalid JSON Response from Cloud

ERR_CLOUDTOKEN

Unable to Get Cloud Token

ERR_PARAMS

Missing Function Parameters

ERR_CLOUD

Error Response from Tuya Cloud

ERR_KEY_OR_VER

Check device key or version

error_codes

TinyTuya Error Response Descriptions

tinytuya.ERR_JSON = 900
tinytuya.ERR_CONNECT = 901
tinytuya.ERR_TIMEOUT = 902
tinytuya.ERR_RANGE = 903
tinytuya.ERR_PAYLOAD = 904
tinytuya.ERR_OFFLINE = 905
tinytuya.ERR_STATE = 906
tinytuya.ERR_FUNCTION = 907
tinytuya.ERR_DEVTYPE = 908
tinytuya.ERR_CLOUDKEY = 909
tinytuya.ERR_CLOUDRESP = 910
tinytuya.ERR_CLOUDTOKEN = 911
tinytuya.ERR_PARAMS = 912
tinytuya.ERR_CLOUD = 913
tinytuya.ERR_KEY_OR_VER = 914
tinytuya.error_codes = {}

TinyTuya Error Response Descriptions

  • 900 - ‘Invalid JSON Response from Device’

  • 901 - ‘Network Error: Unable to Connect’

  • 902 - ‘Timeout Waiting for Device’

  • 903 - ‘Specified Value Out of Range’

  • 904 - ‘Unexpected Payload from Device’

  • 905 - ‘Network Error: Device Unreachable’

  • 906 - ‘Device in Unknown State’

  • 907 - ‘Function Not Supported by Device’

  • 908 - ‘Device22 Detected: Retry Command’

  • 909 - ‘Missing Tuya Cloud Key and Secret’

  • 910 - ‘Invalid JSON Response from Cloud’

  • 911 - ‘Unable to Get Cloud Token’

  • 912 - ‘Missing Function Parameters’

  • 913 - ‘Error Response from Tuya Cloud’

  • 914 - ‘Check device key or version’

  • None - ‘Unknown Error’

Functions

error_json([number, payload])

Return error details in JSON