br_sonos

Hallo zusammen,

erstmal danke Dir schonmal im Vorfeld für dein Script !

Ich habe jedoch auch ein Problem beim installieren.
Der Player wird gefunden…


Found following SONOS devices via search for SONOS_IP ...
Array
(
    [IP] => 192.168.2.61
    [CurrentZoneName] => Wohnküche
    [CurrentIcon] => x-rincon-roomicon:dining
    [SerialNumber] => 00-0A-58-5C-C4-08:A
    [SoftwareVersion] => 21.4-61160c
    [DisplaySoftwareVersion] => 4.0
    [HardwareVersion] => 1.16.4.1-2
    [IPAddress] => 192.168.2.61
    [MACAddress] => 00:0A:58:5C:C4:08
    [CopyrightInfo] => © 2004-2007 Sonos, Inc. All Rights Reserved.
    [ExtraInfo] => OTP: 1.1.1(1-16-4-zp5s-0.5)
    [Rincon] => RINCON_000A585CC40801400
    [ID] => RINCON_000A585CC40801400
    [IPSId] => 47560
)

Aber beim vorletzten Schritt bekomme ich Probleme: Inhalt von br_sonos_zonesetup-template.php erzeugen und ausführen.

br_sonos_zonesetup (ScriptID: 39970):
- ... checking ... for need of running Sonos setup routines....
====== Zonesetup for Sonos 30454 is ongoing ...
ATTENTION: If >>>Wohnküche <<< is not the name of your SONOS device you either didn´t fill or create SONOS_IP,
yet or there is general problem!

Please fill or correct SONOS_IP, delete all Variables and Scripts except SONOS_IP und the SETUP, then RE-RUN this script!!!


If your correct zonename showed up above you everything is ok!!

Wie man sieht wird nichts angelegt… :confused:

Jemand ne Idee ?

Tach zusammen,

nachdem ich ja einen neuen Server aufgesetzt habe und mir Dummerweise sämtliche IPS Backups gelöscht habe, habe ich das selbe Problem. Bekomme diese Fehlermeldungen in der br_sonos_read

br_sonos_read: NOTICE Execution of zonesetup in this category is needed!

Warning:  Variable #0 existiert nicht in E:\IP-Symcon\IP-Symcon\scripts\br_sonos.inc.php on line 266

Warning:  Variable #0 existiert nicht in E:\IP-Symcon\IP-Symcon\scripts\br_sonos.inc.php on line 273

Warning:  Variable #0 existiert nicht in E:\IP-Symcon\IP-Symcon\scripts\br_sonos.inc.php on line 274

Warning:  Variable #0 existiert nicht in E:\IP-Symcon\IP-Symcon\scripts\br_sonos.inc.php on line 278

Warning:  Variable #0 existiert nicht in E:\IP-Symcon\IP-Symcon\scripts\br_sonos.inc.php on line 279

Warning:  Variable #0 existiert nicht in E:\IP-Symcon\IP-Symcon\scripts\br_sonos.inc.php on line 280

Warning:  Variable #0 existiert nicht in E:\IP-Symcon\IP-Symcon\scripts\br_sonos.inc.php on line 281

Warning:  Variable #0 existiert nicht in E:\IP-Symcon\IP-Symcon\scripts\br_sonos.inc.php on line 282

Warning:  Variable #0 existiert nicht in E:\IP-Symcon\IP-Symcon\scripts\br_sonos.inc.php on line 288

Warning:  Variable #0 existiert nicht in E:\IP-Symcon\IP-Symcon\scripts\br_sonos.inc.php on line 289
Abort Processing during exceed of maximal ErrorCount: Variable #0 existiert nicht
   Error in Script E:\IP-Symcon\IP-Symcon\scripts\br_sonos.inc.php on Line 334

Könnt ihr uns helfen?

Sooo…hab den Fehler ausgemerzt…siehe Beitrag 126 :slight_smile:

Hallo zusammen,
erst mal Danke für die Scripte und die bisherige Fehlerbehebung.
Nach einigen Fehlern und einigem lesen hab ichs so weit geschafft wie thezepter in Post 181.
Gibt’s dafür auch eine Lösung die ich evtl überlesen habe?

PS: Habs gefunden, hatte die Lösung in #126 versucht, aber die Originalzeilen nicht auskommentiert. Jetzt wurden die ganzen Variablen angelegt und werden auch gefüllt. Auch die Aktionen aus dem WF werden in den Variablen geändert. Aber mein Sonos regaiert nicht. Werd mal weiterlesen.

hi Wolfgang,

hast Du das schon umgesetzt?

Wow Danke ! Das hat mir nun auch weitergeholfen und alles wurde korrekt angelegt… nun erstmal testen. :smiley:
Müsste ein einfaches „Play“ im Browser dann nicht meine letzte Radiostation abspielen ? passiert nichts und springt nach ein paar sec. wieder auf STOP im Browser. Selbe Problem wie beim Wolfgang.

