fhempy: googlecast

Begonnen von dominik, 04 Dezember 2020, 23:33:53

Vorheriges Thema - Nächstes Thema

CoolTux

Also fhempy-googlecast sollte der Hostname von Deinem Docker Server sein. Sollte also als IP die selbe haben wie der Server auf dem Docker läuft. Ist das so bei Dir?
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Gear

Ob ich jetzt den Hostname oder die IP des Containers nehme ist egal.

Aus meinem Stack bei Portainer:
services:
  fhempy-googlecast:
    image: ghcr.io/fhem/fhempy-docker_googlecast:releases-1.4-beta
    container_name: FHEMpy-GoogleCast
    hostname: fhempy-googlecast
    restart: always
    networks:
      internal:
        ipv4_address: 172.18.0.11
> ODroid H3 => OMV => Docker => FHEM <
Fritz!Box 7590, Fritz!Repeater 6000, MQTT, RaspberryMatic, Zigbee2MQTT, ESP32, ESP8266, Shelly, Grafana ...
> 3D-Druck <

CoolTux

Dann muss sich das mal einer anschauen der mehr Ahnung von Docker hat. Bin da erstmal raus.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Gear

@CoolTux
Ich danke dir dennoch =)
> ODroid H3 => OMV => Docker => FHEM <
Fritz!Box 7590, Fritz!Repeater 6000, MQTT, RaspberryMatic, Zigbee2MQTT, ESP32, ESP8266, Shelly, Grafana ...
> 3D-Druck <

jnewton957

#424
Nachdem ich eigentlich alles deleted hatte , habe ich nochmals vermeintlich alles neu installiert.

PI = buster
pip 3 = pip 21.2.4 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
python (manuell installiert) =Python 3.9.10


Fhempy_local ist grün jedoch mit dem Hinweis: Installing fhempy (15min).
   
fhempyserver_15733 ist grün mit dem Hinweis:fhempy running FHEM/bindings/python/bin/fhempy
                                                                python v3.9.10

aber im fhempy.log erhalte ich:
2023-01-20 19:56:59,661 - ERROR    - __main__: Failed to load fhempy
Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/bin/fhempy", line 139, in <module>
    import fhempy.lib.fhem_pythonbinding as fpb
ModuleNotFoundError: No module named 'fhempy'
2023-01-20 19:56:59,664 - INFO     - __main__: Attempting install of fhempy>=0.1.462
2023-01-20 19:57:04,372 - ERROR    - __main__: Unable to install package fhempy>=0.1.462: ERROR: Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
    status = self.run(options, args)



ModuleNotFoundError: No module named 'fhempy' ==> was fehlt mir denn jetzt noch ?
fhem ist aktuell und ein update fhempy mit mehrfachem Neustart habe ich auch gemacht.
FHEM6.2 auf Pi5
V 1.66 nanoCUL 433 (IT)
V 1.66 nanoCUL868 (HM)
sqlite3 LogDb
ELRO AB440, DECT200,  TFA30.3125, esp8266, HM, TabletUI, IR-Schreiblesekopf (Udo),tibber Pulse, Kostal Pico, cfos Wallbox, Modbus TCP

Pumba9876

Moin zusammen,
Hätte da mal eine Frage zu der Sprach Ausgabe über ein Google Nest Mini oder generell über die Sprachausgabe über Cast Geräte .Wie kann man die Sprachgeschwindigkeit ändern.
Gruß Pumba
1x FB7590 1x RPI3B 4xShelly 2.5 2x Shelly1Philips Hue ,Teufel Soundbar ,Ones, foscam Kamera

benedikt-wue

Hallo... nur um mich nochmal kurz zu versichern:
es ist nicht mehr möglich, über die FHEM - Oberfläche (wahlweise die FTUI) eine Spotify - Wiedergabe über "transfer" zu starten bzw zu übergeben, richtig?
Ich bekomme es nicht hin, was entweder daran liegt, dass es nicht mehr geht oder (wahrscheinlich) an meinem Unvermögen liegt :-)
Schöne Grüße

Gear

Moin zusammen,

meine Cast Geräte melden sich nicht in FHEM "an".

