TS0601 by _TZE284_koxaopnk blind chain motor Quirk - sort of working

Hello,

I recently purchased this device

just to test it out. This has thrust me into the wonderful world of quirks which i recently discovered. Not being a coder, this is what i have come up with (with co-pilot doing all the heavy lifting)

The blinds function up, down, stop. However there is no battery data. Has anyone had any luck with this? There is no slider for the current position either.

given i spent about 20 hours figuring it out, someone else might be able to build on it :smiley:

from zhaquirks.tuya.builder import TuyaQuirkBuilder
import zigpy.types as t

class CoverAction(t.enum8):
    Open = 0x00
    Stop = 0x01
    Close = 0x02

(
    TuyaQuirkBuilder("_TZE284_koxaopnk", "TS0601")
    .tuya_enum(
        dp_id=1,
        attribute_name="cover_action",
        enum_class=CoverAction,
        translation_key="cover_action",
        fallback_name="Cover Action",
        entity_type="standard",
    )
    .tuya_number(
        dp_id=3,
        attribute_name="current_position",
        type=t.uint8_t,
        device_class="cover",
        unit="percent",
        min_value=0,
        max_value=100,
        step=1,
        translation_key="current_position",
        fallback_name="Blind Position",
    )
    .tuya_battery(dp_id=13)
    .skip_configuration()
    .add_to_registry()
)

Ok, i think i have formed the opinion this device does not send its battery information unsolicited (unless this particular unit is faulty). I havenโ€™t seen anything in the logs over a few days.

I did get 1 hit once, after it had drained power completely and I plugged it into power, but it was 50% (which is unlikely since it just died) so I guess it was just dummy info on initialization.

Oh well. Hope this saves someone else some time!