@TheFurious: Joo die Änderungen haben wir ab Zeile 100 schon durchgeführt. Dadurch wurden jetzt auch alle Variablen angelegt, aber der Sonos reagiert nicht auf die Variablenänderungen…
Volume und aktueller Radiosender werden korrekt ausgelesen und in die Variablen geschrieben.

EDIT:
Einfach gesagt… ich kann nur Werte lesen aber keine Werte zum Sonos übergeben. Wenn ich mit meinem Iphone den Sonos steure sehe ich alle Veränderungen auch in den Variablen und im Webfront.

Hallo TheFurious,
ja, hab ich wie im Nachtrag mit dem Verweis auf #126 umgesetzt. Bin jetzt so weit wie thezepter in seinem letzten Post beschrieben hat.
Weitere Hilfe dazu?

Hmm…Bei mir funktioniert das abspielen einer „Juke“ Playlist ohne Probleme. Lediglich wenn meine Holde mit ihrem iPhone und Airplay drin rumfurhwerkt gibt es Stress. Ich muss aber auch ehrlich zugeben, dass meine Priorität nicht beim kompletten steuern des Sonos System liegt, sondern eher darin, dass Sonos für Durchsagen und Alarm zu nutzen.

Hallo TheFurious,

danke für die schnelle Antwort.

@all,
kann sonst jemand weitere Tipps geben wir wir unseren Sonos nicht nur anschauen sondern auch steuern können?
Habe noch 2 Scripts die auf Fehler laufen:

br_sonos_update.php: Scriptausgabe:

IPS-Trc-functions 2013-04-18 21:48:06.203 == Line 41 == loaded br_ips V.1.5.7 - PRE March for SONOS and Logger #PRE!!!NORELEASEandDISTRIBUTION (20110329)

IPS-Err-PHP 2013-04-18 21:48:06.239 Notice: Undefined variable: IPS_VARIABLE Error in Script D:\IPS\scripts\br_sonos_update.php on Line 5 133 in IPSLibrary\app\core\IPSLogger\IPSLogger.inc.php (call IPSLogger_Out) 44 in IPSLibrary\app\core\IPSLogger\IPSLogger_PhpErrorHandler.inc.php (call IPSLogger_Err) 5 in br_sonos_update.php (call IPSLogger_PhpErrorHandler)

Notice: Undefined variable: IPS_VARIABLE in D:\IPS\scripts\br_sonos_update.php on line 5
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.288 == Line 70 == br_objGetVar: Var SONOS_IP not found under 0 !;
IPS-Err-PHP 2013-04-18 21:48:06.293 Warning: Wrong parameter type for IPS_GetObject() Error in Script D:\IPS\scripts\br_obj_handling.inc.php on Line 113 133 in IPSLibrary\app\core\IPSLogger\IPSLogger.inc.php (call IPSLogger_Out) 37 in IPSLibrary\app\core\IPSLogger\IPSLogger_PhpErrorHandler.inc.php (call IPSLogger_Err) in IPSLogger_PhpErrorHandler 113 in br_obj_handling.inc.php (call IPS_GetObject) 16 in br_sonos_update.php (call br_objParent)

Warning: Wrong parameter type for IPS_GetObject() in D:\IPS\scripts\br_obj_handling.inc.php on line 113
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.295 == Line 48 == br_objGetVarID: Var Volume not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.296 == Line 48 == br_objGetVarID: Var Mute not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.298 == Line 48 == br_objGetVarID: Var Shuffle not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.299 == Line 48 == br_objGetVarID: Var Repeat not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.300 == Line 48 == br_objGetVarID: Var Control not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.302 == Line 48 == br_objGetVarID: Var Status not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.303 == Line 48 == br_objGetVarID: Var Position not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.304 == Line 48 == br_objGetVarID: Var Duration not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.306 == Line 48 == br_objGetVarID: Var Artist not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.307 == Line 48 == br_objGetVarID: Var Title not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.309 == Line 48 == br_objGetVarID: Var Album not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.310 == Line 48 == br_objGetVarID: Var AlbumArtist not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.312 == Line 48 == br_objGetVarID: Var AlbumTrackNum not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.314 == Line 48 == br_objGetVarID: Var CoverURI not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.316 == Line 48 == br_objGetVarID: Var Info not found under 0 !;
IPS-Trc-br_obj_handling 2013-04-18 21:48:06.317 == Line 70 == br_objGetVar: Var SONOS_IP not found under 0 !;
IPS-Err-PHP 2013-04-18 21:48:12.589 Warning: fsockopen(): unable to connect to :1400 (Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte. ) Error in Script D:\IPS\scripts\PHPSonos.inc.php on Line 2217 133 in IPSLibrary\app\core\IPSLogger\IPSLogger.inc.php (call IPSLogger_Out) 37 in IPSLibrary\app\core\IPSLogger\IPSLogger_PhpErrorHandler.inc.php (call IPSLogger_Err) in IPSLogger_PhpErrorHandler 2217 in PHPSonos.inc.php (call fsockopen) 339 in PHPSonos.inc.php (call XMLsendPacket) 48 in br_sonos_update.php (call GetZoneAttributes)

