fhempy: Tuya Cloud

Begonnen von dominik, 30 Juli 2021, 21:36:48

Vorheriges Thema - Nächstes Thema

MiKn

ZitatHast du um 22:59:18-20 Button 1 und um 22:59:23-25 Button 2 gedrückt?
Ja und ja.

ZitatWenn ja, wurde das Reading switch1_value um 22:59:25 auf single_click gesetzt?
Ja, es wird immer auf single_click gesetzt, beim drücken von Button 1 und Button2.
Und switch_mode2 wird immer mit click gesetzt.

dominik

Was hat das Device selbst für Commands und was passiert wenn du diese ausführst?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

MiKn

gar keine set Commands.

dominik

Bitte PN lesen die ich dir geschickt habe, ohne es selbst zu testen, tappe ich im Dunkeln.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

MiKn

ups, jetzt erst gesehen. Die Daten habe ich geschickt.

bewa58

Moinsen,

nach update gerade eben und Neustart

"fhempy server offline"

????

dominik

Zitat von: bewa58 am 05 März 2022, 09:09:30
Moinsen,

nach update gerade eben und Neustart

"fhempy server offline"

????
Ja, sorry, da ist bei mir was schief gegangen. Bitte noch ein update in FHEM machen, dann läuft es wieder.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

skycrack

Hallo Dominik,
fhempy lief Problemlos bis ich heute ein Fhemupdate gemacht habe.

Ich bin jetzt auf der Modulversion 0.1.261
in allen Geräten steht jetzt:
Failed to load module tuya_cloud: Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/fhempy/lib/fhem_pythonbinding.py", line 269, in _onMessage functools.partial(importlib.import_module, pymodule) File "/usr/local/lib/python3.7/dist-packages/fhempy/lib/utils.py", line 34, in run_blocking return await asyncio.get_event_loop().run_in_executor(pool, function) File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "/usr/local/lib/python3.7/dist-packages/fhempy/lib/tuya_cloud/tuya_cloud.py", line 7, in from fhempy.lib.tuya_cloud.tuya_cloud_device import tuya_cloud_device File "/usr/local/lib/python3.7/dist-packages/fhempy/lib/tuya_cloud/tuya_cloud_device.py", line 5, in from tuya_iot.device import TuyaDevice File "/usr/local/lib/python3.7/dist-packages/tuya_iot/__init__.py", line 2, in from .device import TuyaDevice, TuyaDeviceListener, TuyaDeviceManager File "/usr/local/lib/python3.7/dist-packages/tuya_iot/device.py", line 7, in from typing import Any, Literal, Optional ImportError: cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py)

Wenn ich fhempy manuell auf der Console starte versucht es immer ein Update von  async-upnp-client welches fehl schägt.
2022-03-05 15:34:12,531 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy...
2022-03-05 15:34:12,544 - INFO     - fhempy.lib.pkg_installer: Attempting install of async-upnp-client==0.20.0
2022-03-05 15:34:20,785 - ERROR    - fhempy.lib.pkg_installer: Unable to install package async-upnp-client==0.20.0: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-knot7a62/aiohttp/
2022-03-05 15:34:20,788 - INFO     - fhempy.lib.pkg_installer: Attempting install of async-upnp-client==0.20.0
2022-03-05 15:34:28,934 - ERROR    - fhempy.lib.pkg_installer: Unable to install package async-upnp-client==0.20.0: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-n_6g1vd8/aiohttp/
2022-03-05 15:34:28,936 - INFO     - fhempy.lib.pkg_installer: Attempting install of async-upnp-client==0.20.0
2022-03-05 15:34:36,941 - ERROR    - fhempy.lib.pkg_installer: Unable to install package async-upnp-client==0.20.0: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-vzksf3qv/aiohttp/
2022-03-05 15:34:36,943 - INFO     - fhempy.lib.fhem_pythonbinding: Advertise fhempy on local network
2022-03-05 15:34:37,327 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2022-03-05 15:34:37,412 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2022-03-05 15:34:42,386 - INFO     - websockets.server: connection open
2022-03-05 15:34:42,396 - INFO     - fhempy.lib.fhem_pythonbinding: Incoming FHEM connection: 127.0.0.1


