Skip to content

Cover Controls freezing up #653

@Demax121

Description

@Demax121

Hi, I'm using Tuya blinds motor model: LY-1690, version 3.4, battery powered with USB-C charging. WiFi + RF
The issue I have encauntered is:

This code works perfectly:

import os
import tinytuya
import json
import subprocess
import time
DEVICE_ID = os.environ.get('DEVICE_ID')
DEVICE_IP = os.environ.get('DEVICE_IP')
LOCAL_KEY = os.environ.get('DEVICE_LOCAL_KEY')
VERSION = os.environ.get('DEVICE_VERSION')
DPS = 1


d = tinytuya.OutletDevice(DEVICE_ID, DEVICE_IP, LOCAL_KEY)
d.set_version(VERSION)
d.set_socketPersistent(False)
d.set_value(DPS, 'close')

data = d.status()
result = {
    "state": data['dps']['1'],
    "battery": data['dps']['13']
}
print(json.dumps(result))

But if we use

d = tinytuya.CoverDevice(DEVICE_ID, DEVICE_IP, LOCAL_KEY)
d.set_version(VERSION)
d.set_socketPersistent(False)
d.open_cover(switch=1)
data = d.status()
result = {
    "state": data['dps']['1'],
    "battery": data['dps']['13']
}
print(json.dumps(result))

the d.open_cover(switch=1) will sometimes work, sometimes not work.
If we have for example close_blinds.py, open_blinds.py, status_blinds.py

The status_blinds.py will always work perfectly fine doesn't matter if it`s the 'CoverDevice; or 'OutletDevice' but if we call for example an open_blinds.py and it works, then after that calling close_blinds.py won't work. All of those use 'CoverDevice' and d.open/close_cover(switch=1) function. So there is a workorund for that but I just let you know there are some issues.

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