Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Sonos-HTTP-API Installation für Newbies, Dummies und mich

    NEWS

    • ioBroker goes Matter ... Matter Adapter in Stable

    • 15. 05. Wartungsarbeiten am ioBroker Forum

    • Monatsrückblick - April 2025

    Sonos-HTTP-API Installation für Newbies, Dummies und mich

    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      skokarl @figodeluxe last edited by

      @figodeluxe
      einfach per Terminal auf die Linux Kiste.
      Läuft unabhängig vom IOBroker.
      Ob es im Docker läuft, keine Ahnung.

      1 Reply Last reply Reply Quote 0
      • F
        figodeluxe last edited by figodeluxe

        Also Sonos API läuft jetzt auch. Hat von euch jemand das ganze über yahka am laufen? Wie kann ich in yahka sagen das er eine URL ausführen soll das versteh ich noch nicht ganz oder wie führe ich da ein script aus?

        1 Reply Last reply Reply Quote 0
        • B
          bishop last edited by

          meine settings.js sieht so aus

          'use strict';
          const fs = require('fs');
          const path = require('path');
          const logger = require('sonos-discovery/lib/helpers/logger');
          const tryLoadJson = require('./lib/helpers/try-load-json');
          
          function merge(target, source) {
            Object.keys(source).forEach((key) => {
              if ((Object.getPrototypeOf(source[key]) === Object.prototype) && (target[key] !== undefined)) {
                merge(target[key], source[key]);
              } else {
                target[key] = source[key];
              }
            });
          }
          
          var settings = {
            port: 5005,
            ip: "0.0.0.0",
            securePort: 5006,
            cacheDir: path.resolve(__dirname, 'cache'),
            webroot: path.resolve(__dirname, 'static'),
            presetDir: path.resolve(__dirname, 'presets'),
            announceVolume: 40
          };
          
          // load user settings
          const settingsFileFullPath = path.resolve(__dirname, 'settings.json');
          const userSettings = tryLoadJson(settingsFileFullPath);
          merge(settings, userSettings);
          
          logger.debug(settings);
          
          if (!fs.existsSync(settings.webroot + '/tts/')) {
            fs.mkdirSync(settings.webroot + '/tts/');
          }
          
          if (!fs.existsSync(settings.cacheDir)) {
            try {
              fs.mkdirSync(settings.cacheDir);
            } catch (err) {
              logger.warn(`Could not create cache directory ${settings.cacheDir}, please create it manually for all features to work.`);
            }
          }
          module.exports = settings;
          

          wo genau muss ich jetzt ```
          {
          "webhook": "http://localhost:5007/"
          }
          {
          "voicerss": "apikey natürlich der key"
          }

          reinkopieren?
          S 1 Reply Last reply Reply Quote 0
          • S
            skokarl last edited by skokarl

            ACHTUNG DAS UPDATE SONOS S2 MACHT DIE API EVTL. UNBRAUCHBAR

            S2 Update

            1 Reply Last reply Reply Quote 1
            • S
              skokarl @bishop last edited by skokarl

              @bishop sagte in [gelöst] Sonos-HTTP-API Installation für Newbies, Dummies und mich:

              meine settings.js sieht so aus

              wo genau muss ich jetzt ```
              {
              "webhook": "http://localhost:5007/"
              }
              {
              "voicerss": "apikey natürlich der key"
              }
              reinkopieren?

              Das gehört nicht in die settings.js !!, siehe Post 5

              das gehört in die settings.json, die Du anlegen musst sofern Du sie noch nicht hast.

              Anlegen, Key reinkopieren, Webserver neu booten, fertig.

              192.168.xxx.xxx:5005/namebox/say/hallo welt/de-de/
              
              VoiceRSS
              
              This REQUIRES a registered API key from voiceRSS! See http://www.voicerss.org/ for info.
              
              You need to add this to a file called settings.json (create if it doesn't exist), like this:
              
              {
                "voicerss": "f5e77e1d42063175b9219866129189a3"
              }
              
              Replace the code above (it is just made up) with the api-key you've got after registering.
              
              1 Reply Last reply Reply Quote 0
              • H
                HoffmannOs @skokarl last edited by

                @skokarl said in Sonos-HTTP-API Installation für Newbies, Dummies und mich:

                Amazon PollyAWS

                Den VoiceRss habe ich ans laufen bekommen, wie könnte ich denn nun die Amazon Polly nutzen?

                1 Reply Last reply Reply Quote 0
                • L
                  LJSven last edited by

                  @skokarl Gibt es irgendwo ein "How-To" - wie ich mit Say umgehen soll? Ich habe zwar VoiceRSS ans laufen bekommen, allerdings macht er bei mir immer "English mit Deutsch vermischt." Gibt es Erfahrungwerte, was an kosten bei AWS auf einen zukommen?

                  S 2 Replies Last reply Reply Quote 0
                  • S
                    skokarl @LJSven last edited by skokarl

                    textfehler

                    1 Reply Last reply Reply Quote 0
                    • S
                      skokarl @LJSven last edited by

                      @LJSven sagte in Sonos-HTTP-API Installation für Newbies, Dummies und mich:

                      @skokarl Gibt es irgendwo ein "How-To" - wie ich mit Say umgehen soll? Ich habe zwar VoiceRSS ans laufen bekommen, allerdings macht er bei mir immer "English mit Deutsch vermischt."

                      Action is:
                      
                      /[Room name]/say/[phrase][/[language_code]][/[announce volume]]
                      /sayall/[phrase][/[language_code]][/[announce volume]]
                      
                      Example:
                      
                      /Office/say/Hello, dinner is ready
                      /Office/say/Hej, maten är klar/sv-se
                      /sayall/Hello, dinner is ready
                      /Office/say/Hello, dinner is ready/90
                      /Office/say/Hej, maten är klar/sv-se/90
                      
                      language code needs to be before volume if specified.
                      
                      Sayall will group all players, set 40% volume (by default) and then try and restore everything as the way it where. Please try it out, it will probably contain glitches but please report detailed descriptions on what the problem is (starting state, error that occurs, and the final state of your system).
                      
                      The supported language codes are:
                      Language code 	Language
                      ca-es 	Catalan
                      zh-cn 	Chinese (China)
                      zh-hk 	Chinese (Hong Kong)
                      zh-tw 	Chinese (Taiwan)
                      da-dk 	Danish
                      nl-nl 	Dutch
                      en-au 	English (Australia)
                      en-ca 	English (Canada)
                      en-gb 	English (Great Britain)
                      en-in 	English (India)
                      en-us 	English (United States)
                      fi-fi 	Finnish
                      fr-ca 	French (Canada)
                      fr-fr 	French (France)
                      de-de 	German
                      it-it 	Italian
                      ja-jp 	Japanese
                      ko-kr 	Korean
                      nb-no 	Norwegian
                      pl-pl 	Polish
                      pt-br 	Portuguese (Brazil)
                      pt-pt 	Portuguese (Portugal)
                      ru-ru 	Russian
                      es-mx 	Spanish (Mexico)
                      es-es 	Spanish (Spain)
                      sv-se 	Swedish (Sweden)
                      
                      L 1 Reply Last reply Reply Quote 0
                      • L
                        LJSven @skokarl last edited by

                        @skokarl Wie mache ich das denn mit Blockly?

                        S FredF 2 Replies Last reply Reply Quote 0
                        • S
                          skokarl @LJSven last edited by

                          @LJSven sagte in Sonos-HTTP-API Installation für Newbies, Dummies und mich:

                          @skokarl Wie mache ich das denn mit Blockly?

                          antworte heute abend wenn bis dahin keiner geantwortet hat

                          1 Reply Last reply Reply Quote 0
                          • FredF
                            FredF Most Active Forum Testing @LJSven last edited by

                            @LJSven
                            Schau mal Link Text, Homoran hat da was als Vorlage gemacht

                            1 Reply Last reply Reply Quote 0
                            • M
                              Marty56 last edited by Marty56

                              Mittlerweile hat Bluefox wohl etwas an dem Sonos Adapter (V2.0.1) verbessert, so dass man jetzt mit einem Workaround auf die Installation des Sonos-HTTP-API Servers verzichten kann.

                              Ist aber immer noch ein Frickelei. Wer dazu keine Lust hat, kann hoffen, dass Bluefox noch etwas weitermacht und den Sonos Adapter komplett fixt.

                              Bitte beachten, dass Script funktioniert nur, wenn man die entsprechenden Voraussetzungen (siehe Kommentare im Script) erfüllt hat.

                              const fs = require('fs');
                              
                              // Die sayit.2 Instanz ist auf Browser eingestellt und erzeugt unter 
                              // /opt/iobroker/node_modules/iobroker.sayit das File sayit.2.say.mp3
                              
                              setState("sayit.2.tts.text","Hallo Test");
                              
                              // Das Verzeichnis /opt/iobroker/sonostrick muss erzeugt werden und 
                              // auf ein SMB1 zugängliches Share gemountet sein
                              // In meinem Fall ist das ein Share auf einer Fritzbox 
                              // In der Sonos App wird dieses Verzeichnis als Musikbibliothek eingebunden.
                              // Leider unterstützt Sonos nur SMB1.
                              // Außerdem muss in der Sonos App ein Favorit definiert werden mit dem Namen "say",
                              // der das File "sayit.mp3" abspielt.
                              
                              // Das von sayit2 erzeugte mp3 File wird auf das gemountete Verzeichnis,
                              // in meinem Fall auf das Share auf der Fritzbox, kopiert
                              
                              setTimeout(function() {
                                  fs.copyFile('/opt/iobroker/node_modules/iobroker.sayit/sayit.2.say.mp3', '/opt/iobroker/sonostrick/sayit.mp3', (err) => {
                                      if (err) throw err;
                                  });
                              },2500);
                              
                              // Nachdem Kopieren wird der Favorit "say" 
                              // auf der Sonos abgespielt
                              
                              setTimeout(function() {
                                  setState("sonos.0.root.192_168_10_32.favorites_set","say");
                              },3000);
                              
                              
                              S 1 Reply Last reply Reply Quote 0
                              • S
                                skokarl @Marty56 last edited by skokarl

                                @Marty56 sagte in Sonos-HTTP-API Installation für Newbies, Dummies und mich:

                                Mittlerweile hat Bluefox wohl etwas an dem Sonos Adapter (V2.0.1) verbessert, so dass man jetzt mit einem Workaround auf die Installation des Sonos-HTTP-API Servers verzichten kann.

                                Moin,
                                das ist doch schon etwas älter, oder ?

                                Nicht dass wir uns falsch verstehen, wenn der Adapter wieder gepflegt würde wäre das super.

                                1.PNG

                                1 Reply Last reply Reply Quote 0
                                • M
                                  Marty56 last edited by

                                  Das stimmt. Ich habe es aber erst jetzt ausprobiert.

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    skokarl last edited by skokarl

                                    Update auf S2 wird ausgerollt

                                    Github, scheint weiterhin zu funktionieren

                                    M 1 Reply Last reply Reply Quote 0
                                    • M
                                      Marty56 @skokarl last edited by

                                      Der Entwickler des HTTP API warnt davor, dass diese Version nicht mehr kompatibel ist, gibt es da schon Erfahrungen?

                                      Und außerdem hat die S2 Version immer noch das Schei... SMB 1 Protokoll!

                                      Sonos bekommt es einfach nicht gebacken.
                                      Ich werde diese Version nicht einspielen, so lange ich das verhindern kann.

                                      S 1 Reply Last reply Reply Quote 0
                                      • S
                                        skokarl @Marty56 last edited by

                                        @Marty56 sagte in Sonos-HTTP-API Installation für Newbies, Dummies und mich:

                                        Der Entwickler des HTTP API warnt davor, dass diese Version nicht mehr kompatibel ist, gibt es da schon Erfahrungen?

                                        siehe meinen Beitrag davor, scheint noch zu funktionieren

                                        M 1 Reply Last reply Reply Quote 0
                                        • M
                                          Marty56 @skokarl last edited by

                                          @skokarl Danke. Hatte ich nicht angeklickt.

                                          S 1 Reply Last reply Reply Quote 0
                                          • S
                                            skokarl @Marty56 last edited by

                                            @Marty56 sagte in Sonos-HTTP-API Installation für Newbies, Dummies und mich:

                                            @skokarl Danke. Hatte ich nicht angeklickt.

                                            sag Bescheid wenn Du es getestet hast 😬

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate
                                            FAQ Cloud / IOT
                                            HowTo: Node.js-Update
                                            HowTo: Backup/Restore
                                            Downloads
                                            BLOG

                                            847
                                            Online

                                            31.6k
                                            Users

                                            79.5k
                                            Topics

                                            1.3m
                                            Posts

                                            sonos
                                            49
                                            437
                                            86459
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo