Page 6 of 12

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 14:38
by heggink
Didn't that throw a bunch of errors? Now nothing gets back even though the tinytuya command stuff works....

ps: I noticed there is a rudimentary tinytuya2mqtt thing out there. Would be interesting to see if that may prove to be a good basis combined with the MQTT autodiscovery. I am not a big fan of python plugins doing all sorts of internet requests as it hogs domoticz when the response is challenged (unless the async framework is used which tinytuya does not).

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 19:53
by dgilbert2
No errors, just a blank list of devices. Must be a server issue?

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 19:59
by heggink
Unlikely since the tinytuya command line works...

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 20:08
by dgilbert2
Just tried again:

python3 -m tinytuya wizard

and

debug_discovery.py

Both give "list of devices" as [ ]

Just logged into my iot platform account and all the devices are there. Most odd that tinytuya is not picking them up at the moment.

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 20:15
by Xenomes
heggink wrote: Wednesday 12 April 2023 19:59 Unlikely since the tinytuya command line works...
dgilbert2 wrote: Wednesday 12 April 2023 20:08 Just tried again:
...
The plugin is fixed, pull version 1.5.0 is compatible with Tinytuya 1.12.3 library.

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 20:28
by heggink
Just updated and everything is back again! Thx!!!

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 20:34
by dgilbert2
python3 -m tinytuya wizard

and

debug_discovery.py

still do not show my devices (tinytuya 1.12.3)?

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 20:35
by Xenomes
heggink wrote: Wednesday 12 April 2023 20:28 Just updated and everything is back again! Thx!!!
Good to hear!

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 20:48
by Xenomes
dgilbert2 wrote: Wednesday 12 April 2023 20:34 python3 -m tinytuya wizard
and
debug_discovery.py

still do not show my devices (tinytuya 1.12.3)?
What message do you get with 'python3 -m tinytuya wizard'?

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 20:50
by dgilbert2
Just updated the debug_discover.py code and I get this error:

No device data returnd for Tuya. Trying again!
No device data returnd for Tuya. Trying again!
No device data returnd for Tuya. Trying again!

The wizard gives me:

Code: Select all

Device Listing

[]

>> Saving list to devices.json
    0 registered devices saved

>> Saving raw TuyaPlatform response to tuya-raw.json

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 20:53
by dgilbert2
The raw file contains:

Code: Select all

{
    "result": [],
    "success": true,
    "t": 1681325388142,
    "tid": "xxxxxx",
    "fetches": 1,
    "total": 0,
    "file": {
        "name": "tuya-raw.json",
        "description": "Full raw list of Tuya devices.",
        "account": "xxxxxxx",
        "date": "2023-04-12T19:49:48.177489",
        "tinytuya": "1.11.0"
    }
}
Yet my tinytuya is updated to 1.12.3

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 21:58
by Xenomes
dgilbert2 wrote: Wednesday 12 April 2023 20:53

Code: Select all

"tinytuya": "1.11.0"
Yet my tinytuya is updated to 1.12.3
Did you update with or without sudo? Domoticz runs as root so with most systems sudo is needed except docker.

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 22:02
by dgilbert2
I updated with sudo pip3 install tinytuya -U

Is that right?

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 22:05
by Xenomes
Oops, for Domoticz that is correct. But for the debug script and tinytuya python command is run on user 😅 or run script with sudo of update also without sudo.

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 22:20
by dgilbert2
Xenomes wrote: Wednesday 12 April 2023 22:05 Oops, for Domoticz that is correct. But for the debug script and tinytuya python command is run on user 😅 or run script with sudo of update also without sudo.
Many thanks, so for me if I add sudo when executing the wizard / debug scripts it all work again :)

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Wednesday 12 April 2023 22:22
by Xenomes
dgilbert2 wrote: Wednesday 12 April 2023 22:20 Many thanks, so for me if I add sudo when executing the wizard / debug scripts it all work again :)
Good to hear!

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Thursday 04 May 2023 15:53
by Varazir
Hi I keep getting this

Code: Select all

2023-05-04 15:29:18.605 TinyTUYA: Update devices in Domoticz
2023-05-04 15:29:18.608 Error: TinyTUYA: Device read failed: bfd6bda7f3a84e2064d97h
The plugin works as I can turn of a fan I have that uses TUYA.

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Thursday 04 May 2023 15:58
by Xenomes
Can you put the plugin on debug all, then the plugin will give a line where the error condors.

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Thursday 04 May 2023 16:12
by heggink
Question: is anyone running this plugin in a docker environment? I am considering moving my entire environment to docker so interested to see whether there are any issues with that.

Re: Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Posted: Thursday 04 May 2023 16:25
by Xenomes
heggink wrote: Thursday 04 May 2023 16:12 Question: is anyone running this plugin in a docker environment? I am considering moving my entire environment to docker so interested to see whether there are any issues with that.
The plugin does work in docker but there is a small catch. In the docker environment of Domoticz the install guide needs to installed. So if the docker is renewed for a update, the install guide need to be reinstalled in the docker environment.