[APP][Pro] Tuya Local

I did a quick test and it seems to work. Thank you.

Hi Andi,

I have been building something similar for my own house since March, a small local Tuya app on the Python runtime. Three drivers, nothing more. Then time ran out, I stopped working on it, and to be honest I only properly noticed your app afterwards. Yours does the same thing on a much bigger scale, and it does it well.

So I am not going to submit mine or take it any further. Instead I have put the code online as it is, in case anything in there turns out to be useful to you: https://github.com/michelhelsdingen/tuya-local. MIT, no strings attached, and no need to credit me anywhere.

If I were you I would look at the registry first. I spent a while on devices going unavailable until the app was restarted, and it came down to three separate things. An update that mutated a copy of the record instead of the record itself. A cloud import that overwrote a working local key with an older one. And a save that kept the full data point spec, which made it too large for Homey settings, so the registry came back empty after a restart. That last one is the one that matches the restart reports in here. The README explains all three and there are tests for each of them.

There is also a smoke detector driver in there, which I did not see in your list.

Maybe none of it is useful to you, and that is completely fine. Either way, nice work on the app, and on the way you support people in this thread.

Michel

Hi Michel — thank you, and that is a generous way to handle it.

I checked your three registry faults against my own code. The second one lands. My “check local keys” writes a cloud key over the stored one whenever they differ, without asking whether the stored one is currently working — and I widened that check’s reach only yesterday, onto exactly the accounts whose cloud data is most likely stale. You caught a fault I made worse a day ago. It is getting a guard: a device that is connected and receiving data keeps its key.

The third has the same shape with less blast radius here — my DP snapshot is diagnostic, not a device registry, so losing it cannot take a device offline. Still an unbounded write inside a silent catch, which is not defensible. Fixing that too.

The first does not apply: different runtime, and the read-modify-write is atomic on Node’s single thread.

Your smoke detector is a real gap in my list — I will look at your data point mapping when I get to that driver. And you get a line in the changelog :slight_smile:

Thank you

Regards
Andi

Update: new TEST version is ready including the modifications and the new smoke detector driver: Tuya Local | Homey

Can you add Loeffen LFIM6000 ice maker?

It supports switch as boolean and mode as string “big” “small”

Hi John - Could you please configure the device by using the generic driver?

Yes, i haven’t been able to try the app yet. But i wasn’t sure if the generic device was what i was looking for. I won’t be home for a while, but i’ll try when i can. Thanks!