fhempy: googlecast

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

Vorheriges Thema - Nächstes Thema

dominik

sudo apt install lib32z1-dev
und danach nochmals...
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

Hier das Protokoll des Befehls. Wurde mit Code100 beendet. Scheint wohl nicht geklappt zu haben, also bevor ich den anderen Befehl wiederhole und noch mal eine halbe Stunde vergeht, klören wir besser erst mal das, oder?
Reading package lists... Done                                                                                                                                                                                                                   
Building dependency tree                                                                                                                                                                                                                       
Reading state information... Done                                                                                                                                                                                                               
E: Unable to locate package lib32z1-dev


Was kann das denn bedeuten wenn er das Paket nicht finden kann?

dominik

sudo apt-get install zlib1g-dev
probier mal das
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

Das ist erfolgreich durchgelaufen.

Soll ich jetzt den anderen noch mal probieren?

dominik

fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

Hab die Befehle noch mal durch, jetzt hat auch die Installation des Spotify_Tokens offenbar geklappt.
"sudo -u fhem pip3 install spotify_token":
Collecting spotify_token                                                                                                                                                                                                                       
  Using cached https://files.pythonhosted.org/packages/d6/f5/9bf0e6664d6afa27e7329c949707d9c3ce143b1154895d0f49b836952bf4/spotify_token-1.0.0-py2.py3-none-any.whl                                                                             
Requirement already satisfied: beautifulsoup4>=4.8.1 in ./.local/lib/python3.7/site-packages (from spotify_token) (4.9.3)                                                                                                                       
Collecting lxml>=4.4.1 (from spotify_token)                                                                                                                                                                                                     
  Using cached https://files.pythonhosted.org/packages/db/f7/43fecb94d66959c1e23aa53d6161231dca0e93ec500224cf31b3c4073e37/lxml-4.6.2.tar.gz                                                                                                     
Requirement already satisfied: requests>=2.0 in /usr/lib/python3/dist-packages (from spotify_token) (2.21.0)                                                                                                                                   
Requirement already satisfied: soupsieve>1.2; python_version >= "3.0" in ./.local/lib/python3.7/site-packages (from beautifulsoup4>=4.8.1->spotify_token) (2.1)                                                                                 
Building wheels for collected packages: lxml                                                                                                                                                                                                   
  Running setup.py bdist_wheel for lxml ... done                                                                                                                                                                                               
  Stored in directory: /opt/fhem/.cache/pip/wheels/a0/0c/b2/b0e301d586f899fdabf46a03ee9d037d2c6df30bc9efa57bae                                                                                                                                 
Successfully built lxml                                                                                                                                                                                                                         
Installing collected packages: lxml, spotify-token                                                                                                                                                                                             
Successfully installed lxml-4.6.2 spotify-token-1.0.0


Leider hat das an der Fehlermeldung der Googlecast-Devices nicht geändert. Die zeigen immer noch "Module failed to load: googlecast Maybe you need to update fhempy on this or remote peer. Stacktrace: Traceback (most recent call last): File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 241, in _onMessage module_object = importlib.import_module(pymodule) 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 "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/googlecast/googlecast.py", line 28, in import spotify_token as st ModuleNotFoundError: No module named 'spotify_token'" an.
Hier das List zum Device:
Internals:
   .AttrList  .*
   .FhemMetaInternals 1
   DEF        googlecast "Schlafzimmerlautsprecher"
   FUUID      5fba773c-f33f-793a-5007-c9bf0d1a378d6c54
   FVERSION   10_PythonModule.pm:0.182830/2019-01-16
   IODev      local_pybinding
   NAME       Schlafzimmerlautsprecher
   NR         92
   PYTHONTYPE googlecast
   STATE      Module failed to load: googlecast
Maybe you need to update fhempy on this or remote peer.

Stacktrace:
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 241, in _onMessage
    module_object = importlib.import_module(pymodule)
  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/googlecast/googlecast.py", line 28, in <module>
    import spotify_token as st
