fhempy: Tuya Cloud

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

Vorheriges Thema - Nächstes Thema

satprofi

gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

stefanru

Hi,

wer Probleme mit dem Server hat könnt ihr mal schauen ob er eventuell schon läuft?
Ich habe dieses Problem das mein FHEM bei einem stop bzw restart den Server Prozess nicht beendet.
Ich weiß nicht warum das so ist und konnte es auch noch nicht lösen.
Das Verhalten ist dann wie beschrieben.
FHEM startet aber es funktioniert nicht und der Server ist rot.
Beende ich per Kommandozeile den noch laufenden fhempy Server Prozess und starte ihn im FHEM neu geht alles.


Herausfinden ob ihr das Problem habt:
FHEM stoppen
ps -ef | grep fhempy

Seht ihr solch eine Zeile läuft der Server noch und wird beim neuen Starten von FHEM zu Problemen führen:
fhem      3255  1239  0 Jan23 ?        00:06:58 python3 FHEM/bindings/python/bin/fhempy --local

Beenden in dem ihr einen kill auf die PUID ausführt.
Bei euch ist die PID anders!

Also in meinem Fall:
kill 3255

Danach FHEM starten.
Das funktioniert auch wenn FHEM schon läuft.
Alten Serverprozess killen und neu starten in FHEM.

Gruß,
Stefan


RitterSport

@stefanru:
Danke für den Hinweis.
Ich habe meinen alten Raspi soweit dazu bekommen zu laufen ,werde aber deine Hinweise austesten.

satprofi

#498
seit gestern sind auf 2 fhem instanzen beide "fhempy server offline", trotz 

"fhempy

running FHEM/bindings/python/bin/fhempy"


[edit] tuya_cloud_connector neu angelegt, jetzt passts wieder. ärgerlich. bug?
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

satprofi

Hallo.
seit kurzem werden keine devices mehr synchronisiert, trotz connection zum server.
gestern 2 geräte angelernt, am tuya server auch sichtbar, nur in fhem leider nicht. hat es was mit neuerster version 0.1.209 zu tun?
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

dominik

Hi,

Tuya Cloud macht scheinbar wieder Probleme. Ich bekomme aktuell nur in sehr unregelmäßigen Abständen Reading Updates von Tuya. Das ist das gleiche Problem wie vor einigen Wochen.

Neue Devices habe ich bislang immer bekommen. Werden diese auch nicht angelegt wenn du fhempy neu startest?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

stefanru

Hi,

kann ich auch bestätigen Updates sind sehr unregelmäßig.

Gruß,
Stefan

satprofi

Zitat von: dominik am 04 Februar 2022, 20:09:51
Hi,

Tuya Cloud macht scheinbar wieder Probleme. Ich bekomme aktuell nur in sehr unregelmäßigen Abständen Reading Updates von Tuya. Das ist das gleiche Problem wie vor einigen Wochen.

Neue Devices habe ich bislang immer bekommen. Werden diese auch nicht angelegt wenn du fhempy neu startest?
nein, habe es manuel angelegt und sofort die readings erhalten. steuern klappt auch sekundenschnell.
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram

stefanru

Hi,

habe noch eine Frage, kennt jemand diese Phänomen?
Wenn ich den Raspberry oder FHEM neu starte bekomme ich diese Meldung im Globals:
Messages collected while initializing FHEM:configfile: fhempy_log already defined, delete it first

Ich habe geschaut fhempy_log ist genau einmal in deer fhem.cfg und nicht in fhem.save.

Irgendeine Idee wie ich das weg bekomme?

Gruß und Danke,
Stefan

dominik

Ja, ist noch ein Fehler in fhempy. Behebe ich beim nächsten Update.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

stefanru


Der_Tom

#506
Hi Dominik,


leider bekomme ich nach einer komplette Neuinstallation Fhempy nicht mehr ans laufen.

fhempyserver_15733 scheint zu laufen
Internals:
   DEF        0
   FD         55
   FUUID      61d82555-f33f-e50d-543e-38cdfc6302672afc
   LAST_START 2022-02-12 17:56:53
   LAST_STOP  2022-02-12 17:56:33
   NAME       fhempyserver_15733
   NR         30
   NTFY_ORDER 50-fhempyserver_15733
   PID        692
   STARTS     2
   STATE      ???
   TYPE       fhempyServer
   currentlogfile ./log/fhempy-2022-02-12.log
   logfile    ./log/fhempy-%Y-%m-%d.log
   CoProcess:
     cmdFn      fhempyServer_getCmd
     name       fhempy
     state      running FHEM/bindings/python/bin/fhempy
   READINGS:
     2022-02-12 17:56:53   fhempy          running FHEM/bindings/python/bin/fhempy