Der Google-Assi ist verbunden und das Test-Light lässt sich steuern.

define castdevice fhempy googlecast "Mini Wohnzimmer"
attr castdevice DbLogExclude .*
attr castdevice IODev FHEMpy.Google.Cast
attr castdevice group googlecast
attr castdevice room fhempy
#   CASTNAME   Mini Wohnzimmer
#   DEF        googlecast "Mini Wohnzimmer"
#   FHEMPYTYPE googlecast
#   FUUID      63fbaa14-f33f-cc91-a710-bf9091a9efdc1d7e
#   FVERSION   10_fhempy.pm:0.182830/2019-01-16
#   IODev      FHEMpy.Google.Cast
#   NAME       castdevice
#   NR         273
#   PYTHONTYPE googlecast
#   STATE      offline
#   TYPE       fhempy
#   eventCount 4
#   READINGS:
#     2023-02-26 19:51:00   connection      disconnected
#     2023-03-07 09:43:04   spotify_login   <html><a href="https://accounts.spotify.com/authorize?client_id=e92855a009e74eb69ba6609d3bfd7d96&response_type=code&redirect_uri=https%3A%2F%2Feurope-west1-fhem-ga-connector.cloudfunctions.net%2Fcodelanding%2Fstart&code_challenge_method=S256&code_challenge=YfYufyr9jelj21ZauPXfsyPNjnaW8NcOWKKFORBB3V0&scope=user-read-recently-played+user-top-read+user-read-playback-position+user-read-playback-state+user-modify-playback-state+user-read-currently-playing+streaming+playlist-read-private+playlist-read-collaborative+user-follow-read+user-library-read+user-read-email+user-read-private" target="_blank">Connect Spotify account (new window/tab)</a><br></html>
#     2023-03-07 09:43:04   spotify_user    login required
#     2023-03-07 09:43:04   state           offline
#   args:
#     castdevice
#     fhempy
#     googlecast
#     Mini Wohnzimmer
#   argsh:
#
setstate castdevice offline
setstate castdevice 2023-02-26 19:51:00 connection disconnected
setstate castdevice 2023-03-07 09:43:04 spotify_login <html><a href="https://accounts.spotify.com/authorize?client_id=e92855a009e74eb69ba6609d3bfd7d96&response_type=code&redirect_uri=https%3A%2F%2Feurope-west1-fhem-ga-connector.cloudfunctions.net%2Fcodelanding%2Fstart&code_challenge_method=S256&code_challenge=YfYufyr9jelj21ZauPXfsyPNjnaW8NcOWKKFORBB3V0&scope=user-read-recently-played+user-top-read+user-read-playback-position+user-read-playback-state+user-modify-playback-state+user-read-currently-playing+streaming+playlist-read-private+playlist-read-collaborative+user-follow-read+user-library-read+user-read-email+user-read-private" target="_blank">Connect Spotify account (new window/tab)</a><br></html>
setstate castdevice 2023-03-07 09:43:04 spotify_user login required
setstate castdevice 2023-03-07 09:43:04 state offline



Danke und eine gute Nacht
Grüße
Gear
> ODroid H3 => OMV => Docker => FHEM <
Fritz!Box 7590, Fritz!Repeater 6000, MQTT, RaspberryMatic, Zigbee2MQTT, ESP32, ESP8266, Shelly, Grafana ...
> 3D-Druck <

Reinhard.M

Guten Morgen Dominik!
Ich habe googlecast über fhempy erfolgreich eingerichtet, läuft gut. Wenn ich z.B. eine Radio URL an das Device sende wird diese sauber abgespielt. In meinem Nest-Hub Display erscheint allerdings nur der in googlecast eingestellte Player (z.B. BubbleUpnp) aber weder Sender noch aktuell abgespielter Titel. Sage ich direkt dem Hub "Spiele xxx" wird der entsprechende Sender über TuneIn Radio aufgerufen und angezeigt. Ich habe schon versucht die entsprechende URL auch für den googlecast Aufruf zu verwenden, hat aber nichts gebracht. Wie bekomme ich die entsprechenden Media Readings richtig gesetzt? Bislang habe ich dazu leider nichts finden können. Das Ganze ist natürlich kein Drama, wäre aber ganz schön.

