Closed Fnasy closed 1 year ago
Update the script, can you test if you error is gone?
Version 1.5.4
Hello, Yes, there are no more errors. Unfortunately, I noticed the following:
1: the measured temperatures are no longer updated in Domoticz. 2: the script works in the direction Domoticz towards APP but no longer in the other direction. 3: small detail: the limits are not respected which can desynchronize Domoticz and the APP. Example if the thermostat is set below the lower limit (5°) the update is not done in the APP. (not really important, but good to know).
Maybe it could be a good idea to test a return to version 1.4.8 which worked flawlessly and check if it was my API that was causing the problem). is this possible? I let you judge.
Regards Thierry
The only big change 1.4.8 to 1.5.4 is that the faulty TinyTuya 1.11.0 => 1.11.2 execution from the script is removed.
Can you check the version of your installed liberty TinyTuya?
sudo pip3 show tinytuya | grep Version
The current plugin is tested with version1.12.4 if you are on this version can you send me the dump,json you can create it by edit and running the debug.discovery.py from the tools directory. you can email it to xenomes@outlook.com
Ps. min/max is included in the next version.
I have version : Version: 1.12.5
OK, i did not test the plugin with this version. Can you send me the dump,json then i can do a better check what is going wrong.
Here it is. DumpJson1.pdf
Hi tested your json of device ending on 2af3bba all the 5 created devices react on change from the json. So what I can see is that is is communication bidirectional. For the min/max you can checkout the Develop 1.5.5
After complete reinstallation I notice that the thermostat values are only updated once in the direction APP --> Domoticz. After if I reset the plugin by changing the debug mode the values are updated but only once. It seems that apart from the reset the data is not updated in Domoticz. This explains why I no longer receive the measured temperatures.
The change in the app can take up to a minute to be changed in Domoticz. because it use a pull system, so one time a minute the status is pulled from the tuya server. A send command is a push that is direct executed.
Hi, I tried for some minutes, hours and even one night. :-) It still doesn't work APP--> Domoticz. I can only recuperate the data when I am starting the plugin by resetting it changing the debug mode. Attached, you will find a trace of the Python debug mode. Hope it helps.
Thierry
Maybe a confusion between "set_temp" and "temp_set"
Thermostats: searchCodeActualFunction unable to find set_temp in
I tried for some minutes, hours and even one night. :-)
Then i had been updated 😆
I did some tests, but is can replicated it. See my test in the gif. See you a other behavior?
Then i had been updated 😆
Sorry I am at GMT-7..
Yes, in my case, Tuya does not update Domoticz. (it worked before). But if I launch the plugin again (by changing the debug mode) the update is done only once.
It's annoying because I rely on the temperatures to adjust the thermostats according to the power generated by the photovoltaic panels.
I have upload the current code to the Develop, can you do a pull and change to the Develop?
cd ~/domoticz/plugins/Domoticz-TinyTUYA-Plugin
git pull
git checkout Develop
Ok. Done
Don't forget to restart domoticz, How are the controls reacting now?
This is new. I’ll check on Tuya.Iot
Thermostats: Cloud _gettoken() failed: 'sign invalid'
-- Cet e-mail a été vérifié par le logiciel antivirus d'AVG. www.avg.com
Ok. Token fixed.
Debug :
2023-04-27 12:46:48.398 Thermostats: onStop called
2023-04-27 12:46:48.698 Thermostats: Worker thread started.
2023-04-27 12:46:48.397 Status: Thermostats: Stop directive received.
2023-04-27 12:46:48.657 Status: Thermostats: Exiting work loop.
2023-04-27 12:46:48.698 Status: Thermostats: Stopping threads.
2023-04-27 12:46:48.698 Status: Thermostats: Stopped.
2023-04-27 12:46:48.698 Status: Thermostats: Entering work loop.
2023-04-27 12:46:48.698 Status: Thermostats: Started.
2023-04-27 12:46:48.398 Error: Thermostats: Call to function 'onStop' failed, exception details:
2023-04-27 12:46:48.405 Error: Thermostats: Traceback (most recent call last):
2023-04-27 12:46:48.405 Error: Thermostats: File "/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 381, in onStop
2023-04-27 12:46:48.405 Error: Thermostats: _plugin.onStop()
2023-04-27 12:46:48.405 Error: Thermostats: File "/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 100, in onStop
2023-04-27 12:46:48.405 Error: Thermostats: for dev in devs:
2023-04-27 12:46:48.405 Error: Thermostats: NameError: name 'devs' is not defined
2023-04-27 12:46:49.862 Thermostats: TinyTUYA plugin started
2023-04-27 12:46:49.862 Thermostats: 'TinyTuyaVersion':'1.12.5'
2023-04-27 12:46:49.862 Thermostats: Debug logging mask set to: CONNECTION
2023-04-27 12:46:49.851 Status: Thermostats: Initialized version 1.5.5, author 'Xenomes'
2023-04-27 12:46:49.870 Error: Thermostats: handleThread: Invalid return character or leading space in header: secret
2023-04-27 12:47:01.072 Error: Thermostats: Call to function 'onCommand' failed, exception details:
2023-04-27 12:47:01.076 Error: Thermostats: Traceback (most recent call last):
2023-04-27 12:47:01.076 Error: Thermostats: File "/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 393, in onCommand
2023-04-27 12:47:01.076 Error: Thermostats: _plugin.onCommand(DeviceID, Unit, Command, Level, Color)
2023-04-27 12:47:01.076 Error: Thermostats: File "/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 122, in onCommand
2023-04-27 12:47:01.076 Error: Thermostats: if Error is not None:
2023-04-27 12:47:01.076 Error: Thermostats: NameError: name 'Error' is not defined
-- Cet e-mail a été vérifié par le logiciel antivirus d'AVG. www.avg.com
The onStop i a known error trying to find a work around for that.
But this one is new for me 'Error: Thermostats: handleThread: Invalid return character or leading space in header: secret'
I entered the secret code again and this error disappeared. But the behavior of APP --> Domoticz remains the same. No update except on initialization.
Can you change the 'Search DeviceID' to an other?
I did it but unfortunately still the same problem.
So strange, When the script start is use the same part of the script to do the first update and then is is trigger every 60 sec.
I found the problem! With the cleanup i remove a line for the live data version but for test data it still works. Can you checkout the latest version.
Yes it works… !!!!! You are the best.
Ok great! With all the testing i also saw that tuya has changed some data format.
Hi, I performed the latest update and I get the following errors. Can you tell me how to fix it? Could it be from my script which influences the thermostat via an API (in order to regulate the thermostat according to the energy produced)? Any advice is welcome as I'm stuck. Thank you in advance for your help.
regards. Thierry
Error: Thermostats: handleThread: 'has_more' Error: Thermostats: Call to function 'onCommand' failed, exception details: Error: Thermostats: Traceback (most recent call last): Error: Thermostats: File "/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 376, in onCommand Error: Thermostats: _plugin.onCommand(DeviceID, Unit, Command, Level, Color) Error: Thermostats: File "/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/plugin.py", line 133, in onCommand Error: Thermostats: function = properties[DeviceID]['functions'] Error: Thermostats: KeyError: '40041254a4cf12af3bba'