fhempy: Tuya Cloud

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

Vorheriges Thema - Nächstes Thema

ChrisA4

kann mir jemand helfen mit dem update auf python 3.9 am raspi
hab das update dürchgeführt jedoch bleict fhempy nach neustart immer auf 3.7
Ich find den fehler nicht

dominik

Du bist jetzt auf bullseye? Hast du ein "sudo apt full-upgrade" gemacht?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

ChrisA4

raspian buster 10
full upgrade wurde gemacht
python 3.9.9 wird angezeigt
fhempy gibt:
   

Failed to load module tuya_cloud: Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 301, in _onMessage
    functools.partial(importlib.import_module, pymodule)
  File "/home/pi/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 33, 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 "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/pi/.local/lib/python3.7/site-packages/fhempy/lib/tuya_cloud/tuya_cloud.py", line 5, in <module>
    from fhempy.lib.tuya_cloud.tuya_cloud_device import tuya_cloud_device
  File "/home/pi/.local/lib/python3.7/site-packages/fhempy/lib/tuya_cloud/tuya_cloud_device.py", line 5, in <module>
    from tuya_iot.device import TuyaDevice
  File "/home/pi/.local/lib/python3.7/site-packages/tuya_iot/__init__.py", line 2, in <module>
    from .device import TuyaDevice, TuyaDeviceListener, TuyaDeviceManager
  File "/home/pi/.local/lib/python3.7/site-packages/tuya_iot/device.py", line 7, in <module>
    from typing import Any, Literal, Optional
ImportError: cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py)



Weiss nicht weiter

dominik

Mach mal
sudo -u fhem bash
pip3 uninstall fhempy
pip3 install fhempy


Und danach fhempy in FHEM neu starten.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

ChrisA4

#379
es kommt bei der deinstallation
WARNING: Skipping fhempy as it is not installed.

??
Habs Fhempy Lief noch

ChrisA4

so bei der neuinstallation kommt

fhem@fhem:/home/pi$ pip3 install fhempy
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting fhempy
  Using cached https://files.pythonhosted.org/packages/b2/af/84cc06adf521e54deb5079dedec932b9c4143cc07ccc575c7d7ef3daf02e/fhempy-0.1.178-py3-none-any.whl
Requirement already satisfied: markdown==3.3.4 in /opt/fhem/.local/lib/python3.7/site-packages (from fhempy) (3.3.4)
Requirement already satisfied: dbus-python==1.2.18 in /opt/fhem/.local/lib/python3.7/site-packages (from fhempy) (1.2.18)
Requirement already satisfied: cryptography==3.3.2 in /opt/fhem/.local/lib/python3.7/site-packages (from fhempy) (3.3.2)
Requirement already satisfied: zeroconf==0.36.12 in /opt/fhem/.local/lib/python3.7/site-packages (from fhempy) (0.36.12)
Requirement already satisfied: sentry-sdk==1.4.3 in /opt/fhem/.local/lib/python3.7/site-packages (from fhempy) (1.4.3)
Requirement already satisfied: aiohttp[speedups]==3.7.4.post0 in /opt/fhem/.local/lib/python3.7/site-packages (from fhempy) (3.7.4.post0)
Requirement already satisfied: websockets==10.0 in /opt/fhem/.local/lib/python3.7/site-packages (from fhempy) (10.0)
Requirement already satisfied: importlib-metadata==4.8.1 in /opt/fhem/.local/lib/python3.7/site-packages (from fhempy) (4.8.1)
Requirement already satisfied: cffi>=1.12 in /opt/fhem/.local/lib/python3.7/site-packages (from cryptography==3.3.2->fhempy) (1.15.0)
Requirement already satisfied: six>=1.4.1 in /usr/lib/python3/dist-packages (from cryptography==3.3.2->fhempy) (1.12.0)
Requirement already satisfied: ifaddr>=0.1.7 in /opt/fhem/.local/lib/python3.7/site-packages (from zeroconf==0.36.12->fhempy) (0.1.7)
Requirement already satisfied: urllib3>=1.10.0 in /usr/lib/python3/dist-packages (from sentry-sdk==1.4.3->fhempy) (1.24.1)
Requirement already satisfied: certifi in /usr/lib/python3/dist-packages (from sentry-sdk==1.4.3->fhempy) (2018.8.24)
Requirement already satisfied: attrs>=17.3.0 in /opt/fhem/.local/lib/python3.7/site-packages (from aiohttp[speedups]==3.7.4.post0->fhempy) (21.2.0)
Requirement already satisfied: async-timeout<4.0,>=3.0 in /opt/fhem/.local/lib/python3.7/site-packages (from aiohttp[speedups]==3.7.4.post0->fhempy) (3.0.1)
Requirement already satisfied: multidict<7.0,>=4.5 in /opt/fhem/.local/lib/python3.7/site-packages (from aiohttp[speedups]==3.7.4.post0->fhempy) (5.2.0)
Requirement already satisfied: typing-extensions>=3.6.5 in /opt/fhem/.local/lib/python3.7/site-packages (from aiohttp[speedups]==3.7.4.post0->fhempy) (4.0.0)
Requirement already satisfied: yarl<2.0,>=1.0 in /opt/fhem/.local/lib/python3.7/site-packages (from aiohttp[speedups]==3.7.4.post0->fhempy) (1.7.2)
Requirement already satisfied: chardet<5.0,>=2.0 in /usr/lib/python3/dist-packages (from aiohttp[speedups]==3.7.4.post0->fhempy) (3.0.4)
Requirement already satisfied: cchardet; extra == "speedups" in /opt/fhem/.local/lib/python3.7/site-packages (from aiohttp[speedups]==3.7.4.post0->fhempy) (2.1.7)
Requirement already satisfied: aiodns; extra == "speedups" in /opt/fhem/.local/lib/python3.7/site-packages (from aiohttp[speedups]==3.7.4.post0->fhempy) (3.0.0)
Requirement already satisfied: brotlipy; extra == "speedups" in /opt/fhem/.local/lib/python3.7/site-packages (from aiohttp[speedups]==3.7.4.post0->fhempy) (0.7.0)
Requirement already satisfied: zipp>=0.5 in /opt/fhem/.local/lib/python3.7/site-packages (from importlib-metadata==4.8.1->fhempy) (3.6.0)
Requirement already satisfied: pycparser in /opt/fhem/.local/lib/python3.7/site-packages (from cffi>=1.12->cryptography==3.3.2->fhempy) (2.21)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3/dist-packages (from yarl<2.0,>=1.0->aiohttp[speedups]==3.7.4.post0->fhempy) (2.6)
Requirement already satisfied: pycares>=4.0.0 in /opt/fhem/.local/lib/python3.7/site-packages (from aiodns; extra == "speedups"->aiohttp[speedups]==3.7.4.post0->fhempy) (4.1.2)
Installing collected packages: fhempy
Successfully installed fhempy-0.1.178
fhem@fhem:/home/pi$

