Page 6 of 26
Re: Python Plugin: TUYA
Posted: Monday 01 February 2021 21:12
by Xenomes
This are the versions on my machine.
Code: Select all
sudo pip3 install tuyaha requests -U
Requirement already up-to-date: tuyaha in /usr/local/lib/python3.7/dist-packages (0.0.10)
Requirement already up-to-date: requests in /usr/local/lib/python3.7/dist-packages (2.25.1)
Requirement already satisfied, skipping upgrade: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests) (2.10)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests) (2020.11.8)
Requirement already satisfied, skipping upgrade: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests) (1.26.2)
Requirement already satisfied, skipping upgrade: chardet<5,>=3.0.2 in /usr/lib/python3/dist-packages (from requests) (3.0.4)
I see a path and python difference in you screen shot.
- 2021-02-01 21_02_44-Clipboard.png (18.27 KiB) Viewed 2091 times
Looks like that requests is installed on a older python version, I don't know the solution. You can try uninstall and reinstall it, on you own risk
.
Code: Select all
sudo pip3 uninstall requests
sudo pip3 install requests
Re: Python Plugin: TUYA
Posted: Friday 05 February 2021 19:46
by lolomin
Hi,
Same problem as the one Afterburner described with Smart Life and a LIDL/Silvercrest light :
Below is the output of debug_discovery with token replaced by XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX :
[root@cygnus tools]# python3 debug_discovery.py
Getting credentials
Got credentials
{ 'access_token': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'expires_in': 864000,
'refresh_token': 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'token_type': 'bearer'}
Getting devices
Got devices
{ 'header': {'code': 'SUCCESS', 'payloadVersion': 1},
'payload': {'devices': [], 'scenes': []}}
So it seems there is no devices/data though the plugin but everything is working well through Smart Life app ?
At your disposal to do every debug you need
Thanks !
Regards,
lolo
Re: Python Plugin: TUYA
Posted: Friday 05 February 2021 20:01
by Xenomes
lolomin wrote: βFriday 05 February 2021 19:46
'payload': {'devices': [], 'scenes': []}}
As aspected there is no device info coming from the Tuya api. The only thing you can try is creating a scene and test if that control you device. Scene have only on/off control in the plug-in.
Re: Python Plugin: TUYA
Posted: Friday 05 February 2021 20:17
by lolomin
Thanks for your answer, tried :
- to switch to a tuya account after reseting gateway and device : NOK, still no devices
- to add a scene and run again debug_discovery.py : NOK, still no devices, no scenes
Does it mean these devices are unmanageable through this plugin ?
Regards,
lolo
Re: Python Plugin: TUYA
Posted: Friday 05 February 2021 20:24
by Xenomes
lolomin wrote: βFriday 05 February 2021 20:17
Does it mean these devices are unmanageable through this plugin ?
Yes indeed Tuya has to add the support to the API they provide. See link developer tuyaha library
https://github.com/PaulAnnekov/tuyaha#m ... hould-i-do
Re: Python Plugin: TUYA
Posted: Saturday 06 February 2021 20:20
by Afterburner
Xenomes,
Related tot my requests issue, I renamed the one in Pyton3, installed the latest version in Python3.8, restarted Domoticz removed and reinstalled Tuya in the HW list. No effect. So appearently I have a structural problem in my setup or Tuya API is not supporting Lidl Home stuff. Thanks for supporting. For now I will look for other methods to work with this Zigbee devices.
Re: Python Plugin: TUYA
Posted: Tuesday 16 February 2021 9:36
by EdwinK
I just noticed this in the error-log:
Code: Select all
Python Plugin System: (Tuya) handleThread: HTTPSConnectionPool(host='px1.tuyaeu.com', port=443): Max retries exceeded with url: /homeassistant/skill (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x61852cd0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) line 185
Re: Python Plugin: TUYA
Posted: Monday 01 March 2021 11:13
by HJ82
Hello,
When i use the imported scene's from the tuya app in domotics it just works fine...
The tuya scene plays like i wanted it to.
But somehow the swiches in domoticz are not updated.
When i open the tuya app the status of the switches are updated to the correct status.
Am i doing something wrong?
Thnx a lot
Re: Python Plugin: TUYA
Posted: Thursday 04 March 2021 15:02
by Laurentd40
Hello,
I've installed the Xenomes plugin for Tuya without problem and get my devices and scenes fron SmartLife app.
Currently I mainly have Curtain switches.
In the plugin they are correctly imported from 'cover' Tuya type to Domoticz Light/Switch-Blinds.
But it seems that the states is not correctly handled :
- states coming from my devices from Tuya API are 1 or 2.
- In the script, it seems that the plugin manage only 0/1 states (for all type of devices) during regular updates. So it always change to 1/On.
I've succeeded to add a local ugly patch to correct this but I would like to know :
- if I'm the only one in that case
- if I misunderstand the state management
Thank you in advance
Re: Python Plugin: TUYA
Posted: Thursday 04 March 2021 22:36
by janss028
Hi,
I using several wallplugs in the tuya app and connect them with tuyaha plugin (domoticz/plugins/tuyaha) to domoticz. This works fine.
Now I have 2 LSC moving sensors. I connect them to the tuya app and so far so good. I receive notifications if there is movements.
The problem is that I don't see these sensors in domoticz. Can someone help me?
Best Regards,
Ron
Re: Python Plugin: TUYA
Posted: Thursday 04 March 2021 22:44
by Xenomes
janss028 wrote: βThursday 04 March 2021 22:36
The problem is that I don't see these sensors in domoticz. Can someone help me?
Can you provide me with the json result of this script? debug_discovery.py
Re: Python Plugin: TUYA
Posted: Saturday 06 March 2021 8:49
by Xenomes
janss028 wrote: βThursday 04 March 2021 22:36
The problem is that I don't see these sensors in domoticz. Can someone help me?
Thanks for the PM, the json give no information a about the sensors, so there is data to work from.
The only thing you can do is send a mail to the Tuya Api department as mention on the site of the creator of the tuyaha
https://github.com/PaulAnnekov/tuyaha#m ... hould-i-do
Re: Python Plugin: TUYA
Posted: Sunday 07 March 2021 11:42
by Vomera
Got yesterday my ledstrip rgb from aliexpress
Add it in Tuya app, installed the script in domoticz.
He added the ledstrip but when i change color on rgb i get the following error, do i miss something or ?
Code: Select all
2021-03-07 11:11:19.797 Error: (Tuya) 'onCommand' failed 'TypeError':'int() argument must be a string, a bytes-like object or a number, not 'NoneType''.
2021-03-07 11:11:19.797 Error: (Tuya) ----> Line 250 in '/home/pi/domoticz/plugins/tuyaha/plugin.py', function onCommand
2021-03-07 11:11:19.797 Error: (Tuya) ----> Line 143 in '/home/pi/domoticz/plugins/tuyaha/plugin.py', function onCommand
2021-03-07 11:11:19.797 Error: (Tuya) ----> Line 79 in '/home/pi/domoticz/plugins/tuyaha/tuyaha/devices/light.py', function set_color
Code: Select all
pi@Domoticz:~/domoticz/plugins/tuyaha/tuyaha$ sudo pip3 show tuyaha
Name: tuyaha
Version: 0.0.10
Summary: A Python library that implements a Tuya API endpoint that was specially designed for Home Assistant
Home-page: https://github.com/PaulAnnekov/tuyaha
Author: Pavlo Annekov and original Tuya authors
Author-email: [email protected]
License: MIT
Location: /usr/local/lib/python3.6/dist-packages
Requires:
Code: Select all
2021-03-07 11:41:10.931 Status: Domoticz V2020.2 (build 12106) (c)2012-2020 GizMoCuz
2021-03-07 11:41:10.931 Status: Build Hash: b08d17c2d-modified, Date: 2020-05-29 09:01:13
2021-03-07 11:41:10.932 Status: Startup Path: /home/pi/domoticz/
2021-03-07 11:41:10.954 Status: PluginSystem: Started, Python version '3.6.9'.
2021-03-07 11:41:10.956 Status: WebServer(HTTP) started on address: :: with port 9090
2021-03-07 11:41:10.958 Status: WebServer(SSL) started on address: :: with port 443
2021-03-07 11:41:10.958 Status: Camera: settings (re)loaded
2021-03-07 11:41:10.959 Status: TCPServer: shared server started...
2021-03-07 11:41:10.959 Status: RxQueue: queue worker started...
2021-03-07 11:41:12.959 Status: Hardware Monitor: Started
2021-03-07 11:41:12.971 Status: RFXCOM: Worker started...
2021-03-07 11:41:12.971 Status: P1MeterTCP: attempt connect to 192.168.0.6:8899
2021-03-07 11:41:12.972 Status: XiaomiGateway (ID=13): Delaying worker startup...
2021-03-07 11:41:12.972 Status: P1MeterTCP: connected to: 192.168.0.6:8899
2021-03-07 11:41:13.944 Status: P1 Smart Meter: Meter reports as DSMR 4.2
2021-03-07 11:41:14.324 Status: P1 Smart Meter: Found gas meter on M-Bus channel 1
2021-03-07 11:41:15.939 Status: RFXCOM: Using serial port: /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A1YQEWJY-if00-port0
2021-03-07 11:41:17.972 Status: XiaomiGateway (ID=13): Selected as main Gateway
2021-03-07 11:41:17.972 Status: XiaomiGateway (ID=13): Worker started...
2021-03-07 11:41:17.972 Status: (Buienradar) Started.
2021-03-07 11:41:17.972 Status: XiaomiGateway (ID=13): Using 192.168.0.5 for local IP address.
2021-03-07 11:41:17.972 Status: (Led Keuken) Started.
2021-03-07 11:41:17.972 Status: XiaomiGateway (ID=17): Delaying worker startup...
2021-03-07 11:41:17.974 Status: XiaomiGateway: RGB Gateway Detected
2021-03-07 11:41:18.973 Status: MQTT: Connecting to 192.168.0.5:1883
2021-03-07 11:41:19.174 Status: MQTT: connected to: 192.168.0.5:1883
2021-03-07 11:41:19.374 Status: MQTT: Subscribed
Re: Python Plugin: TUYA
Posted: Sunday 07 March 2021 14:40
by Xenomes
Vomera wrote: βSunday 07 March 2021 11:42
He added the ledstrip but when i change color on rgb i get the following error, do i miss something or ?
Can you provide me with the json result of this script? debug_discovery.py is located in the tools directory
Re: Python Plugin: TUYA
Posted: Sunday 07 March 2021 21:17
by Vomera
Xenomes wrote: βSunday 07 March 2021 14:40
Vomera wrote: βSunday 07 March 2021 11:42
He added the ledstrip but when i change color on rgb i get the following error, do i miss something or ?
Can you provide me with the json result of this script? debug_discovery.py is located in the tools directory
Send you a pm
Re: Python Plugin: TUYA
Posted: Sunday 07 March 2021 22:00
by simon_rb
I bought a switch because of this plugin, so thank you
Itβs all working, its worth nothing that it didnβt like my password as it had a - in it. Once changed to just numbers and letters it worked fine.
It takes about 5 mins for changes to reflect in Domoticz if a switch is physically switched or switched using the Smart Life app. Not really an issues if thats the usual delay. Just checking my setup is correct.
Cheers!
Re: Python Plugin: TUYA
Posted: Tuesday 09 March 2021 12:54
by Vomera
Vomera wrote: βSunday 07 March 2021 21:17
Xenomes wrote: βSunday 07 March 2021 14:40
Vomera wrote: βSunday 07 March 2021 11:42
He added the ledstrip but when i change color on rgb i get the following error, do i miss something or ?
Can you provide me with the json result of this script? debug_discovery.py is located in the tools directory
Send you a pm
Sended you again a pm, could you use the information i provided ?
Re: Python Plugin: TUYA
Posted: Wednesday 17 March 2021 22:18
by manjh
I am completely new to this plugin, so it is very likely that I made a mistake somewhere.
Having said that, this is what happened.
Today I bought two LSC Smart LED lamps, they are warm/cool white lamps.
In stead of the recommended LSC SMart Home app, I picked the Tuya app because it is supported by the Tuya plugin.
First installed the app, and added the two lamps. Works OK.
Then installed the Tuya app, restarted Domoticz and added a hardware line for Tuya, providing userid/pw of the app.
After a little while, lamps show up in Domoticz. I enabled them and found the icons.
It looks OK: I can switch the lamps on/off, and can modify the dimming level.
But there is no way to change the color temperature. In the devices tab of Domoticz, the lamps show up as RGB, which is wrong.
What did I do wrong, and how can I correct?
Re: Python Plugin: TUYA
Posted: Wednesday 17 March 2021 22:26
by Vomera
manjh wrote: βWednesday 17 March 2021 22:18
I am completely new to this plugin, so it is very likely that I made a mistake somewhere.
Having said that, this is what happened.
Today I bought two LSC Smart LED lamps, they are warm/cool white lamps.
In stead of the recommended LSC SMart Home app, I picked the Tuya app because it is supported by the Tuya plugin.
First installed the app, and added the two lamps. Works OK.
Then installed the Tuya app, restarted Domoticz and added a hardware line for Tuya, providing userid/pw of the app.
After a little while, lamps show up in Domoticz. I enabled them and found the icons.
It looks OK: I can switch the lamps on/off, and can modify the dimming level.
But there is no way to change the color temperature. In the devices tab of Domoticz, the lamps show up as RGB, which is wrong.
What did I do wrong, and how can I correct?
I guess there are some problems with the plugin because i have the same kind of problem, the writer of the scrip is watching to it
Re: Python Plugin: TUYA
Posted: Wednesday 17 March 2021 22:37
by manjh
Vomera wrote: βWednesday 17 March 2021 22:26
manjh wrote: βWednesday 17 March 2021 22:18
I am completely new to this plugin, so it is very likely that I made a mistake somewhere.
Having said that, this is what happened.
Today I bought two LSC Smart LED lamps, they are warm/cool white lamps.
In stead of the recommended LSC SMart Home app, I picked the Tuya app because it is supported by the Tuya plugin.
First installed the app, and added the two lamps. Works OK.
Then installed the Tuya app, restarted Domoticz and added a hardware line for Tuya, providing userid/pw of the app.
After a little while, lamps show up in Domoticz. I enabled them and found the icons.
It looks OK: I can switch the lamps on/off, and can modify the dimming level.
But there is no way to change the color temperature. In the devices tab of Domoticz, the lamps show up as RGB, which is wrong.
What did I do wrong, and how can I correct?
I guess there are some problems with the plugin because i have the same kind of problem, the writer of the scrip is watching to it
Ah, good. Let me know if I can help.
Would be great if this can be solved, the lamps are cheap (β¬3,95 at the local Action store!), and I will buy more once everything is working OK!