Alles läuft auf Ubuntu 18.04.6 LTS auf einen Ordroid System.
Habe schon einiges probiert, ohne Erfolg. Würde mich über einen Hinweis freuen.
Gruß Rene


dominik

Das Tuya Cloud Modul erfordert nun leider Python 3.8 oder höher. Leider hat Tuya noch keinen Fix dafür released, damit es auch mit Python 3.7 wieder funktioniert.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

skycrack

Danke für die schnelle Info sowie dein Einsatz bei diesem Modul.

Vor dem Update lief es in dem alten Modulstand. Komme ich da wieder hin oder wäre der Weg nach vorne mit einem "sudo apt install python3.8" der bessere Weg.
Gruß

bewa58

#550
Zitat
Ja, sorry, da ist bei mir was schief gegangen. Bitte noch ein update in FHEM machen, dann läuft es wieder.

gerade update gemacht, server ist connected

aber fhempy_server15.....   fehlt
und es wird kein Log-File erzeugt (letzter Eintrag von heute morgen vor dem ersten update)


Nachtrag:

Nachdem ich diesen Text erstellt habe:
local_pybindung update angestossen
und siehe da

alle devices ohne fehlermeldung.
Das hatte ich bereits mehrfach so festgestellt, aber leider funktioniert das sehr selten.






Folgende Fehlermeldungen bei mehreren Devices:

Ring Doorbell
Zitat
Failed to load module ring: Traceback (most recent call last): File "/home/pi/.local/lib/python3.9/site-packages/fhempy/lib/fhem_pythonbinding.py", line 268, in _onMessage module_object = await utils.run_blocking( File "/home/pi/.local/lib/python3.9/site-packages/fhempy/lib/utils.py", line 34, in run_blocking return await asyncio.get_event_loop().run_in_executor(pool, function) File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 790, in exec_module File "", line 228, in _call_with_frames_removed File "/home/pi/.local/lib/python3.9/site-packages/fhempy/lib/ring/ring.py", line 9, in from ring_doorbell import Auth, Ring File "/home/pi/.local/lib/python3.9/site-packages/ring_doorbell/__init__.py", line 15, in from .auth import Auth # noqa File "/home/pi/.local/lib/python3.9/site-packages/ring_doorbell/auth.py", line 5, in from requests_oauthlib import OAuth2Session File "/home/pi/.local/lib/python3.9/site-packages/requests_oauthlib/__init__.py", line 3, in from .oauth1_auth import OAuth1 File "/home/pi/.local/lib/python3.9/site-packages/requests_oauthlib/oauth1_auth.py", line 9, in from requests.compat import is_py3 File "", line 1007, in _find_and_load File "", line 989, in _find_and_load_unlocked KeyError: 'requests'

TuyaCloud
Zitat
   
Failed to load module tuya_cloud: Traceback (most recent call last): File "/home/pi/.local/lib/python3.9/site-packages/fhempy/lib/fhem_pythonbinding.py", line 268, in _onMessage module_object = await utils.run_blocking( File "/home/pi/.local/lib/python3.9/site-packages/fhempy/lib/utils.py", line 34, in run_blocking return await asyncio.get_event_loop().run_in_executor(pool, function) File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 790, in exec_module File "", line 228, in _call_with_frames_removed File "/home/pi/.local/lib/python3.9/site-packages/fhempy/lib/tuya_cloud/tuya_cloud.py", line 7, in from fhempy.lib.tuya_cloud.tuya_cloud_device import tuya_cloud_device File "/home/pi/.local/lib/python3.9/site-packages/fhempy/lib/tuya_cloud/tuya_cloud_device.py", line 5, in from tuya_iot.device import TuyaDevice File "/home/pi/.local/lib/python3.9/site-packages/tuya_iot/__init__.py", line 1, in from .asset import TuyaAssetManager File "/home/pi/.local/lib/python3.9/site-packages/tuya_iot/asset.py", line 6, in from .openapi import TuyaOpenAPI File "/home/pi/.local/lib/python3.9/site-packages/tuya_iot/openapi.py", line 10, in import requests File "/usr/lib/python3/dist-packages/requests/__init__.py", line 118, in from . import utils File "/usr/lib/python3/dist-packages/requests/utils.py", line 27, in from ._internal_utils import to_native_string File "/usr/lib/python3/dist-packages/requests/_internal_utils.py", line 11, in from .compat import is_py2, builtin_str, str ImportError: cannot import name 'builtin_str' from partially initialized module 'requests.compat' (most likely due to a circular import) (/usr/lib/python3/dist-packages/requests/compat.py)

hatte mich seit Weihnachten nicht mehr um dein Modul gekümmert wg. Zeitmangel und hatte
abgewartet.

Was ich vor 2 Tagen noch festgestellt hatte:

es werden nach update bzw auch nur nach Neustart
bereits vorhandene Devices wieder angelegt.
Zitat
2022-03-04 01:30:23,913 - INFO     - tuya_cloud: create: Fluter_A1_41518006f4cfa25b52db PythonModule tuya_cloud tuya_cloud 41518006f4cfa25b52db

hier Bildschirmcopy aus Tuya Iot Platform
Zitat
Fluter_A1   41518006f4cfa25b52db   Smart light   vorname.name@gmail.com   Online   2021-11-26 19:23:39   Debug Device


nach mehreren Neustarts funktioniert es dann, aber auch nicht immer.
Erst wenn ich alle devices aus fhem lösche läuft es dann
aber nur bis zum nächsten neustart.

???

Nachtrag:
gerade nochmal update local binding gemacht
alle devices ohne fehlermeldung

dominik

Zitat von: skycrack am 05 März 2022, 16:21:02
Danke für die schnelle Info sowie dein Einsatz bei diesem Modul.

Vor dem Update lief es in dem alten Modulstand. Komme ich da wieder hin oder wäre der Weg nach vorne mit einem "sudo apt install python3.8" der bessere Weg.
Gruß
Ich empfehle eher gleich auf bullseye zu gehen, dort ist Python 3.9 Standard. Falls Ubuntu Python3.8 im Standard auch anbietet, kannst du es mal versuchen.

Zurück auf die alte Version würde ich nicht empfehlen. Tuya hat im Update ein paar Sachen geändert, könnte daher sein, dass es mit dem alten Modul irgendwann zu Problemen kommt.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

dominik

@bewa58, tritt das Problem bei dir immer wieder bei Neustarts auf? Wenn ja, poste mir bitte nochmals den Fehler wenn es wieder auftritt. Laut Tuya Cloud Log das du gepostet hast, dürfte da ein "circular import" vorliegen.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

dominik

Noch dazu...
Zitat2022-03-04 01:30:23,913 - INFO     - tuya_cloud: create: Fluter_A1_41518006f4cfa25b52db PythonModule tuya_cloud tuya_cloud 41518006f4cfa25b52db

Devices werden nur neu angelegt, wenn diese nicht existieren. Bedeutet natürlich auch, dass wenn du ein Device löscht, es nach dem Neustart wieder angelegt wird.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

bewa58

#554
Zitat
Devices werden nur neu angelegt, wenn diese nicht existieren. Bedeutet natürlich auch, dass wenn du ein Device löscht, es nach dem Neustart wieder angelegt wird.

Nein, die diese Meldung kommt auch wenn bereits angelegt !!!
um es zum Laufen zu bringen lösche alle und dann funktioniert es 1x
dann wieder das gleiche Spiel !

Ich dem englischen nicht so mächtig:  was bedeutet "circular import"

ja, es kommt immer wieder vor, habe ich doch beschrieben.

warum habe ich kein logfile mehr ?
warum ist der fhempy_15.... nicht mehr in FHEM vorhanden.

Alleas seit dem crash heute morgen