Gruß
Reinhard

Pumba9876

#429
Nabend, ich würde gerne bei der Sprachausgabe mit einer Variablen arbeiten wie bekomme ich dieses hin([Status_Person] eq "present" and [07:00-22:00]) ({my $msg = (split(" ",ReadingsTimestamp('Status_Person','state','')))[1];my $text=ReadingsVal($name,'TextMama',''); fhem "set Pushnachricht message person hat das Haus gegen $msg betreten."},set cast speak "$text") so hatte ich mir vorgestellt aber es sagt dann immer $text .
Hatte da einer eine Idee ob und wie das funktionieren könnte.
Also ich mache es mit einem DOIF
Gruß Pumba
1x FB7590 1x RPI3B 4xShelly 2.5 2x Shelly1Philips Hue ,Teufel Soundbar ,Ones, foscam Kamera

Pumba9876

Ich würde gerne das icon von meinem Gestreamten Radio Sender angezeigt bekommen attr Lautsprecher_Garten stateFormat {my $streamicon=ReadingsVal($name, 'mediaImageUrl','');;my $onl = ReadingsVal($name,'connection','connected') eq 'connected' ? 'gruen' : 'rot';;  my $icon = ReadingsVal($name,'mediaPlayerState','PLAYING') eq 'PLAYING' ? 'rc_PLAYgreen' :  ReadingsVal($name,'mediaPlayerState','BUFFERING') eq 'BUFFERING' ? 'hourglass':'rc_PAUSEyellow';;  my $show = '<a>'.FW_makeImage("10px-kreis-$onl").'</a>';; "<div> $show <a>".FW_makeImage($icon).'</a><img scr=$streamicon width="150" height="150"></img>\ nur das Icon wird nicht angezeigt ,wo ist mei. Denk fehler
1x FB7590 1x RPI3B 4xShelly 2.5 2x Shelly1Philips Hue ,Teufel Soundbar ,Ones, foscam Kamera

presskopf

Hallo Dominik,

ich hoffe, ich habe den richtigen Thread erwischt.
Es geht natürlich um die Installation von Fhempy - allerdings unter Bookworm, in einem unprivilegierten LXC Container unter Proxmox.
Ich bin gerade dabei diverse Dienste von den Rasperrys zu zentralisieren.

Der Fhem-Umzug ging eigentlich ganz gut.
Mehr Stress hatte ich gerade bei der Installation von Fhempy.

Ich habe es gerade nochmal mit einer frischen Bookworm-Installation nachvollzogen, aber das Fhempy wird nach
update add https://raw.githubusercontent.com/fhempy/fhempy/master/controls_pythonbinding.txt
update
shutdown restart
define fhempy_local BindingsIo fhempy
nicht installiert.

Es wird wiederholt im Fhempy-log gemeckert, dass
Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/bin/fhempy", line 139, in <module>
    import fhempy.lib.fhem_pythonbinding as fpb
ModuleNotFoundError: No module named 'fhempy'
2023-10-30 20:29:41,375 - INFO     - __main__: Attempting install of fhempy>=0.1.462
2023-10-30 20:29:41,590 - ERROR    - __main__: Unable to install package fhempy>=0.1.462: error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
   
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
   
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
   
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
2023-10-30 20:29:41,590 - ERROR    - __main__: Failed to install fhempy, exit now...
2023-10-30 20:30:51,187 - ERROR    - __main__: Failed to load fhempy
Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/bin/fhempy", line 139, in <module>
    import fhempy.lib.fhem_pythonbinding as fpb
ModuleNotFoundError: No module named 'fhempy'
2023-10-30 20:30:51,188 - INFO     - __main__: Attempting install of fhempy>=0.1.462
2023-10-30 20:30:58,920 - INFO     - __main__: Successfully installed fhempy>=0.1.462
2023-10-30 20:30:58,920 - ERROR    - __main__: Failed to import fhempy, exit now...
2023-10-30 20:31:01,216 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.670...
2023-10-30 20:31:01,216 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2023-10-30 20:31:01,222 - INFO     - websockets.server: server listening on 0.0.0.0:15733
2023-10-30 20:45:17,398 - INFO     - fhempy.lib.fhem_pythonbinding: Starting fhempy 0.1.670...
2023-10-30 20:45:17,398 - INFO     - fhempy.lib.fhem_pythonbinding: Waiting for FHEM connection
2023-10-30 20:45:17,405 - INFO     - websockets.server: server listening on 0.0.0.0:15733

Im Fhempy-Server-Device wird gemeldet: Connection refuses: 127.0.0.1 (111)
Außerdem startet es ständig neu (fhem-log):
2023.10.30 20:23:41 3: fhempyserver_15733: starting
2023.10.30 20:23:41 3: fhempyserver_15733: using logfile: ./log/fhempy-2023-10-30.log
2023.10.30 20:24:41 3: fhempyserver_15733: read: end of file reached while sysread
2023.10.30 20:24:41 3: fhempyserver_15733: stopped
2023.10.30 20:25:01 3: fhempyserver_15733: starting
2023.10.30 20:25:01 3: fhempyserver_15733: using logfile: ./log/fhempy-2023-10-30.log
2023.10.30 20:26:01 3: fhempyserver_15733: read: end of file reached while sysread
2023.10.30 20:26:01 3: fhempyserver_15733: stopped
2023.10.30 20:26:01 3: fhempyserver_15733: starting
2023.10.30 20:26:01 3: fhempyserver_15733: using logfile: ./log/fhempy-2023-10-30.log
2023.10.30 20:27:01 3: fhempyserver_15733: read: end of file reached while sysread
2023.10.30 20:27:01 3: fhempyserver_15733: stopped

Dennoch bekam ich fhempy installiert:
Hier zu benannte ich die /var/lib/python3.11/EXTERNALLY-MANAGED um in EXTERNALLY-MANAGED.old.

Anschließend lief die Installation im fhempy_local-Device. Allerdings elend langsam.
Deutlich schneller gings mit dem bekannten:
sudo -u fhem bash
pip3 install fhempy

Nun scheint alles zu funktionieren.

Ich weiß nicht, ob das (unter Bookworm oder python 3.11) normal ist oder hatte ich von Grundauf etwas falsch angegangen?

Viele Grüße
Matthias


OliverHH

Hallo,

leider bekomme ich fhempy unter Debian bookworm nicht zum Laufen. Im Log des fhempyserver steht folgendes:

Activating virtual environment...OK
2023-12-29 15:16:43,239 - ERROR    - __main__: Failed to load fhempy
Traceback (most recent call last):
  File "/opt/fhem/FHEM/bindings/python/bin/start_fhempy.py", line 141, in <module>
    import fhempy.lib.fhem_pythonbinding as fpb
ModuleNotFoundError: No module named 'fhempy'
2023-12-29 15:16:43,247 - INFO     - __main__: Attempting install of fhempy>=0.1.462
2023-12-29 15:16:43,301 - ERROR    - __main__: Unable to install package fhempy>=0.1.462: /opt/fhem/.fhempy/fhempy_venv/bin/python3: No module named pip
2023-12-29 15:16:43,301 - ERROR    - __main__: Failed to install fhempy, exit now...

Mir fehlt eine Idee wie ich das beheben kann. Hat jemand einen Tipp?

Danke & Gruß,
Oliver
HMLAN, Raspberry Pi 2 mit HM-MOD-UART, Charly CCU3 mit Raspberrymatic, Tradfri Gateway, Google Assistant, HomeConnect

OliverHH

Hallo nochmal,

Problem gelöst,ich gebe mir die Antwort selbst:

Irgendetwas ist bei der Erstellung des virtual environment schief gelaufen. Ich habe den Ordner

/opt/fhem/.fhempy

gelöscht und fhempy noch einmal neu angelegt -> funktioniert!

Viele Grüße,
Oliver
HMLAN, Raspberry Pi 2 mit HM-MOD-UART, Charly CCU3 mit Raspberrymatic, Tradfri Gateway, Google Assistant, HomeConnect