da steht doch was von python 3.7

dominik

Mach mal
fhem@raspberrypi:~$ pip3 -V
pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)
fhem@raspberrypi:~$ python3 -V
Python 3.9.2
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

ChrisA4

kommt diese Meldung
pi@fhem:~ $  pip3 -V
-bash: pip3: Kommando nicht gefunden.
pi@fhem:~ $ pip3 -V
-bash: pip3: Kommando nicht gefunden.
pi@fhem:~ $ python3 -V
Python 3.7.3
pi@fhem:~ $

aber bei
pi@fhem:~ $ python --version
Python 3.9.7

ich steh am schlauch





dominik

Bist du sicher auf bullseye? /etc/debian_version = 11.1?

Ich kann aber "beruhigen", alle die Probleme haben, es liegt an Tuya selbst:
https://github.com/home-assistant/core/issues/60034#issuecomment-979682872

Das ist ein Post von einem Tuya Engineer. Es sollte also hoffentlich in den nächsten Tagen wieder funktionieren. Sehr ärgerlich...ich habe meine ganze Heizungssteuerung auf Tuya Basis  ???
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

ChrisA4

Zitat von: ChrisA4 am 27 November 2021, 18:59:01
raspian buster 10
full upgrade wurde gemacht
python 3.9.9 wird angezeigt
fhempy gibt:
   

Failed to load module tuya_cloud: Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 301, in _onMessage
    functools.partial(importlib.import_module, pymodule)
  File "/home/pi/.local/lib/python3.7/site-packages/fhempy/lib/utils.py", line 33, 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 "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/pi/.local/lib/python3.7/site-packages/fhempy/lib/tuya_cloud/tuya_cloud.py", line 5, in <module>
    from fhempy.lib.tuya_cloud.tuya_cloud_device import tuya_cloud_device
  File "/home/pi/.local/lib/python3.7/site-packages/fhempy/lib/tuya_cloud/tuya_cloud_device.py", line 5, in <module>
    from tuya_iot.device import TuyaDevice
  File "/home/pi/.local/lib/python3.7/site-packages/tuya_iot/__init__.py", line 2, in <module>
    from .device import TuyaDevice, TuyaDeviceListener, TuyaDeviceManager
  File "/home/pi/.local/lib/python3.7/site-packages/tuya_iot/device.py", line 7, in <module>
    from typing import Any, Literal, Optional
ImportError: cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py)



Weiss nicht weiter

Buster 10

dominik

Buster hat kein Python 3.9
https://packages.debian.org/buster/python3

Da ist Python 3.7 max, daher ein Update auf Bullseye machen und bitte nicht manuell installieren, das macht meistens nur Probleme.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

ChrisA4

@dominik
Vielen vielen Dank
Jetzt läufts
Update auf Bullseye gemacht, fhempy neu drauf und die Geräte wieder da.
Das mit der State aktualisierung funkt trotzdem nicht so, werden wir warten müssen was TuyaIot da noch bastellt.

dominik

Super!

Ich habe gerade einen Workaround eingebaut, dass alle 15min der aktuelle Status von Tuya via API (statt MQTT) bezogen wird. Funktioniert zwar auch nicht 100%, aber hilft ein bisschen. Sobald es bei Tuya wieder läuft, werde ich das entfernen.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

stefanru

Ah, jetzt habe ich das auch kapiert.

Mein Raspberry lief auch noch mit python 3.7.
Habe eben leider, weil ichs hier zu spät gelesen habe, manuell auf 3.8.12 upgedated.
Mache jetzt aber auch das update auf Bullseye.
Hoffe dann sind auch die seltsamen stop Probleme die ich noch hatte behoben.

Gruß und Danke,
Stefan

juergen012

Hallo,
habe heute auf einem Raspi 4 Bullseye, Fhem und Tuya neu installiert. Tuya läuft wieder super..

Gruß
Fhem unter Proxmox