fhempy: Tuya Cloud

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

Vorheriges Thema - Nächstes Thema

xypzo

my tuya christmas lights come up in fhem as "8 Functies Lichten"
This is a name with spaces and i would like to change them in a name without spaces for easy commands.
rename 8 Functies Lichten christmaslights1 wont work.
Also rename 8_Functies_Lichten christmaslights1 doesnt.

How can i change this?

dominik

Provide a list of that device. I don't think that the device is with spaces, as fhem as far as I know doesn't allow spaces in names.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

UweH

Hallo dominik,

nachdem ich mit meiner Weisheit am Ende bin, nun doch der Hilferuf...
Die Installation unter FHEM hat funktioniert, local_pybinding ist auf grün, fhempyserver_15733 ist auf status stopped, weil der tuya_cloud_connector mit dem state "fhempy server offline" keine Verbindung zu tuya iot aufbaut. Und da liegt wohl auch erst mal mein Problem, da komme ich nicht weiter. Das Cloud Project auf iot.tuya.com ist angelegt, Verbindung zur App (smartlife) ist hergestellt und meine beiden Devices (Gateway und Heizkörperthermostat) werden angezeigt und sind online.
Im Unterschied zu Deinen Service API sieht das bei mir aber anders aus. Ich bekomme nicht die Service API "Smart Home Devices Management" und "Smart Home Family Management" zu fassen, die ja wohl nicht ganz unerheblich sind. Weder beim Einrichten eines Projects noch danach. Woher bezieht man die?

Danke und Gruß
Uwe

dominik

local_pybinding steht sich auf Open? Weil wenn das Device fhempy Server offline schreibt, ist dort wahrscheinlich auch nicht Open.

Ansonsten mach nochmals das Define vom Setup Device und schau was im fhempy Log kommt.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

UweH

Der sieht so aus:
Internals:
   BindingType fhempy
   DEF        fhempy
   DeviceName ws:127.0.0.1:15733
   FUUID      61ab259e-f33f-342e-2989-ef7c1105f700535c
   IP         127.0.0.1
   NAME       local_pybinding
   NEXT_OPEN  1638692763.70962
   NR         508
   NTFY_ORDER 50-local_pybinding
   PARTIAL   
   PORT       15733
   STATE      fhempy server offline
   TYPE       BindingsIo
   localBinding 1
   nextOpenDelay 10
   READINGS:
     2021-12-05 09:25:54   state           fhempy server offline
   args:
     local_pybinding
     BindingsIo
     fhempy
   argsh:
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       fhempy



Und das steht endlos im Log:

SyntaxError: invalid syntax
  File "FHEM/bindings/python/bin/fhempy", line 87
    logging.getLogger(__name__).info(f"Successfully installed {package}")
                                                                       ^

dominik

Ah, welche Python Version hast du? Python 3.7 oder höher ist notwendig.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

UweH

Danke, ja, Recht Du hast. Ich habe 2.7.13
Werde mich gleich mal drum kümmern.

dominik

Eigentlich sollte da eine Fehlermeldung kommen, dass die Version zu alt ist. Muss ich mir mal anschauen wieso das nicht kommt.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

UweH

Die Aktualisierung von python ist ein größeres Projekt...meine Fresse. Das dauert noch, bis ich dahinter gestiegen bin.

Gruß
Uwe

dominik

Was nutzt du für ein System? Falls Debian, dann am besten auf bullseye aktualisieren.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

UweH

Ja, Debian, und Danke für den Hinweis, der Bulle rennt gerade. Dauert etwas...  ;)

UweH

Sodele, ich sträube mich etwas, diese Frage hier zu stellen, weil das eigentlich nicht der richtige Thread dafür ist, irgendwie passt's aber trotzdem.

Ich habe mich an folgende Installationsanweisung gehalten (https://www.linuxcapable.com/how-to-install-python-3-8-on-debian-11-bullseye/) und die Installation ist fehlerlos durchgelaufen.
Das Ergebnis von "ls -ls /usr/bin/python*" ist (sowohl vor als auch nach der Installation von 3.8.12):

   0 lrwxrwxrwx 1 root root       9 Jan 24  2017 /usr/bin/python -> python2.7
   0 lrwxrwxrwx 1 root root       9 Jan 24  2017 /usr/bin/python2 -> python2.7
3688 -rwxr-xr-x 1 root root 3775416 Apr 16  2021 /usr/bin/python2.7
   0 lrwxrwxrwx 1 root root       9 Jan 20  2017 /usr/bin/python3 -> python3.5
4640 -rwxr-xr-x 2 root root 4751216 Nov  4 16:29 /usr/bin/python3.5
   0 lrwxrwxrwx 1 root root      33 Nov  4 16:29 /usr/bin/python3.5-config -> x86_64-linux-gnu-python3.5-config
4640 -rwxr-xr-x 2 root root 4751216 Nov  4 16:29 /usr/bin/python3.5m
   0 lrwxrwxrwx 1 root root      34 Nov  4 16:29 /usr/bin/python3.5m-config -> x86_64-linux-gnu-python3.5m-config
   0 lrwxrwxrwx 1 root root      16 Jan 20  2017 /usr/bin/python3-config -> python3.5-config
   0 lrwxrwxrwx 1 root root      10 Jan 20  2017 /usr/bin/python3m -> python3.5m
   0 lrwxrwxrwx 1 root root      17 Jan 20  2017 /usr/bin/python3m-config -> python3.5m-config


Bei Eingabe von "python3 --version" erhalte ich:
Python 3.5.3

mit "python3.8 --version"
Python 3.8.12

Jetzt zum eigentlichen Problem. Irgendwie oder -wo muss ich dem System beibringen, nunmehr auf die Version 3.8.12 zuzugreifen. Laut Anleitung sollte dies durch
"sudo ldconfig /opt/Python-3.8.12" passieren (Der Bindestrich vor der 3 ist korrekt, entgegen der Anleitung lautet der Verzeichnisname Python-3.8.12). Tut es aber nicht. Auch ein Neustart bringt keinen Erfolg.

Hat jemand eine Idee, was ich noch tun muss?

Danke und Gruß
Uwe

dominik

Bitte, bitte nicht Python manuell installieren, das macht sonst nur Probleme.

Bullseye bringt per default Python 3.9 mit. Mach einfach ein
sudo apt update
sudo apt full-upgrade
sudo apt install python3
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

UweH

Das Upgrade hatte ich so anstoßen wollen, da meldet sich aber ein

python3 ist schon die neueste Version (3.5.3-1)

Daraufhin wollte ich den Heini überlisten und habe es manuell installiert. Klappt aber offenbar auch nicht.

dominik

Da bist du noch immer auf Stretch. Hast du alle /etc/apt/sources* angepasst?
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik