This a error from the Tuya api, the restart trigger a second login in a time period of 60 sec. I have a idea, I don't if it will work.
Python Plugin: TUYA
Moderator: leecollings
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
This
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
What is the best way to switch a Tuya lamp from LUA? On/off and color temp?
Hans
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
I use DzVents setColorBrightness(r, g, b, br, cw, ww, m, t)
https://www.domoticz.com/wiki/DzVents:_ ... .2FApplamp
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
Made a new update there is now a start-up time out for 60 seconds to prevent the login in the same minute.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
- EdwinK
- Posts: 1820
- Joined: Sunday 22 January 2017 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Rhoon
- Contact:
Re: Python Plugin: TUYA
Thanks. Will update and see
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
- EdwinK
- Posts: 1820
- Joined: Sunday 22 January 2017 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Rhoon
- Contact:
Re: Python Plugin: TUYA
Updated to version 1.0.7, and now the error is:
2021-04-16 22:06:28.657 Error: Tuya: (Tuya) handleThread: Expecting value: line 1 column 1 (char 0) line 207
2021-04-16 22:06:37.243 Error: Tuya: (Tuya) handleThread: Expecting value: line 1 column 1 (char 0) line 207
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
I can't recreate your error, change a command hopefully it will fix this error.EdwinK wrote: ↑Friday 16 April 2021 22:18 Updated to version 1.0.7, and now the error is:
2021-04-16 22:06:28.657 Error: Tuya: (Tuya) handleThread: Expecting value: line 1 column 1 (char 0) line 207
2021-04-16 22:06:37.243 Error: Tuya: (Tuya) handleThread: Expecting value: line 1 column 1 (char 0) line 207
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
- EdwinK
- Posts: 1820
- Joined: Sunday 22 January 2017 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Rhoon
- Contact:
Re: Python Plugin: TUYA
At the moment it isn't working at all
2021-04-17 20:57:42.154 Tuya: (Tuya) Waiting 60 seconds to connect TuyaApi login timeout
2021-04-17 20:57:48.895 Status: User: Admin (IP: 192.168.0.14) initiated a switch command (1039/Tuya - LED Strip RGB+W/On)
2021-04-17 20:58:16.088 Status: User: Admin (IP: 192.168.0.14) initiated a switch command (1039/Tuya - LED Strip RGB+W/On)
2021-04-17 20:58:36.160 Error: Tuya hardware (52) thread seems to have ended unexpectedly
2021-04-17 20:58:42.214 Tuya: (Tuya) TUYA plugin started
2021-04-17 20:58:42.214 Tuya: (Tuya) Debug logging mask set to: PYTHON CONNECTION
2021-04-17 20:58:42.214 Tuya: (Tuya) 'HardwareID':'52'
2021-04-17 20:58:42.214 Tuya: (Tuya) 'HomeFolder':'/home/pi/domoticz/plugins/TUYA/'
2021-04-17 20:58:42.214 Tuya: (Tuya) 'StartupFolder':'/home/pi/domoticz/'
2021-04-17 20:58:42.214 Tuya: (Tuya) 'UserDataFolder':'/home/pi/domoticz/'
2021-04-17 20:58:42.214 Tuya: (Tuya) 'Database':'/home/pi/domoticz/domoticz.db'
2021-04-17 20:58:42.214 Tuya: (Tuya) 'Language':'en'
2021-04-17 20:58:42.214 Tuya: (Tuya) 'Version':'1.0.6'
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
- EdwinK
- Posts: 1820
- Joined: Sunday 22 January 2017 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Rhoon
- Contact:
Re: Python Plugin: TUYA
It seemst that the connector in the LED-string has brokken, so it might be that that is the problem. Not having another device to try it with.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
These are normal startup messages. Ps. you are on version 1.0.6 or didn't restart Domoticz after update.EdwinK wrote: ↑Saturday 17 April 2021 20:59 At the moment it isn't working at all
2021-04-17 20:57:42.154 Tuya: (Tuya) Waiting 60 seconds to connect TuyaApi login timeout
2021-04-17 20:57:48.895 Status: User: Admin (IP: 192.168.0.14) initiated a switch command (1039/Tuya - LED Strip RGB+W/On)
2021-04-17 20:58:16.088 Status: User: Admin (IP: 192.168.0.14) initiated a switch command (1039/Tuya - LED Strip RGB+W/On)
2021-04-17 20:58:36.160 Error: Tuya hardware (52) thread seems to have ended unexpectedly
2021-04-17 20:58:42.214 Tuya: (Tuya) TUYA plugin started
2021-04-17 20:58:42.214 Tuya: (Tuya) Debug logging mask set to: PYTHON CONNECTION
2021-04-17 20:58:42.214 Tuya: (Tuya) 'HardwareID':'52'
2021-04-17 20:58:42.214 Tuya: (Tuya) 'HomeFolder':'/home/pi/domoticz/plugins/TUYA/'
2021-04-17 20:58:42.214 Tuya: (Tuya) 'StartupFolder':'/home/pi/domoticz/'
2021-04-17 20:58:42.214 Tuya: (Tuya) 'UserDataFolder':'/home/pi/domoticz/'
2021-04-17 20:58:42.214 Tuya: (Tuya) 'Database':'/home/pi/domoticz/domoticz.db'
2021-04-17 20:58:42.214 Tuya: (Tuya) 'Language':'en'
2021-04-17 20:58:42.214 Tuya: (Tuya) 'Version':'1.0.6'
That's not good ...
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
- EdwinK
- Posts: 1820
- Joined: Sunday 22 January 2017 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Rhoon
- Contact:
Re: Python Plugin: TUYA
It said on the the hardware ta it is version 1.0.7 but since I have no Tuya stuff at the moment, cant' test it
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
-
- Posts: 708
- Joined: Saturday 27 February 2016 12:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: NL
- Contact:
Re: Python Plugin: TUYA
Good. That way I can set all lamps to the same color temperature. The color picker wheel just doesn't allow that kind of precision.Xenomes wrote: ↑Friday 16 April 2021 20:40I use DzVents setColorBrightness(r, g, b, br, cw, ww, m, t)
https://www.domoticz.com/wiki/DzVents:_ ... .2FApplamp
Hans
-
- Posts: 51
- Joined: Tuesday 22 April 2014 22:17
- Target OS: OS X
- Domoticz version: Beta
- Location: France
- Contact:
Re: Python Plugin: TUYA
Hello,
I have un problem while running this plug-in :
I'm running domoticz in a container, so with a minimal OS. Is there something missing?
I have un problem while running this plug-in :
Code: Select all
2021-04-22 12:23:52.523 Tuya: (Tuya) TUYA plugin started
2021-04-22 12:23:52.523 Tuya: (Tuya) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE
2021-04-22 12:23:52.523 Tuya: (Tuya) 'HardwareID':'15'
2021-04-22 12:23:52.523 Tuya: (Tuya) 'HomeFolder':'/domoticz/plugins/Domoticz-TUYA-Plugin/'
2021-04-22 12:23:52.523 Tuya: (Tuya) 'StartupFolder':'/domoticz/'
2021-04-22 12:23:52.523 Tuya: (Tuya) 'UserDataFolder':'/domoticz/'
2021-04-22 12:23:52.523 Tuya: (Tuya) 'Database':'/config/domoticz.db'
2021-04-22 12:23:52.523 Tuya: (Tuya) 'Language':'fr'
2021-04-22 12:23:52.523 Tuya: (Tuya) 'Version':'1.0.7b'
2021-04-22 12:23:52.523 Tuya: (Tuya) 'Author':'Wagner Oliveira'
2021-04-22 12:23:52.523 Tuya: (Tuya) 'Name':'Tuya'
2021-04-22 12:23:52.524 Tuya: (Tuya) 'Port':'0'
2021-04-22 12:23:52.524 Tuya: (Tuya) 'Username':'******@******.***'
2021-04-22 12:23:52.524 Tuya: (Tuya) 'Password':'*************'
2021-04-22 12:23:52.524 Tuya: (Tuya) 'Key':'tuya'
2021-04-22 12:23:52.524 Tuya: (Tuya) 'Mode1':'33'
2021-04-22 12:23:52.524 Tuya: (Tuya) 'Mode2':'tuya'
2021-04-22 12:23:52.524 Tuya: (Tuya) 'Mode6':'-1'
2021-04-22 12:23:52.524 Tuya: (Tuya) 'DomoticzVersion':'2021.1'
2021-04-22 12:23:52.524 Tuya: (Tuya) 'DomoticzHash':'8547c5b7e'
2021-04-22 12:23:52.524 Tuya: (Tuya) 'DomoticzBuildTime':'2021-04-17 17:29:11'
2021-04-22 12:23:52.524 Tuya: (Tuya) Device count: 0
2021-04-22 12:23:52.525 Tuya: (Tuya) in handlethread
2021-04-22 12:23:52.577 Tuya: (Tuya) Pushing 'onHeartbeatCallback' on to queue
2021-04-22 12:23:52.627 (Tuya) Processing 'onHeartbeatCallback' message
2021-04-22 12:23:52.687 Tuya: (Tuya) Calling message handler 'onHeartbeat'.
2021-04-22 12:23:52.687 Tuya: (Tuya) onHeartbeat called time=1619087032.6875422
2021-04-22 12:23:52.687 Tuya: (Tuya) in handlethread
2021-04-22 12:23:53.915 Error: Tuya: (Tuya) handleThread: Expecting value: line 1 column 1 (char 0) line 207
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
Thanks for the include log, I saw the problem and create a fix. Please check version 1.0.8
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
-
- Posts: 51
- Joined: Tuesday 22 April 2014 22:17
- Target OS: OS X
- Domoticz version: Beta
- Location: France
- Contact:
Re: Python Plugin: TUYA
Thank you. No more errors anymore!
But I don’t see my Tuya device in Domoticz. Device count stay at 0. I have a eMylo EAI-90 that I can control with Tuya App.
How can I check what is happening?
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
You can run the debug_discovery.py from the tools directory it will show if your device is detected by the tuyaapi.
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
-
- Posts: 51
- Joined: Tuesday 22 April 2014 22:17
- Target OS: OS X
- Domoticz version: Beta
- Location: France
- Contact:
Re: Python Plugin: TUYA
Here is the result :
Does it mean the device is not supported ? Is that on Tuyaapi side, or Tuya side?
Code: Select all
Getting credentials
Got credentials
{ 'access_token': 'EUxxxxx',
'expires_in': 864000,
'refresh_token': 'EUxxx',
'token_type': 'bearer'}
Getting devices
Got devices
{ 'header': {'code': 'SUCCESS', 'payloadVersion': 1},
'payload': {'devices': [], 'scenes': []}}
!!! NOW REMOVE THIS FILE, SO YOUR CREDENTIALS (username, password) WON'T LEAK !!!
- Xenomes
- Posts: 379
- Joined: Tuesday 27 November 2018 19:05
- Target OS: Linux
- Domoticz version: 2024.7
- Location: Netherlands
- Contact:
Re: Python Plugin: TUYA
Sorry the device is not supported by api of Tuya. Result devices': [],MacJL wrote: ↑Thursday 22 April 2021 22:28 Here is the result :
Does it mean the device is not supported ? Is that on Tuyaapi side, or Tuya side?Code: Select all
Getting credentials Got credentials { 'access_token': 'EUxxxxx', 'expires_in': 864000, 'refresh_token': 'EUxxx', 'token_type': 'bearer'} Getting devices Got devices { 'header': {'code': 'SUCCESS', 'payloadVersion': 1}, 'payload': {'devices': [], 'scenes': []}} !!! NOW REMOVE THIS FILE, SO YOUR CREDENTIALS (username, password) WON'T LEAK !!!
The only thing what you can do is https://github.com/Xenomes/Domoticz-TUY ... hould-i-do
HP T630 (32GB SSD/8GB Mem) - Ubuntu 22.04.4 LTS (64Bit) - Domoticz 2024.7 with Machinon theme - RFLink - KaKu - Sonoff - Tasmota - Shelly - MQTT2Zigbee - OpenTherm Gateway - Tinytuya - IR Blaster - P1 Smart Meter - NPN Watermeter - Google Assistant
-
- Posts: 51
- Joined: Tuesday 22 April 2014 22:17
- Target OS: OS X
- Domoticz version: Beta
- Location: France
- Contact:
Re: Python Plugin: TUYA
Thank you for your help.Xenomes wrote: ↑Thursday 22 April 2021 22:44 Sorry the device is not supported by api of Tuya. Result devices': [],
The only thing what you can do is https://github.com/Xenomes/Domoticz-TUY ... hould-i-do
What’s frustrating, is that I can control this device with the tuyaapi project. Does someone know if there is an other maintained Domoticz plug-in that use this API instead of tuyaha ?
-
- Posts: 51
- Joined: Tuesday 22 April 2014 22:17
- Target OS: OS X
- Domoticz version: Beta
- Location: France
- Contact:
Re: Python Plugin: TUYA
For those who are interested, I just found a workaround... ...by developing my own plugin!
As this Tuya device was supported by an Homebridge plugin, I developed a Domoticz plugin to get infos and control Homebridge in Insecure mode.
https://github.com/macjl/Domoticz-HomekitInsecureClient
Now I’m able to switch on and off this Tuya Devive from Domoticz!
As this Tuya device was supported by an Homebridge plugin, I developed a Domoticz plugin to get infos and control Homebridge in Insecure mode.
https://github.com/macjl/Domoticz-HomekitInsecureClient
Now I’m able to switch on and off this Tuya Devive from Domoticz!
Who is online
Users browsing this forum: No registered users and 1 guest