Warning: fsockopen(): unable to connect to :1400 (Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte.
) in D:\IPS\scripts\PHPSonos.inc.php on line 2217

Fatal error: Uncaught exception ‚Exception‘ with message ‚Error opening socket: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte.
(10061)‘ in D:\IPS\scripts\PHPSonos.inc.php:2219
Stack trace:
#0 D:\IPS\scripts\PHPSonos.inc.php(339): PHPSonos->XMLsendPacket(‚POST /DevicePro…‘)
#1 D:\IPS\scripts\br_sonos_update.php(48): PHPSonos->GetZoneAttributes()
#2 {main}
thrown in D:\IPS\scripts\PHPSonos.inc.php on line 2219
IPS-Err-PHP 2013-04-18 21:48:12.592 Error: Uncaught exception ‚Exception‘ with message ‚Error opening socket: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte. (10061)‘ in D:\IPS\scripts\PHPSonos.inc.php:2219 Stack trace: #0 D:\IPS\scripts\PHPSonos.inc.php(339): PHPSonos->XMLsendPacket(‚POST /DevicePro…‘) #1 D:\IPS\scripts\br_sonos_update.php(48): PHPSonos->GetZoneAttributes() #2 {main} thrown Error in Script D:\IPS\scripts\PHPSonos.inc.php on Line 2219 133 in IPSLibrary\app\core\IPSLogger\IPSLogger.inc.php (call IPSLogger_Out) 33 in IPSLibrary\app\core\IPSLogger\IPSLogger_PhpErrorHandler.inc.php (call IPSLogger_Err) 120 in IPSLibrary\app\core\IPSLogger\IPSLogger_PhpErrorHandler.inc.php (call IPSLogger_PhpErrorHandler) in IPSLogger_PhpFatalErrorHandler
Abort Processing during Fatal-Error: Uncaught exception ‚Exception‘ with message ‚Error opening socket: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte.
(10061)‘ in D:\IPS\scripts\PHPSonos.inc.php:2219
Stack trace:
#0 D:\IPS\scripts\PHPSonos.inc.php(339): PHPSonos->XMLsendPacket(‚POST /DevicePro…‘)
#1 D:\IPS\scripts\br_sonos_update.php(48): PHPSonos->GetZoneAttributes()
#2 {main}
thrown
Error in Script D:\IPS\scripts\PHPSonos.inc.php on Line 2219

Eine Ausgabe des Loggers im Anhang.

und

br_sonos_zonesetup.php: Scriptausgabe:

IPS-Trc-functions            2013-04-18 21:57:00.171      == Line 41 == loaded br_ips V.1.5.7 - PRE March for SONOS and Logger #PRE!!!NORELEASEandDISTRIBUTION (20110329)

br_sonos_zonesetup (ScriptID: 53934):
IPS-Inf-br_sonos_zonesetup 2013-04-18 21:57:00.183 == Line 29 == ====== Zonesetup for 56395 is ongoing …

  • … checking … for need of running Sonos setup routines…
    … Repeat is found: Nothing to do! - You did a setup in past (and I skipped it now!).
    If you are unsure watch your ZonePlayer while starting this skript again! - it should switch OFF and ON it´s white LED if everything is correct!

LED (status before):

Executing SetLEDState(true)
LED: 1

Executing IPS_Sleep(2000) - look at your SONOS device!

Executing SetLEDState(false)
LED:

Executing IPS_Sleep(2000) - look at your SONOS device!

Executing SetLEDState(true)
LED: 1

If your LED did not switch on and off please review the settings!

NOTICE: I hided this script in webfront. If you need it in webfront for testing purposes, please unhide it and / or comment out this lines in the script!!

ATTENTION: If this an update and you did not yet ran br_sonos_setup - EXECUTE it now!

Keine Fehler im Logger.

Hoffe es hilft bei der Fehlerbehebung.

Habt ihr auch ein Script mit dem Namen IPSLogger.ips.php und folgendem Inhalt angelegt?

 
<?

IPSUtils_Include ('IPSLogger.inc.php',      'IPSLibrary::app::core::IPSLogger');  

?>
 

und in den IPS Scriptordner gepackt?

Hallo TheFurious

