Python Plugin: Domoticz-TinyTUYA-Plugin (Cloud)

Python and python framework

Moderator: leecollings

Post Reply
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

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

Post 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).
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
dgilbert2
Posts: 95
Joined: Wednesday 16 August 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: UK
Contact:

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

Post by dgilbert2 »

No errors, just a blank list of devices. Must be a server issue?
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

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

Post by heggink »

Unlikely since the tinytuya command line works...
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
dgilbert2
Posts: 95
Joined: Wednesday 16 August 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: UK
Contact:

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

Post 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.
User avatar
Xenomes
Posts: 397
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

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

Post 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.
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2024.7 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

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

Post by heggink »

Just updated and everything is back again! Thx!!!
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
dgilbert2
Posts: 95
Joined: Wednesday 16 August 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: UK
Contact:

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

Post by dgilbert2 »

python3 -m tinytuya wizard

and

debug_discovery.py

still do not show my devices (tinytuya 1.12.3)?
User avatar
Xenomes
Posts: 397
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

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

Post by Xenomes »

heggink wrote: Wednesday 12 April 2023 20:28 Just updated and everything is back again! Thx!!!
Good to hear!
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2024.7 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
User avatar
Xenomes
Posts: 397
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

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

Post 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'?
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2024.7 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
dgilbert2
Posts: 95
Joined: Wednesday 16 August 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: UK
Contact:

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

Post 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
dgilbert2
Posts: 95
Joined: Wednesday 16 August 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: UK
Contact:

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

Post 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
User avatar
Xenomes
Posts: 397
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

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

Post 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.
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2024.7 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
dgilbert2
Posts: 95
Joined: Wednesday 16 August 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: UK
Contact:

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

Post by dgilbert2 »

I updated with sudo pip3 install tinytuya -U

Is that right?
User avatar
Xenomes
Posts: 397
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

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

Post 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.
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2024.7 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
dgilbert2
Posts: 95
Joined: Wednesday 16 August 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: UK
Contact:

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

Post 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 :)
User avatar
Xenomes
Posts: 397
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

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

Post 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!
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2024.7 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
User avatar
Varazir
Posts: 379
Joined: Friday 20 February 2015 22:23
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

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

Post 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.
Raspberry PI 2 with RaZberry Controller 2016 ZWave+ and CC2531(zigbee)
Several IKEA devices/z-wave devices
User avatar
Xenomes
Posts: 397
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

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

Post by Xenomes »

Can you put the plugin on debug all, then the plugin will give a line where the error condors.
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2024.7 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
User avatar
heggink
Posts: 978
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

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

Post 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.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
Xenomes
Posts: 397
Joined: Tuesday 27 November 2018 19:05
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

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

Post 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.
HP T630 (256GB SSD/8GB Mem) - Ubuntu 24.04.2 LTS (64Bit) - Domoticz 2024.7 (Docker) Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest