Page 8 of 26

Re: Python Plugin: TUYA

Posted: Thursday 18 March 2021 22:29
by manjh
Xenomes wrote: Thursday 18 March 2021 22:25
manjh wrote: Thursday 18 March 2021 22:22 OK, got it. SHould I post the output here, or do you want it some other way?
If you give the device output that is enough, you can mask any info you want.
Done.
Time for a compliment: your support and (very fast) response is highly appreciated!

Re: Python Plugin: TUYA

Posted: Thursday 18 March 2021 22:34
by Xenomes
manjh wrote: Thursday 18 March 2021 22:29 Done.
Time for a compliment: your support and (very fast) response is highly appreciated!
Do my best, Tuya is not the greatest in supporting hardware. But these devices can work under the plug-in. You can put the json there in the forum.
I will pick it up tomorrow, I am going to bed.

Re: Python Plugin: TUYA

Posted: Thursday 18 March 2021 22:36
by manjh
Output is in the post a little higher in this forum.
Good night... :P

Re: Python Plugin: TUYA

Posted: Friday 19 March 2021 7:51
by Xenomes
manjh wrote: Thursday 18 March 2021 22:36 Output is in the post a little higher in this forum.
Found it 👍🏻 i see the problem i need to think how to solve the issue.

Re: Python Plugin: TUYA

Posted: Friday 19 March 2021 8:12
by Vomera
I hope it solves also my issue 😆

Re: Python Plugin: TUYA

Posted: Friday 19 March 2021 8:24
by Xenomes
Vomera wrote: Friday 19 March 2021 8:12 I hope it solves also my issue 😆
After the communication in the PM. What kind of issue you have, same as manjh?

Re: Python Plugin: TUYA

Posted: Friday 19 March 2021 10:35
by Vomera
Didnt you get my last pm's ?
I send you a bunch of loggings and screenhots :D

Re: Python Plugin: TUYA

Posted: Friday 19 March 2021 18:40
by Xenomes
Vomera wrote: Friday 19 March 2021 10:35 Didnt you get my last pm's ?
I send you a bunch of loggings and screenhots :D
Nope, the last one is that you going to try my modified plug-in.

Re: Python Plugin: TUYA

Posted: Friday 19 March 2021 19:16
by manjh
Xenomes wrote: Friday 19 March 2021 7:51
manjh wrote: Thursday 18 March 2021 22:36 Output is in the post a little higher in this forum.
Found it 👍🏻 i see the problem i need to think how to solve the issue.
OK, good. Let me know if there is anything I can do, for instance test a modified plugin.

Re: Python Plugin: TUYA

Posted: Friday 19 March 2021 19:21
by Vomera
Xenomes wrote: Friday 19 March 2021 18:40
Vomera wrote: Friday 19 March 2021 10:35 Didnt you get my last pm's ?
I send you a bunch of loggings and screenhots :D
Nope, the last one is that you going to try my modified plug-in.
ow haha :P nope, i can only trial and error, but i cant write the language haha

Re: Python Plugin: TUYA

Posted: Sunday 21 March 2021 21:22
by Xenomes
simon_rb wrote: Sunday 07 March 2021 22:00 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.
Hi simon_rb,

I updated the script, it updates every minute now.

Re: Python Plugin: TUYA

Posted: Sunday 21 March 2021 21:55
by Xenomes
Xenomes wrote: Friday 19 March 2021 7:51
manjh wrote: Thursday 18 March 2021 22:36 Output is in the post a little higher in this forum.
Found it 👍🏻 i see the problem i need to think how to solve the issue.
The payload is exactly the same, I could do if the light is on white mode the only brightness and temperature and if it is colour then colour, brightness and temperature. Then with a instruction in the readme for RGBWW light before detection set the light on a colour.

Re: Python Plugin: TUYA

Posted: Monday 22 March 2021 2:31
by simon_rb
Xenomes wrote: Sunday 21 March 2021 21:22 Hi simon_rb,

I updated the script, it updates every minute now.
Hey there Xenomes,

I just updated and its a so much better! Thank you :D

Re: Python Plugin: TUYA

Posted: Monday 22 March 2021 19:28
by Vomera
Vomera wrote: Friday 19 March 2021 19:21
Xenomes wrote: Friday 19 March 2021 18:40
Vomera wrote: Friday 19 March 2021 10:35 Didnt you get my last pm's ?
I send you a bunch of loggings and screenhots :D
Nope, the last one is that you going to try my modified plug-in.
ow haha :P nope, i can only trial and error, but i cant write the language haha
Tried to flash the unit with tasmota, but its says i have the newest firmware on it, and cant flash it.
So i cant use it with domoticz.. :lol:

I bought this one:

https://nl.aliexpress.com/item/10050015 ... 4c4dh1P9nf

Image

Re: Python Plugin: TUYA

Posted: Monday 22 March 2021 22:08
by Xenomes
Vomera wrote: Monday 22 March 2021 19:28 Tried to flash the unit with tasmota, but its says i have the newest firmware on it, and cant flash it.
Which tool did you use to try flashing it with Tasmota?

Re: Python Plugin: TUYA

Posted: Tuesday 23 March 2021 8:08
by Vomera
The tool on
https://www.twoenter.nl/blog/domotica/ ... a-convert/
Is it your blog? Because they mention also your plugin tool

Re: Python Plugin: TUYA

Posted: Friday 26 March 2021 16:57
by Irate
I have installed the plugin by Xenomes but... some problems with Python3.8
I have a NAS, python 3.8
In my Log, i receive this message
2021-03-26 16:34:46.818 Error: (tuya) failed to load 'plugin.py', Python Path used was '/usr/local/domoticz/var/plugins/Domoticz-TUYA-Plugin-master/:
/var/packages/py3k/target/usr/local/lib/python38.zip:
/var/packages/py3k/target/usr/local/lib/python3.8:
/var/packages/py3k/target/usr/local/lib/python3.8/lib-dynload:
/var/packages/py3k/target/usr/local/lib/python3.8/site-packages'.
But on the NAS, the links are
//volume1/@appstore/domoticz/var/plugins/Domoticz-TUYA-Plugin-master
/volume1/@appstore/py3k/usr/local/lib/python3.8
/volume1/@appstore/py3k/usr/local/lib/python3.8/lib-dynload
/volume1/@appstore/py3k/usr/local/lib/python3.8/site-packages
How to restore the right paths ?
What is my mistake ?

Re: Python Plugin: TUYA

Posted: Friday 26 March 2021 20:59
by Xenomes
Sorry I don't have a NAS. running and testing on RPI.

Re: Python Plugin: TUYA

Posted: Saturday 27 March 2021 10:39
by tontze
Hm, im trying to use your plugin, but cant seem to get it working .. Here is output of the debug_discovery.py

Code: Select all

Getting credentials
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/models.py", line 382, in prepare_url
    scheme, auth, host, port, path, query, fragment = parse_url(url)
  File "/usr/lib/python3/dist-packages/urllib3/util/url.py", line 392, in parse_url
    return six.raise_from(LocationParseError(source_url), None)
  File "<string>", line 3, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: https://px1.tuyaeu.com/homeassistant/auth.do

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/tontze/domoticz/plugins/Domoticz-TUYA-Plugin/tools/./debug_discovery.py", line 20, in <module>
    auth_response = requests.post(
  File "/usr/lib/python3/dist-packages/requests/api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 528, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 456, in prepare_request
    p.prepare(
  File "/usr/lib/python3/dist-packages/requests/models.py", line 316, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3/dist-packages/requests/models.py", line 384, in prepare_url
    raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: https://px1.tuyaeu.com/homeassistant/auth.do
Domoticz log :

Code: Select all

  2021-03-27 11:44:41.191 Status: Python Plugin System: (Tuya) Started.
2021-03-27 11:44:41.191 Status: Python Plugin System: (Tuya) Entering work loop.
2021-03-27 11:44:41.778 Status: Python Plugin System: (Tuya) Initialized version 1.0.5, author 'Wagner Oliveira'
2021-03-27 11:44:41.789 Error: Python Plugin System: (Tuya) handleThread: Failed to parse: https://px1.tuyaeu.com/homeassistant/auth.do line 196
2021-03-27 11:44:51.093 Python Plugin System: (Tuya) onHeartbeat called time=1616838291.092976
2021-03-27 11:44:51.094 Python Plugin System: (Tuya) in handlethread
2021-03-27 11:44:51.096 Error: Python Plugin System: (Tuya) handleThread: Failed to parse: https://px1.tuyaeu.com/homeassistant/access.do?grant_type=refresh_token&refresh_token= line 199  

Re: Python Plugin: TUYA

Posted: Saturday 27 March 2021 11:58
by Xenomes
tontze wrote: Saturday 27 March 2021 10:39 Hm, im trying to use your plugin, but cant seem to get it working .. Here is output.
It is missing the requests.