jetzt ja, aber meines Wissens musste es bei mir unter C:/php/pear
den Fehler hatte ich schon ganz am Anfang beseitigt… ohne die Datei ging ja gar nichts.
In den IPS Script Ordner auch noch mal angelegt… aber das ändert nichts.
Weiterhin nur lesen der Sonos Variablen möglich

hallo,
so do i

Hallo zusammen,

gibts nichts neues? im Post #189 in der Scriptausgabe steht, dass die Variable SONOS_IP nicht gefunden wird. Ich hab den Verdacht, dass es daran liegt. Sicher hat schon jemand eine Lösung dafür die er/sie gerne hier mitteilt oder auf einen helfenden Post verlinkt.
Danke im Voraus für die zahlreichen Antworten.

Hallo,

ich versuche mich auch gerade an diesem tollen Script. Habe auch den ganzen Thread durchgelesen … schwitz … aber für mein(e) Problem(e) keine Lösung(en) gefunden. Als erstes bekomme ich beim Installieren der Zonen folgenden Output:

 

br_sonos_zonesetup (ScriptID: 53309):
- ... checking ... for need of running Sonos setup routines....
====== Zonesetup for Sonos 54554 is ongoing ...
ATTENTION: If >>>Wohnen 
Warning:  Profil mit Namen "SWITCH" existiert nicht in C:\IP-Symcon\scripts\br_sonos_zonesetup.php on line 204

Warning:  Profil mit Namen "SWITCH" existiert nicht in C:\IP-Symcon\scripts\br_sonos_zonesetup.php on line 216

Warning:  Profil mit Namen "SWITCH" existiert nicht in C:\IP-Symcon\scripts\br_sonos_zonesetup.php on line 227
===== Finished! If you are unsure watch your ZonePlayer while starting this skript again! - it should switch OFF and ON it´s white LED if everything is correct!

 LED (status before): 1

Executing SetLEDState(true)
 LED: 1

Executing IPS_Sleep(2000) - look at your SONOS device!

Executing SetLEDState(false)
 LED: 

Executing IPS_Sleep(2000) - look at your SONOS device!

Executing SetLEDState(true)
 LED: 1


 If your LED did not switch on and off please review the settings!


NOTICE: I hided this script in webfront. If you need it in webfront for testing purposes, please unhide it and / or comment out this lines in the script!!


ATTENTION: If this an update and you did not yet ran br_sonos_setup - EXECUTE it now!


Es erscheint eine Warnung, dass das Profil " SWITCH " nicht existiert. Das ist auch so.

Wie ist das Profil anzulegen ???

Gruß Proxima

Hallo Proxima,

ich glaube, das kannst du ignorieren.
Im Script wird das Profil ~Switch und anschließend SWITCH zugewiesen. ~Switch ist auf jeden Fall vorhanden.

Gruß, Peter

Hallo,

habe mich heute nochmals mit dem Script beschäftigt und erhalte beim Drücken auf PLAY jedesmal folgende Fehlermeldung:

Was mache ich falsch???

Auch das Hinzufügen eines SONOS-Connect zu einem PLAY3 mit + funktioniert nicht.

Gruß Proxima

Hallo,

das hinzufügen habe ich mittlerweile hinbekommen. Weiter oben schrieb jemand von einem Fehler in der …cmd… Datei.Nach der beschriebenen Korrektur funktioniert nun das Gruppieren.

Den anderen Fehler beim Drücken von PLAY habe ich aber weiterhin. Jemand eine Idee ???

Gruß Proxima

Hallo,

kann mir jemand bei dem Problem helfen ???

Gruß Proxima

Hallo,

niemand eine Idee ???

Gruß Proxima

Hallo,

der Fehler ist laut Error-Log in Zeile 2264 (throw new Exception … ).

/**
 * sendPacket - communicate with the device
 *
 * - <b>NOTE:</b> This function does send of a soap query and may filter xml answers
 * - <b>Returns:</b> Answer
 *
 * @return Array
 */

    private function sendPacket( $content )
    {
        $fp = fsockopen($this->address, 1400 /* Port */, $errno, $errstr, 10);
        if (!$fp)
            throw new Exception("Error opening socket: ".$errstr." (".$errno.")");

        fputs ($fp, $content);
        $ret = "";
        while (!feof($fp)) {
            $ret.= fgetss($fp,128); // filters xml answer
        }
        fclose($fp);

        if(strpos($ret, "200 OK") === false)
       throw new Exception("Error sending command: ".$ret);

            //echo "sendPacketDebug: "; //DEBUG
            //print_r($ret);
        
        $array = preg_split("/
/", $ret);

        return $array[count($array) - 1];
    }

}

?>

Ach ja, wenn ich ein abspielendes Sonos STOPPE erhalte ich die Fehlermeldung nicht !!!

Gruß Proxima