ZHA custom quirk to work with Tuya TS0601 _TZE204_dapwryy7 occupancy sensor

Changed to large_presence and occupancy detected early this morning, but no one is in the room now and it hasn’t changed back

This is ceiling mounted in the corner of the room. I think it’s picking up interference from the wireless AP mounted in the middle of the room. Moved and works better but if I keep still it thinks I’m not here and clears. Is like a glorified PIR

Piece of shit really. Wouldn’t buy again. Too inconsistent

I now had finally some time to test the Hold Delay Time. Unfortunately, it seems it does not change anything. I tested values 10, 30, and 60. It seems that no matter the value, after leaving the room, about 30 sekonds later the state goes to none. Changes from large_movement to peaceful, are very fast, only a few secons.

Side note, if any one has trouble with the light sensor: For my device I noticed that the the light sensor worked only if it was exposed to a flashlight. Dimm lights were always shown as 0. After further inspection I noticed that a plastic rod guiding the light from the tiny hole on the top to the sensor inside was missing. So I just took a drill bit and made the hole larger. I think it was about 4mm (inside is a larger “tube”, I enlarged the hole to the inner diameter of that tube, once you open it you know what I mean). Now the light sensor works OK. Very dimm lights are still not recognized, but good enough.
Just to be clear, this problem was/is due to a missing piece in the casing. It is not the sensor itself, and it is definitely not the quirks problem!

For the delay time I’m wondering if it’s milliseconds and not seconds…
I think I did a few tests with 10.000 supposing it’s milliseconds and I could see some behaviour change. But what I think is that by default the minimum fade time is 30 seconds and this can’t be changed. Whatever value you choose is set as extra delay time on top of the 30 seconds.

For the light sensor. I was thinking to drill a bigger hole too but then I just changed the device position so that now it faces the window and for me it’s been working great.

I did some comparison since I have a few of these devices. I compared a standard setup (closed case with no hole) with an open case board.

In all tests with different angles the open case version is picking up twice as much light compared to the closed case. They get similar results when facing the windows direct (both hitting 2500 lx).
This may not be a big problem in normal conditions. Yet it could reduce the luminance sensibility in low light conditions where you may want that additional accuracy to determine how dark it is.

Drilling a small hole through the case seems a good option to resolve the problem.
The picture below shows the hole to enlarge (this pic is the standard case with no modifications).

Thank you so much. Swapped in my manufacturer id in to _TZE204_laokfqwu and entities showed up. I have to fiddle with calibration now, but your quirk shows me the controls, so that’s huge progress after trying for half an hour with the one in the zha handler git repo.

Nice ! Thanks for your work !

could you please post your updated quirk with the id . i feel this is too complex for me at the moment .