Page 26 of 26

Re: Python Plugin: TUYA

Posted: Sunday 03 November 2024 21:31
by manjh
Tuya worked OK from Domoticz for a little while, but the problems are back.
When I got home tonight, all Tuya devices were not accessibel from Domoticz. But the Tuya app worked OK.
There were no specific error messages in the Domoticz log.

I then tried to disable the plugin in the hardware tab, waited a little bit, and enabled it again. That corrected the problems... but for how long? :?

Re: Python Plugin: TUYA

Posted: Friday 08 November 2024 10:32
by manjh
New info. Following instinct, I decided to set up a spare Tuya smartplug and send a switch command to it every hour. This has been running now for a few days, and the Tuya interface seems to stay active this way.
Does this make sense? Is it possible that the Tuya interface "dies" if it hasn't been used for a while?

Re: Python Plugin: TUYA

Posted: Thursday 14 November 2024 9:34
by manjh
OK, I have finally bit the bullet and started to set up a new Pi4 with Domoticz. Now am trying to install the Tuya plugin, but am running into some obstacles.
First, when I follow the link from the Domoticz Wiki, I see the github entry saying the plugin is no longer supported. It points me to TinyTuya.
When I follow the installation instructions for TinyTuya, I get an error message: "error: externally-managed-environment".
What should I do to install?

Re: Python Plugin: TUYA

Posted: Thursday 14 November 2024 19:29
by waltervl
manjh wrote: Thursday 14 November 2024 9:34 OK, I have finally bit the bullet and started to set up a new Pi4 with Domoticz. Now am trying to install the Tuya plugin, but am running into some obstacles.
First, when I follow the link from the Domoticz Wiki, I see the github entry saying the plugin is no longer supported. It points me to TinyTuya.
When I follow the installation instructions for TinyTuya, I get an error message: "error: externally-managed-environment".
What should I do to install?
The dirty way is to add --break-system-packages at the end of the pip3 install module or requirements command line.
For example

Code: Select all

sudo pip3 install -r requirements.txt --break-system-packages

Re: Python Plugin: TUYA

Posted: Friday 15 November 2024 10:01
by manjh
waltervl wrote: Thursday 14 November 2024 19:29
manjh wrote: Thursday 14 November 2024 9:34 OK, I have finally bit the bullet and started to set up a new Pi4 with Domoticz. Now am trying to install the Tuya plugin, but am running into some obstacles.
First, when I follow the link from the Domoticz Wiki, I see the github entry saying the plugin is no longer supported. It points me to TinyTuya.
When I follow the installation instructions for TinyTuya, I get an error message: "error: externally-managed-environment".
What should I do to install?
The dirty way is to add --break-system-packages at the end of the pip3 install module or requirements command line.
For example

Code: Select all

sudo pip3 install -r requirements.txt --break-system-packages
Thank you, that worked! :)

Re: Python Plugin: TUYA

Posted: Thursday 21 November 2024 16:33
by manjh
manjh wrote: Friday 08 November 2024 10:32 New info. Following instinct, I decided to set up a spare Tuya smartplug and send a switch command to it every hour. This has been running now for a few days, and the Tuya interface seems to stay active this way.
Does this make sense? Is it possible that the Tuya interface "dies" if it hasn't been used for a while?
Still on my "old" server, running Buster.
This stay-alive solution has worked sofar. Until day before yesterday: I forgot what the empty smartplug was for, so I removed it from the socket and stored it for later use. And sure enough, the Tuya interface stopped working overnight. I had to disable the plugin, wait a while, and enable it again...
Needless to say that the seemingly "unused" smartplug has found its place in the socket again...

Does this make sense to anyone? Is it possible that the interface goes into deep sleep after a period of inactivity?

Re: Python Plugin: TUYA

Posted: Tuesday 10 December 2024 12:34
by manjh
I ran into a strange problem.
Last week, after using the smartplug for many months, it suddenly was unreachable from Domoticz. The Tuya app had no problem switching it off/on.
I tried to revive it by removing it from Domoticz and the Tuya plugin, and from the Tuya app. Then reset the device and installed it into the Tuya app, and it flowed into Domoticz. Still no luck: I cannot control the device from Domoticz.
So I decided to give up, and ordered a few new plugs (ZIgbee, this time).

This morning a second smartplug shows the same signs. Not reachable from Domoticz, everything OK from the Tuya app.

Any idea what may be going on? All other Tuya devices (lightbulbs, smartplugs, window sensors, temperature sensors) seem to be just fine...

I am using R-Pi4 with Buster, Domoticz 2022.2 with TUYA Plugin v.1.0.13. I realize they are out of date, but switching over to Bookworm with all new plugins on Domoticz is not trivial so it is still on my workstack... :(

Re: Python Plugin: TUYA

Posted: Tuesday 10 December 2024 23:15
by manjh
manjh wrote: Tuesday 10 December 2024 12:34 I ran into a strange problem.
Last week, after using the smartplug for many months, it suddenly was unreachable from Domoticz. The Tuya app had no problem switching it off/on.
I tried to revive it by removing it from Domoticz and the Tuya plugin, and from the Tuya app. Then reset the device and installed it into the Tuya app, and it flowed into Domoticz. Still no luck: I cannot control the device from Domoticz.
So I decided to give up, and ordered a few new plugs (ZIgbee, this time).

This morning a second smartplug shows the same signs. Not reachable from Domoticz, everything OK from the Tuya app.

Any idea what may be going on? All other Tuya devices (lightbulbs, smartplugs, window sensors, temperature sensors) seem to be just fine...

I am using R-Pi4 with Buster, Domoticz 2022.2 with TUYA Plugin v.1.0.13. I realize they are out of date, but switching over to Bookworm with all new plugins on Domoticz is not trivial so it is still on my workstack... :(
Problem solved, although I donot really and fully understand why.

This afternoon I was wondering why these two smartplugs are failing, and all the others are not. The only thing I could think of: they are both located in my garage, the others are not. So I decided to restart the mesh accesspoint in the garage. And sure enough: both plugs are fully functional again, both from Tuya app and Domoticz!
So why were the plugs failing in Domoticz, and not in Tuya app? Could be timing related, perhaps? Hmmm...
But the good news: everything works again!