Attributes:
   devStateIcon {      my $status_img = "10px-kreis-gruen";;      my $status_txt = "running";;      if (substr(ReadingsVal($name, "fhempy", "running"),0,7) ne "running") {        $status_img = "10px-kreis-rot";;        $status_txt = "stopped";;      }      "<div><a>".FW_makeImage($status_img, $status_txt)."</a><a  href=\"/fhem?cmd.dummy=set $name restart&XHR=1\" title=\"Restart\">".FW_makeImage("audio_repeat")."</a></div>"      }
   group      fhempy
   icon       python
   logfile    ./log/fhempy-%Y-%m-%d.log
   nrarchive  10
   room       Gateways
   verbose    0


local_pybinding scheint auch zu laufen :

Internals:
   BindingType fhempy
   CFGFN     
   DEF        fhempy
   DeviceName ws:127.0.0.1:15733
   FD         69
   FUUID      6207f63c-f33f-caec-45de-1e6f79ea23935707
   IP         127.0.0.1
   NAME       fhempy_local
   NR         1578
   NTFY_ORDER 50-fhempy_local
   PARTIAL   
   PORT       15733
   STATE      opened
   TYPE       BindingsIo
   WEBSOCKET  1
   localBinding 1
   nextOpenDelay 10
   READINGS:
     2022-02-12 18:02:39   state           opened
     2022-02-12 18:02:39   version         0.1.228
   args:
     fhempy_local
     BindingsIo
     fhempy
   argsh:
   hmccu:
Attributes:
   devStateIcon {      my $status_img = "10px-kreis-gruen";;      my $status_txt = "connected";;      if (ReadingsVal($name, "state", "disconnected") eq "disconnected") {        $status_img = "10px-kreis-rot";;        $status_txt = "disconnected";;      }      my $ver = ReadingsVal($name, "version", "-");;      "<div><a>".FW_makeImage($status_img, $status_txt)."</a><a> ".$ver." </a><a  href=\"/fhem?cmd.dummy=set $name update&XHR=1\" title=\"Start update\">".FW_makeImage("refresh")."</a></div>"    }
   group      fhempy
   icon       file_json-ld2
   room       New_Defined




aber den Tuya cloud connector bekomme ich nicht hin :
Internals:
   CFGFN     
   DEF        tuya_cloud setup xxx
   FHEMPYTYPE tuya_cloud
   FUUID      6207f69e-f33f-caec-0534-05898754dd0729bb
   IODev      fhempy_local
   NAME       tuya_cloud_connector
   NR         1856
   PYTHONTYPE tuya_cloud
   STATE      Failed to load module tuya_cloud: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 269, in _onMessage
    functools.partial(importlib.import_module, pymodule)
  File "/opt/fhem/.local/lib/python3.7/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.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 "/opt/fhem/.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 "/opt/fhem/.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 "/opt/fhem/.local/lib/python3.7/site-packages/tuya_iot/__init__.py", line 2, in <module>
    from .device import TuyaDevice, TuyaDeviceListener, TuyaDeviceManager
  File "/opt/fhem/.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)

   TYPE       PythonModule
   READINGS:
     2022-02-12 18:04:14   state           Failed to load module tuya_cloud: Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 269, in _onMessage
    functools.partial(importlib.import_module, pymodule)
  File "/opt/fhem/.local/lib/python3.7/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.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 "/opt/fhem/.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 "/opt/fhem/.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 "/opt/fhem/.local/lib/python3.7/site-packages/tuya_iot/__init__.py", line 2, in <module>
    from .device import TuyaDevice, TuyaDeviceListener, TuyaDeviceManager
  File "/opt/fhem/.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)

   args:
     tuya_cloud_connector
     PythonModule
     tuya_cloud
     setup
    xxx
     xxx
     xxx
   argsh:
   hmccu:
Attributes:
   room       New_Defined


kannst du mir da ggf. helfen ,ich weiss nicht wirklich weiter.

gruss Thomas

dominik

Bitte auf bullseye aktualisieren damit du Python 3.9 als Standard bekommst.

Die tuya Library unterstützt aktuell nur Python 3.8 oder höher. Mein Patch für 3.7 Support wurde mittlerweile eingepflegt, nur fehlt noch das Release von Tuya und daher geht im Moment noch kein 3.7.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Der_Tom

Zitat von: dominik am 12 Februar 2022, 20:09:26
Bitte auf bullseye aktualisieren damit du Python 3.9 als Standard bekommst.

Die tuya Library unterstützt aktuell nur Python 3.8 oder höher. Mein Patch für 3.7 Support wurde mittlerweile eingepflegt, nur fehlt noch das Release von Tuya und daher geht im Moment noch kein 3.7.

dank dir für die schnelle Info ( habe eben gesehen , das das lesen von 2 seiten rückwärts bereits geholfen hätte - war gestresst davon und habe das wieder besseren Wissens nicht getan . Sorry dafür.)

gruss Thomas

satprofi

hallo.
heute mail erhalten das mein zuganf an 22.2. abläuft. verlängerung kostet.
klapot das modul dann weiterhin?
gruss
-----------------------------------------------------------------------
beelink miniPC - Fhem 6.x CUL 868, FS20, NetIO230 CUL 433
HMLAN, HM-CC-RT-DN,Homematic Actoren,LD382A,Telegram