ModuleNotFoundError: No module named 'spotify_token'

   TYPE       PythonModule
   .attraggr:
   .attreocr:
     .*
   .attrminint:
   .attrtocr:
     .*
   READINGS:
     2021-01-01 15:31:16   app_id         
     2020-11-22 20:55:53   cast_type       cast
     2021-01-01 02:10:52   connection      connected
     2021-01-01 15:31:16   display_name   
     2020-12-22 19:38:03   icon_url       
     2020-11-22 20:55:53   ignore_cec      0
     2020-11-22 20:55:53   is_active_input 0
     2020-11-22 20:55:53   is_stand_by     1
     2020-12-12 18:50:03   mediaAlbum     
     2020-12-12 18:50:03   mediaArtist     
     2020-12-28 21:35:08   mediaContentId 
     2020-12-28 21:35:08   mediaContentType
     2020-12-28 21:30:08   mediaCurrentPosPercent
     2020-12-28 21:30:08   mediaCurrentPosition
     2020-12-28 21:35:08   mediaDuration   
     2020-12-12 18:50:03   mediaImageHeight
     2020-12-12 18:50:03   mediaImageUrl   
     2020-12-12 18:50:03   mediaImageWidth
     2020-12-28 21:35:08   mediaPlayerState UNKNOWN
     2020-12-28 21:35:08   mediaStreamType UNKNOWN
     2020-12-12 18:50:03   mediaTitle     
     2020-11-22 20:55:53   model_name      Google Nest Mini
     2020-11-22 20:55:53   mute            0
     2020-11-22 20:55:53   name            Schlafzimmerlautsprecher
     2021-01-01 15:31:16   session_id     
     2021-01-02 12:44:39   state           Module failed to load: googlecast
Maybe you need to update fhempy on this or remote peer.

Stacktrace:
Traceback (most recent call last):
  File "/opt/fhem/.local/lib/python3.7/site-packages/fhempy/lib/fhem_pythonbinding.py", line 241, in _onMessage
    module_object = importlib.import_module(pymodule)
  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/googlecast/googlecast.py", line 28, in <module>
    import spotify_token as st
ModuleNotFoundError: No module named 'spotify_token'

     2021-01-01 15:31:16   status_text     
     2020-12-28 21:35:08   transport_id   
     2020-11-22 20:55:53   uuid            dbef8319-c89c-e735-11f6-ce7777b133b2
     2021-01-01 15:26:28   volume          26
   args:
     Schlafzimmerlautsprecher
     PythonModule
     googlecast
     Schlafzimmerlautsprecher
   argsh:
Attributes:
   IODev      local_pybinding
   event-on-change-reading .*
   group      Audiosystem
   icon       audio_loudness
   room       Devices,GAssistant
   timestamp-on-change-reading .*
   userattr   favorite_1 favorite_2 favorite_3 favorite_4 favorite_5
   verbose    2


muss der Server erst neugestartet werden oder ist der Fehler immer noch vorhanden?

dominik

Probier Mal einen Neustart
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

Hab ich, jetzt werden die Google-Nest wieder als online angezeigt. Danke soweit schon mal.

Jetzt geht es nur noch darum, meine Spotify Playlists vom Fhem-Server ohne öffnen der Webseite direkt auf einem der Nest abspielen zu können, das muss aber nicht mehr heute Abend sein. Denke mal du willst auch noch etwas Ruhe haben, oder?

Zwei Fragen am Rande, die sich mir noch stellen:
1) Woher kam das Problem jetzt genau? Hab ja nur ein Update gemacht
2) Muss ich dieses Prozedere jetzt nach jedem Update machen damit es läuft?

dominik

Das war nur bei diesem Update, wegen neuer Abhängigkeit spotify_token.

Jetzt musst du spotify_sp_dc und spotify_sp_key setzen. Dazu einfach die Attribute auswählen, dann siehst du in der Beschreibung was zu tun ist.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

#54
sp_dc hab ich gefunden und eingetragen, aber sp_key finde ich auf der Webseite nirgendwo aufgelistet.
Ich arbeite aber nur mit Edge und nicht mit Chrome. Kann das einen Unterschied machen?

dominik

Sollten im Edge denke ich auch beide verwendet werden.

Ansonsten starte einfach mal kurz Chrome und übernimm die Werte von dort. Du kannst ihn danach auch deinstallieren.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

#56
Hab Chrome installiert, leider ist da die aufgerufene Seite komplett leer.

Nachdem ich die Desktop-App über Chrome runtergeladen habe und mich dort mal angemeldet habe waren die Daten auf der Seite angezeigt, tatsächlich auch mit dem sp_key.
Was kommt als nächstes?

dominik

Beide Werte eintragen...danach kannst mit play ... (Spotify Link) abspielen.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik

Superposchi

Ne ging leider nicht sonst hätte ich nicht gefragt.
Musste erst wieder neustarten, davor war der Spotify-User noch nicht korrekt hinterlegt.
Erst nach dem Neustart stimmte der Eintrag und es ging mit Play und die url der Playlist oder einem vorher bestückten Favoriten.

dominik

Ok, Neustart sollte eigentlich nicht notwendig sein, aber gut, jetzt klappt es ja.
fhempy -  https://github.com/fhempy/fhempy: GoogleCast, Tuya, UPnP, Ring, EQ3BT, Nespresso, Xiaomi, Spotify, Object Detection, ...
Kaffeespende: https://paypal.me/todominik