Xenomes / Domoticz-TinyTUYA-Plugin

A bridge between Tinytuya and Domoticz
12 stars 7 forks source link

No Devices created in Domoticz for Adlar Aurora II heat pump #131

Open nlfva1 opened 2 weeks ago

nlfva1 commented 2 weeks ago

I have Domoticz 2024.7 and Python 3.8.1 and installed the TinyTUYA plugin 2.0.4. I did all the steps in Tuya developer platform and can receive the data in my raspberry using "python -m tinytuya scan" see below, but it does not create the devices in Domoticz when activating the plugin.

image

In the domoticz log I get two messages:

Let me know if you need more info.

Xenomes commented 2 weeks ago

Hi, that is the same issue as #126. I don’t have a clue yet what is causing the error. What OS are you running on the RPI?

nlfva1 commented 1 week ago

I'm running Raspbian GNU/Linux 10 (buster) Linux 5.10.103-v7l+

I've added dump.json as I guess that this wil be your next question😉 dump.json

nlfva1 commented 1 week ago

I added the path of the tinytuya module to your script and found that it's actually still pointing to version 3.7, so looks like it's related to the python version. Although I have installed python 3.8.1.

Screenshot 2024-10-26 142544

Now trying to figure out how to fix this. so far not successful. Will try to update to python 3.8.5 instead.

Xenomes commented 1 week ago

Normally you can set the default python by running: update-alternatives --config python

nlfva1 commented 1 week ago

Unfortunately the command did not help.

Domoticz is still loading 3.7.3 and not libpython3.8.5. Looks like something with the pythonpath in Domoticz. I'll keep looking, but open for suggestions..

Error: Tuya cloud: (tinytuya) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-TinyTUYA-Plugin/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/

Even tried installing 3.9.7, but did not help either. Still pointing to 3.7.

Xenomes commented 4 days ago

Did you try running it with sudo? Domoticz runs under the su (superuser) account.

nlfva1 commented 3 days ago

Yes. Here is the result: sudo update-alternatives --config python There is only one alternative in link group python (providing /usr/bin/python): /usr/local/bin/python3.8 Nothing to configure.

Still showing python version 3.7.3 in Domoticz. Also tried it with an empty new domoticz database, but same result. I have no clue where it getting the 3.7.3 from.

Xenomes commented 2 days ago

That is strange, python3 -V give 3.8?

nlfva1 commented 2 days ago

Yes. I will try a deinstall and reinstall of domoticz to see if that works.
Screenshot_20241102_100022_Putty SSH

Xenomes commented 2 days ago

And sudo python3 -V How did you insta?ll python 3.8?

nlfva1 commented 2 days ago

Same result. Let me try the reinstall of domoticz first. Thanks so far.

Xenomes commented 1 day ago

Was the reinstall the fix?

nlfva1 commented 21 hours ago

No the re-install with a fresh domoticz.db still gave the same 3.7.3 versionin the domoticz log. Although sudo python --version and sudo python3 -- version both give version 3.8.1. Even tried a PYTHONPATH in domoticz.sh and point to 3.8.1, but is not picking up. Copied my backed up domoticz.db back to this new installation and after start up still pointing to 3.7.3.

image

I'm out of option other then a complete reinstall of raspbian and domoticz, but is not something I'm looking forward to. Will first by a new 32gb memory card, so that it's easier to go back if it isn't working. To be continued, but open for other idea's. Thanks so far.