tinytuya icon indicating copy to clipboard operation
tinytuya copied to clipboard

Inkbird ITC-308 Err 914 After a While

Open fernando-excelsense opened this issue 2 months ago • 1 comments

Hi,

I've been polling data from a WiFi enabled thermostat Inkbird ITC-308, but after a while the device keeps responding the following error.

{
    "Error": "Check device key or version",
    "Err": "914",
    "Payload": null
}

I was initially sampling like this every second and I got this error quite frequently. When I changed to sample every 15s, this only happened after a day of testing.

When it gets to this stage, the only way to recover is to power it off and on again. The thing is, the device is still responsive in the Tuya App, so I don't know what the issue really is and if it is preventable.

Any thoughts?

Here is my sample code

import tinytuya
import json
import requests

# "dps": {
#     "12": 0,
#     "101": "C",     // Units (C / F)
#     "102": 0,
#     "104": 236,     // Temperature (C) reported x 10
#     "106": 280,     // Set-point (temperature) x 10
#     "108": 0,
#     "109": 1000,
#     "110": -400,
#     "111": false,
#     "112": false,
#     "113": false,
#     "115": "3",
#     "116": 745,     // Temperature (F) reported (alternate) x 10
#     "117": 5,       // Hyst
#     "118": 5        // hyst
# }

# To generate devices.json file, use python -m tinytuya wizard and input the Tuya Development Platform information
devices_filename = 'devices.json'
file_contents = ''

try:
    with open(devices_filename, 'r') as f:
        file_contents = f.read()
except:
    print(f"File {devices_filename} not found. Exiting.")
    exit()

try:
    devices_info = json.loads(file_contents)
except:
    print(f"Failed to parse contents of {devices_filename} to json format. Exiting.")
    exit()

selected_device = 'Freezer'

selected_device_info = selected_device_info = next((d for d in devices_info if selected_device in d['name']), None)

# Connect to selected device
if (selected_device_info):

    d = tinytuya.OutletDevice(
        dev_id=selected_device_info['id'],
        address=selected_device_info['ip'],
        local_key=selected_device_info['key'], 
        version=3.4)

    # Get Status
    print(json.dumps(d.status() , indent=4))
    
    # Set to C
    d.set_value(101, "C")

    # Set heating, then cooling histeresys
    d.set_value(117, int(5))
    d.set_value(118, int(5))

    # Change setpoint
    d.set_value(106, int(300))
    exit()

fernando-excelsense avatar Nov 07 '25 22:11 fernando-excelsense

Some v3.4 devices have what appears to be a memory corruption bug that causes them to "forget" what their local key is supposed to be until they are rebooted. The only way I know of to recover them once this happens is a reboot. I have been able to prevent this from happening by disabling all broadcasts/multicasts on my WiFi AP, and some people have reported that just enabling "IGMP snooping" or "multicast enhancement" has helped a lot.

uzlonewolf avatar Nov 08 '25 05:11 uzlonewolf