Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. [Vorlage] Spotify Skript

NEWS

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    17
    1
    2.8k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.1k

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    25
    1
    2.4k

[Vorlage] Spotify Skript

Scheduled Pinned Locked Moved Skripten / Logik
javascript
745 Posts 95 Posters 276.2k Views 41 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Worn
    wrote on last edited by
    #179

    Habe geupdated. Läuft :). Seltsamerweise hatten sich meine Probleme verflüchtigt. Ich habe seit meinem letzten Post keine Probleme mehr gehabt :). Happy user!

    1 Reply Last reply
    0
    • twonkyT Offline
      twonkyT Offline
      twonky
      wrote on last edited by
      #180

      Ich glaube du hast an einer Stelle ein Zeichen vergessen:

      Im Listener für javascript.0.Spotify.Authorization.Authorized:

       else if(err==202||(err==502)||(err=401)){  //202,401 und 502 lassen den Interval  weiter laufen
                              DummyBody={is_playing:false};//tritt ein wenn kein Player geöffnet ist
                              CreatePlaybackInfo(DummyBody)}
      
      

      Dort fehlt ein = vor der 401. Da es eine Zuweisung mit einer Konstante ist, ist die Bedingung immer erfüllt.

      EDIT:

      Und ich denke du hast ein Typo drin. Der neue State in Get_Playlist_Tracks heißt "Track_List_Sting", ich denke da fehlt ein r. ;)

      1 Reply Last reply
      0
      • L Offline
        L Offline
        Lucky
        wrote on last edited by
        #181

        Danke! Habs geändert! :D

        1 Reply Last reply
        0
        • twonkyT Offline
          twonkyT Offline
          twonky
          wrote on last edited by
          #182

          Sry, immer noch ein Sting drin ;) Das war an 2 Stellen.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            Lucky
            wrote on last edited by
            #183

            @twonky:

            Sry, immer noch ein Sting drin ;) Das war an 2 Stellen. `
            Ach verdammt :roll: jetzt aber! :D

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MasterG87
              wrote on last edited by
              #184

              Danke, meinen letzten Fehler hast du mit dem Update beseitigt.

              Aber bei mir funktioniert der Button Get_User_Playlists nicht mehr. Er erzeugt keinen Playlist Ordner mehr. Ist das bereits bekannt? Wie kann man jetzt Playlists auswählen?

              1 Reply Last reply
              0
              • L Offline
                L Offline
                Lucky
                wrote on last edited by
                #185

                bei mir gehts..hast du mal deine Datenpunkte aktualisiert ?

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  MasterG87
                  wrote on last edited by
                  #186

                  Mhm ok. Mittlerweile wirft das Skript auch einen Fehler. Vielleicht kannst du damit was anfangen:

                  ! host.raspbian 2018-02-13 00:12:25.343 error instance system.adapter.javascript.0 terminated with code 0 (OK)
                  ! Caught 2018-02-13 00:12:25.343 error by controller[0]: at IncomingMessage.g (events.js:292:16)
                  ! Caught 2018-02-13 00:12:25.343 error by controller[0]: at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
                  ! Caught 2018-02-13 00:12:25.343 error by controller[0]: at Request.emit (events.js:188:7)
                  ! Caught 2018-02-13 00:12:25.343 error by controller[0]: at emitOne (events.js:96:13)
                  ! Caught 2018-02-13 00:12:25.342 error by controller[0]: at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
                  ! Caught 2018-02-13 00:12:25.342 error by controller[0]: at Request.emit (events.js:191:7)
                  ! Caught 2018-02-13 00:12:25.342 error by controller[0]: at emitTwo (events.js:106:13)
                  ! Caught 2018-02-13 00:12:25.341 error by controller[0]: at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
                  ! Caught 2018-02-13 00:12:25.341 error by controller[0]: at Request._callback (script.js.Spotify.Spotify:173:24)
                  ! Caught 2018-02-13 00:12:25.341 error by controller[0]: at script.js.Spotify.Spotify:349:92
                  ! Caught 2018-02-13 00:12:25.340 error by controller[0]: TypeError: Cannot read property 'replace' of null
                  ! javascript.0 2018-02-13 00:12:25.210 error at IncomingMessage.g (events.js:292:16)
                  ! javascript.0 2018-02-13 00:12:25.210 error at IncomingMessage. (/opt/iobroker/node_modules/request/request.js:1085:12)
                  ! javascript.0 2018-02-13 00:12:25.210 error at Request.emit (events.js:188:7)
                  ! javascript.0 2018-02-13 00:12:25.210 error at emitOne (events.js:96:13)
                  ! javascript.0 2018-02-13 00:12:25.210 error at Request. (/opt/iobroker/node_modules/request/request.js:1163:10)
                  ! javascript.0 2018-02-13 00:12:25.210 error at Request.emit (events.js:191:7)
                  ! javascript.0 2018-02-13 00:12:25.210 error at emitTwo (events.js:106:13)
                  ! javascript.0 2018-02-13 00:12:25.210 error at Request.self.callback (/opt/iobroker/node_modules/request/request.js:186:22)
                  ! javascript.0 2018-02-13 00:12:25.210 error at Request._callback (script.js.Spotify.Spotify:173:24)
                  ! javascript.0 2018-02-13 00:12:25.210 error at script.js.Spotify.Spotify:349:92
                  ! javascript.0 2018-02-13 00:12:25.210 error TypeError: Cannot read property 'replace' of null
                  ! javascript.0 2018-02-13 00:12:25.210 error uncaught exception: Cannot read property 'replace' of null
                  ! javascript.0 2018-02-13 00:12:25.148 warn Object "javascript.0.Spotify.Playlists.Symphoniacs–Symphoniacs.id" does not exist
                  ! javascript.0 2018-02-13 00:12:25.139 warn Object "javascript.0.Spotify.Playlists.MeineShazam-Titel.id" does not exist
                  ! javascript.0 2018-02-13 00:12:24.787 warn at Object. (script.js.Spotify.Spotify:652:118)
                  ! javascript.0 2018-02-13 00:12:24.783 warn getState "javascript.0.Spotify.Playlists.MeineShazam-Titel.id" not found (3)
                  ! javascript.0 2018-02-13 00:12:24.782 warn at Object. (script.js.Spotify.Spotify:652:42)
                  ! javascript.0 2018-02-13 00:12:24.757 warn getState "javascript.0.Spotify.Playlists.MeineShazam-Titel.owner" not found (3)

                  Sagt dir das was? Er hat es nämlich geschafft die Playlist MeineShazam anzulegen, aber ohne Musiktitel. Alle weiteren Playlists fehlen bzw die Songs aus MeineShazam.

                  Edit: Ok ich konnte den Fehler beheben. Ich hatte eine mittlerweile leere Playlist in Spotify die ich abonniert hatte. Diese war nicht mehr verfügbar und hat wohl den Fehler erzeugt. Wäre natürlich trotzdem nett wenn das Skript sowas abfängt, aber jetzt keine muss :)

                  1 Reply Last reply
                  0
                  • E Offline
                    E Offline
                    el-lutschi
                    wrote on last edited by
                    #187

                    Hallo zusammen,

                    bei mir funktioniert der Get Paylist Button auch nicht. Im Log habe ich allerdings keine Meldungen.

                    Gruß

                    Chris

                    EDIT: OK jetzt geht es. Ich musste das Skript nach der Authorisierung nochmal neustarten.

                    1 Reply Last reply
                    0
                    • twonkyT Offline
                      twonkyT Offline
                      twonky
                      wrote on last edited by
                      #188

                      Ich habe das Skript von Lucky mal in einen Adapter gepackt: https://github.com/twonky4/ioBroker.spotify-premium

                      Wäre toll wenn noch jemand außer mir das testen könnte :)

                      1 Reply Last reply
                      0
                      • wendy2702W Online
                        wendy2702W Online
                        wendy2702
                        wrote on last edited by
                        #189

                        Hi,

                        nutzt der Adapter exakt dieselben Datenpunkt/Objekte wie das Script?

                        Muss ich die Objekte vorher löschen oder reicht es zum test das Script zu stoppen?

                        Ich hoffe die Konfig ist selbsterklärend !?

                        Gruß

                        Bitte keine Fragen per PN, die gehören ins Forum!

                        Benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat.

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          tempestas
                          wrote on last edited by
                          #190

                          Ist das SONOS Problem zwischenzeitlich erledigt? Oder geht das leider noch nicht? Irgendwo hier im Thread stand ja mal, dass SONOS aktuell nicht will?

                          Wenn es erledigt ist, teste ich den Adapter sehr gerne!

                          <size="85">ioBroker | 21 Adapter | Ubuntu Server | intel NUC | Homematic CCU2 | Hue | Osram Lightify| Sonos | 2x Instar Cam | Samsung Tab A 2016 im Holzrahmen| 3x Echo dot | 1x Echo | Neato Botvac D5</size>

                          1 Reply Last reply
                          0
                          • twonkyT Offline
                            twonkyT Offline
                            twonky
                            wrote on last edited by
                            #191

                            Die Datenpunkte unterscheiden sich nur am Anfang, da Lucky Script im javascript-Container läuft, ansonsten ist alles gleich:

                            Lucky Skript: javascript.0.Spotify.Player.Play

                            Adapter: spotify-premium.0.Player.Play

                            Löschen musst du nix, die beiden Sachen sollten sich nicht in die quere kommen. Das aktivieren funktioniert ähnlich wie Luckys Skript und ist in den Adapter Einstellungen beschrieben.

                            1 Reply Last reply
                            0
                            • wendy2702W Online
                              wendy2702W Online
                              wendy2702
                              wrote on last edited by
                              #192

                              Adapter installiert.

                              1. Texte zur Einrichtung teilweise kein "schönes Deutsch"

                              2. Nach erfolgreicher Authorisierung geht "Get_User_Playlist" & "Get_Devices" nicht. Adapter musst erneut gestartet werden. Problem wurde glaube ich hier schon mal erwähnt.

                              3. Weiß nicht warum aber Adapter und Script zeigen unterschiedliche Devices an.

                              Jetzt Views an die neuen Objecte anpassen … :shock:

                              Bitte keine Fragen per PN, die gehören ins Forum!

                              Benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat.

                              1 Reply Last reply
                              0
                              • twonkyT Offline
                                twonkyT Offline
                                twonky
                                wrote on last edited by
                                #193

                                1. okay? Ich hätte das vielleicht nicht spät Abends machen sollen :D Weißt du wie github funktioniert? Ich bin für Pull Request offen ;)

                                2. Das war mir noch nicht bekannt. Lässt sich vlt. automatisieren, ich gucke mal. Alternative wäre, es in der Anleitung zu erwähnen.

                                3. :shock: Sollte eigentlich nicht so sein.

                                1 Reply Last reply
                                0
                                • wendy2702W Online
                                  wendy2702W Online
                                  wendy2702
                                  wrote on last edited by
                                  #194

                                  Kein Thema.

                                  Das mit dem text steht auch im Script so glaube ich. Ist mir eben zum ersten mal aufgefallen und auch nur Kosmetik.

                                  Pull request… noch nie gemacht :oops:

                                  EDIT: habe das mit dem Pull Request mal versucht :D

                                  Bitte keine Fragen per PN, die gehören ins Forum!

                                  Benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat.

                                  1 Reply Last reply
                                  0
                                  • twonkyT Offline
                                    twonkyT Offline
                                    twonky
                                    wrote on last edited by
                                    #195

                                    Danke wendy! Ist jetzt drin :)

                                    1 Reply Last reply
                                    0
                                    • 0 Offline
                                      0 Offline
                                      0018
                                      wrote on last edited by
                                      #196

                                      Hi,

                                      habe den Adapetr installiert. Leider bekomme ich ich bei der Return_URL die Fehlermdlung vom Browser:

                                      "Missing required parameter: client_id"

                                      Obwohl ich die richtige Client ID im Adapter eingetragen habe. Adapterneustart bringt auch keinen Erfolg.

                                      Beim Script hatte ich eigentlich keine Probleme und die Return_Url hat immer gepasst.

                                      Woran kann es liegen?

                                      Hier der Debug-Log dazu:

                                      ! ````
                                      spotify-premium.0 2018-02-15 20:53:46.489 debug keine Token in Serverantwort gefunden !
                                      spotify-premium.0 2018-02-15 20:53:46.488 debug false
                                      spotify-premium.0 2018-02-15 20:53:46.145 debug GetToken
                                      spotify-premium.0 2018-02-15 20:53:46.135 debug call listener Authorization.Authorization_Return_URI
                                      spotify-premium.0 2018-02-15 20:53:46.132 debug stateChange spotify-premium.0.Authorization.Authorization_Return_URI {"val":"https://accounts.spotify.com/de/authorize/?client_id=&response_type=code&redirect_uri=http%3A%2F%2Flocalhost&state=gmUXZsm
                                      spotify-premium.0 2018-02-15 20:53:33.140 debug no listener for Authorization.Authorization_URL found
                                      spotify-premium.0 2018-02-15 20:53:33.137 debug stateChange spotify-premium.0.Authorization.Authorization_URL {"val":"https://accounts.spotify.com/de/authorize/?client_id=&response_type=code&redirect_uri=http%3A%2F%2Flocalhost&state=gmUXZsmRB64W1N
                                      spotify-premium.0 2018-02-15 20:53:27.829 debug call listener Authorization.Authorized
                                      spotify-premium.0 2018-02-15 20:53:27.828 debug stateChange spotify-premium.0.Authorization.Authorized {"val":false,"ack":true,"ts":1518724407814,"q":0,"from":"system.adapter.spotify-premium.0","lc":1518722954877}
                                      spotify-premium.0 2018-02-15 20:53:27.817 debug no listener for Authorization.Authorization_URL found
                                      spotify-premium.0 2018-02-15 20:53:27.816 debug stateChange spotify-premium.0.Authorization.Authorization_URL {"val":"https://accounts.spotify.com/de/authorize/?client_id=&response_type=code&redirect_uri=http%3A%2F%2Flocalhost&state=gmUXZsmRB64W1N
                                      spotify-premium.0 2018-02-15 20:53:27.803 debug no listener for Authorization.State found
                                      spotify-premium.0 2018-02-15 20:53:27.802 debug stateChange spotify-premium.0.Authorization.State {"val":"gmUXZsmRB64W1NdEQj3N","ack":false,"ts":1518724407783,"q":0,"from":"system.adapter.spotify-premium.0","lc":1518724407783}
                                      spotify-premium.0 2018-02-15 20:53:27.789 debug call listener Authorization.Get_Authorization
                                      spotify-premium.0 2018-02-15 20:53:27.778 debug request_authorization
                                      spotify-premium.0 2018-02-15 20:53:27.776 debug stateChange spotify-premium.0.Authorization.Get_Authorization {"val":true,"ack":false,"ts":1518724407761,"q":0,"from":"system.adapter.admin.0","lc":1518723138793}
                                      spotify-premium.0 2018-02-15 20:51:52.502 debug call listener Authorization.Authorized
                                      spotify-premium.0 2018-02-15 20:51:52.499 debug stateChange spotify-premium.0.Authorization.Authorized {"val":false,"ack":true,"ts":1518724312486,"q":0,"from":"system.adapter.spotify-premium.0","lc":1518722954877}
                                      spotify-premium.0 2018-02-15 20:51:52.462 warn no Token set
                                      spotify-premium.0 2018-02-15 20:51:52.361 info starting. Version 0.0.3 in /opt/iobroker/node_modules/iobroker.spotify-premium, node: v6.12.2
                                      spotify-premium.0 2018-02-15 20:51:52.283 debug statesDB connected
                                      spotify-premium.0 2018-02-15 20:51:52.176 debug objectDB connected
                                      spotify-premium.0 2018-02-15 20:49:22.740 info terminating
                                      spotify-premium.0 2018-02-15 20:42:37.638 warn no Token set
                                      spotify-premium.0 2018-02-15 20:42:37.529 info starting. Version 0.0.3 in /opt/iobroker/node_modules/iobroker.spotify-premium, node: v6.12.2
                                      spotify-premium.0 2018-02-15 20:42:32.741 info terminating
                                      spotify-premium.0 2018-02-15 20:39:37.825 warn no Token set
                                      spotify-premium.0 2018-02-15 20:39:37.720 info starting. Version 0.0.3 in /opt/iobroker/node_modules/iobroker.spotify-premium, node: v6.12.2
                                      spotify-premium.0 2018-02-15 20:35:33.463 info terminating
                                      spotify-premium.0 2018-02-15 20:34:08.802 warn no Token set
                                      spotify-premium.0 2018-02-15 20:34:08.709 info starting. Version 0.0.3 in /opt/iobroker/node_modules/iobroker.spotify-premium, node: v6.12.2
                                      spotify-premium.0 2018-02-15 20:34:03.918 info terminating
                                      spotify-premium.0 2018-02-15 20:33:09.703 warn no Token set
                                      spotify-premium.0 2018-02-15 20:33:09.611 info starting. Version 0.0.3 in /opt/iobroker/node_modules/iobroker.spotify-premium, node: v6.12.2
                                      spotify-premium.0 2018-02-15 20:33:00.507 info terminating
                                      spotify-premium.0 2018-02-15 20:31:50.554 warn no Token set
                                      spotify-premium.0 2018-02-15 20:31:50.435 info starting. Version 0.0.3 in /opt/iobroker/node_modules/iobroker.spotify-premium, node: v6.12.2
                                      spotify-premium.0 2018-02-15 20:31:44.855 info terminating

                                      Mfg
                                      0018

                                      1 Reply Last reply
                                      0
                                      • wendy2702W Online
                                        wendy2702W Online
                                        wendy2702
                                        wrote on last edited by
                                        #197

                                        Hm,

                                        Bei mir läuft es bis auf das ich vorhin Probleme hatte die Playlists zu laden.

                                        Das muss ich morgen weiter untersuchen.

                                        Gesendet von iPhone mit Tapatalk Pro

                                        Bitte keine Fragen per PN, die gehören ins Forum!

                                        Benutzt das Voting rechts unten im Beitrag wenn er euch geholfen hat.

                                        1 Reply Last reply
                                        0
                                        • AxelF1977A Offline
                                          AxelF1977A Offline
                                          AxelF1977
                                          wrote on last edited by
                                          #198

                                          Hi, danke für das Script. Ich würde es gerne nutzen. Aber leider habe auch ich den Fehler bei der Return_URL:

                                          "Missing required parameter: client_id"

                                          Ich habe der URL dann meine ID hinzugefügt. Aber die eingetragene spotify-premium.0.Authorization.Authorization_Return_URI bringt keinen Erfolg.

                                          spotify-premium.0.Authorization.Authorized bleibt leider bei false

                                          ASROCK Deskmini Intel I3 8100 16GB mit Proxmox VM ioBroker VM DIYHue| CCU piVCCU + FHEM auf Raspberry | Maria DB mit Grafana und Prometheus auf Tinker Board

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate

                                          650

                                          Online

                                          32.6k

                                          Users

                                          82.3k

                                          Topics

                                          1.3m

                                          Posts
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
                                          ioBroker Community 2014-2025
                                          logo
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Home
                                          • Recent
                                          • Tags
                                          • Unread 0
                                          • Categories
                                          • Unreplied
                                          • Popular
                                          • GitHub
                                          • Docu
                                          • Hilfe