Multiroom Audio mit HomeMatic und Sony
Moderator: Co-Administratoren
Re: Multiroom Audio mit HomeMatic und Sony
Hallo Monty,
danke für die Hilfe, hat soweit alles gut geklappt
Ich habe nun auch noch den letzten NS510 im Mediamarkt für 150 € bekommen.
Nun läuft ein NS310, ein NS410 und der neue NS510 seit gut einer Woche stabil.
Ein kleines Weckprogramm auf der CCU startet täglich die "Gute Morgen Musik" auf allen drei "Lampenschirmen".
Durch die Bedienung über Mediola läst sich alles auch gut bedienen.
Schön wäre jetzt noch ein Skript für die Statusabfrage (Play, Stop, Volume, Mute, Sender, Partymodus) der LS.
Im Device Spy habe ich ja schon einiges entdeckt, es fehlt nur noch ein Skript zur Abfrage.
Du hast doch bestimmt auch hierfür eine Lösung/Skript
Gruß tbu
danke für die Hilfe, hat soweit alles gut geklappt
Ich habe nun auch noch den letzten NS510 im Mediamarkt für 150 € bekommen.
Nun läuft ein NS310, ein NS410 und der neue NS510 seit gut einer Woche stabil.
Ein kleines Weckprogramm auf der CCU startet täglich die "Gute Morgen Musik" auf allen drei "Lampenschirmen".
Durch die Bedienung über Mediola läst sich alles auch gut bedienen.
Schön wäre jetzt noch ein Skript für die Statusabfrage (Play, Stop, Volume, Mute, Sender, Partymodus) der LS.
Im Device Spy habe ich ja schon einiges entdeckt, es fehlt nur noch ein Skript zur Abfrage.
Du hast doch bestimmt auch hierfür eine Lösung/Skript
Gruß tbu
Re: Multiroom Audio mit HomeMatic und Sony
Hallo tbu,
im party_streaming.tcl ist ja schon die abfrage der ID enthalten das brauchst du für den Rest nur anpassen
Beispiel: für Play "PLAYING", Stop "NO_MEDIA_PRESENT" und Pause "PAUSED_PLAYBACK"
Beispiel: Volume
[EDIT] Anpassung der letzten zwei Scripte
im party_streaming.tcl ist ja schon die abfrage der ID enthalten das brauchst du für den Rest nur anpassen
Code: Alles auswählen
#!/usr/bin/tclsh
set address "192.168.1.20"
set port "8080"
set contentGetState "POST /Party_Control HTTP/1.1\n"
append contentGetState "HOST: $address:$port\n"
append contentGetState "SOAPACTION: \"urn:schemas-sony-com:service:Party:1#X_GetState\"\n"
append contentGetState "CONTENT-TYPE: text/xml; charset=\"utf-8\"\n"
append contentGetState "Content-Length: 298\n"
append contentGetState "CONNECTION: close\n"
append contentGetState "\n"
append contentGetState "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
append contentGetState "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
append contentGetState "<s:Body>"
append contentGetState "<u:X_GetState xmlns:u=\"urn:schemas-sony-com:service:Party:1\"></u:X_GetState>"
append contentGetState "</s:Body>"
append contentGetState "</s:Envelope>"
set chan [socket $address $port]
puts $chan $contentGetState
flush $chan
while {[gets $chan line] >= 0} {
set input [gets $chan]
regexp "<SessionID>(.*?)</SessionID>" $input dummy singerSessionID
}
close $chan
puts $singerSessionID
Code: Alles auswählen
#!/usr/bin/tclsh
set address "192.168.1.20"
set port "8080"
set getState ""
set adresslength [string length $address]
set contentGetState "POST /AVTransport/ctrl HTTP/1.1\n"
append contentGetState "HOST: $address:$port\n"
append contentGetState "SOAPACTION: \"urn:schemas-upnp-org:service:AVTransport:1#GetTransportInfo\"\n"
append contentGetState "CONTENT-TYPE: text/xml; charset=\"utf-8\"\n"
append contentGetState "Content-Length: [expr $adresslength+338]\n"
append contentGetState "CONNECTION: close\n"
append contentGetState "\n"
append contentGetState "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
append contentGetState "<s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">"
append contentGetState "<s:Body>"
append contentGetState "<u:GetTransportInfo xmlns:u=\"urn:schemas-upnp-org:service:AVTransport:1\">"
append contentGetState "<InstanceID>0</InstanceID>"
append contentGetState "</u:GetTransportInfo>"
append contentGetState "</s:Body>"
append contentGetState "</s:Envelope>"
set chan [socket $address $port]
puts $chan $contentGetState
flush $chan
puts "[gets $chan]"
while {[gets $chan line] >= 0} {
set input [gets $chan]
regexp "<CurrentTransportState>(.*?)</CurrentTransportState>" $input dummy getState
}
close $chan
puts $getState
Code: Alles auswählen
#!/usr/bin/tclsh
set address "192.168.1.20"
set port "8080"
set getValue ""
set adresslength [string length $address]
set contentGetState "POST /RenderingControl/ctrl HTTP/1.1\n"
append contentGetState "HOST: $address:$port\n"
append contentGetState "SOAPACTION: \"urn:schemas-upnp-org:service:RenderingControl:1#GetVolume\"\n"
append contentGetState "CONTENT-TYPE: text/xml; charset=\"utf-8\"\n"
append contentGetState "Content-Length: [expr $adresslength+365]\n"
append contentGetState "CONNECTION: close\n"
append contentGetState "\n"
append contentGetState "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
append contentGetState "<s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">"
append contentGetState "<s:Body>"
append contentGetState "<u:GetVolume xmlns:u=\"urn:schemas-upnp-org:service:RenderingControl:1\">"
append contentGetState "<InstanceID>0</InstanceID>"
append contentGetState "<Channel>Master</Channel>"
append contentGetState "</u:GetVolume>"
append contentGetState "</s:Body>"
append contentGetState "</s:Envelope>"
set chan [socket $address $port]
puts $chan $contentGetState
flush $chan
puts "[gets $chan]"
while {[gets $chan line] >= 0} {
set input [gets $chan]
regexp "<CurrentVolume>(.*?)</CurrentVolume>" $input dummy getValue
}
close $chan
puts $getValue
Zuletzt geändert von Monty1979 am 01.09.2013, 10:59, insgesamt 1-mal geändert.
Re: Multiroom Audio mit HomeMatic und Sony
Hallo Monty,
ich habe beide Beispiele getestet (IP-Adresse angepast) und komme nicht weiter.
Hier die Ausgaben Im WinSCP-Terminal:
__________________________
/usr/local/addons/sony_upnp$ tclsh Beispiel_PlayPLAYING_StopNO_MEDIA_PRESENTundPausePAUSED_PLAYBACK.tcl
CONTENT-LENGTH: 480
X-AV-Server-Info: av="5.0"; cn="Sony Corporation"; mn="SA-NS310"; mv="1.00"
EXT:
<s:Envelope
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<u:GetTransportInfoResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<CurrentTransportStatus>OK</CurrentTransportStatus>
</u:GetTransportInfoResponse>
</s:Envelope>
OK
__________________________
/usr/local/addons/sony_upnp$ tclsh beispiel_volume.tcl
CONTENT-LENGTH: 359
X-AV-Server-Info: av="5.0"; cn="Sony Corporation"; mn="SA-NS310"; mv="1.00"
EXT:
<s:Envelope
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<u:GetVolumeResponse xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1">
</u:GetVolumeResponse>
</s:Envelope>
can't read "getValue": no such variable
while executing
"puts $getValue"
(file "beispiel_volume.tcl" line 35)
__________________________
Was ist hier noch falsch ?
Gruß tbu
ich habe beide Beispiele getestet (IP-Adresse angepast) und komme nicht weiter.
Hier die Ausgaben Im WinSCP-Terminal:
__________________________
/usr/local/addons/sony_upnp$ tclsh Beispiel_PlayPLAYING_StopNO_MEDIA_PRESENTundPausePAUSED_PLAYBACK.tcl
CONTENT-LENGTH: 480
X-AV-Server-Info: av="5.0"; cn="Sony Corporation"; mn="SA-NS310"; mv="1.00"
EXT:
<s:Envelope
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<u:GetTransportInfoResponse xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<CurrentTransportStatus>OK</CurrentTransportStatus>
</u:GetTransportInfoResponse>
</s:Envelope>
OK
__________________________
/usr/local/addons/sony_upnp$ tclsh beispiel_volume.tcl
CONTENT-LENGTH: 359
X-AV-Server-Info: av="5.0"; cn="Sony Corporation"; mn="SA-NS310"; mv="1.00"
EXT:
<s:Envelope
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<u:GetVolumeResponse xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1">
</u:GetVolumeResponse>
</s:Envelope>
can't read "getValue": no such variable
while executing
"puts $getValue"
(file "beispiel_volume.tcl" line 35)
__________________________
Was ist hier noch falsch ?
Gruß tbu
Re: Multiroom Audio mit HomeMatic und Sony
Hallo tbu,
ich habe die letzten zwei scripte nochmal angepasst.
Allerdings bin ich mehr am rätseln wie es richtig ist. Jetzt musste ich ein extra puts "[gets $chan]" (sonst wird das zurückgeben XML nicht richtig verarbeitet) und zusätzlich eine Initialisierung "set getState"der Ausgabe Variablen (falls der Wert nicht zurückkommt) einbauen.
ich habe die letzten zwei scripte nochmal angepasst.
Allerdings bin ich mehr am rätseln wie es richtig ist. Jetzt musste ich ein extra puts "[gets $chan]" (sonst wird das zurückgeben XML nicht richtig verarbeitet) und zusätzlich eine Initialisierung "set getState"der Ausgabe Variablen (falls der Wert nicht zurückkommt) einbauen.
Re: Multiroom Audio mit HomeMatic und Sony
Hallo Monty,
ja, das funktioniert
Wie kommen die Werte jetzt wieder zurück in die HM-Variablen
Gefunden und getestet habe ich schon:
- läuft auch ohne Fehler durch, aber in der HM-Variablen 'SonyVolumeKi' landet nichts
Gruß tbu
ja, das funktioniert
Wie kommen die Werte jetzt wieder zurück in die HM-Variablen
Gefunden und getestet habe ich schon:
Code: Alles auswählen
#!/usr/bin/tclsh
set address "192.168.1.20"
set port "8080"
set getValue ""
set adresslength [string length $address]
set contentGetState "POST /RenderingControl/ctrl HTTP/1.1\n"
append contentGetState "HOST: $address:$port\n"
append contentGetState "SOAPACTION: \"urn:schemas-upnp-org:service:RenderingControl:1#GetVolume\"\n"
append contentGetState "CONTENT-TYPE: text/xml; charset=\"utf-8\"\n"
append contentGetState "Content-Length: [expr $adresslength+365]\n"
append contentGetState "CONNECTION: close\n"
append contentGetState "\n"
append contentGetState "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
append contentGetState "<s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">"
append contentGetState "<s:Body>"
append contentGetState "<u:GetVolume xmlns:u=\"urn:schemas-upnp-org:service:RenderingControl:1\">"
append contentGetState "<InstanceID>0</InstanceID>"
append contentGetState "<Channel>Master</Channel>"
append contentGetState "</u:GetVolume>"
append contentGetState "</s:Body>"
append contentGetState "</s:Envelope>"
set chan [socket $address $port]
puts $chan $contentGetState
flush $chan
puts "[gets $chan]"
while {[gets $chan line] >= 0} {
set input [gets $chan]
regexp "<CurrentVolume>(.*?)</CurrentVolume>" $input dummy getValue
}
close $chan
puts $getValue
#--------------------
load tclrega.so
set input $getValue
#
if { ![ catch { loadOnce tclrega.so } ] } {
#tclrega.so available. Get Metadata from ReGaHss
set isecmd ""
append isecmd "var x = dom.GetObject('SonyVolumeKi');"
append isecmd "x.State('"$input"');"
rega_script $isecmd
}
Gruß tbu
Re: Multiroom Audio mit HomeMatic und Sony
Hallo tbu,
probiers mal so, bei x.State('$input'); müssen die "" raus und die Abfrage musste ich auch raus nehmen
probiers mal so, bei x.State('$input'); müssen die "" raus und die Abfrage musste ich auch raus nehmen
Code: Alles auswählen
load tclrega.so
set input $getValue
#
#tclrega.so available. Get Metadata from ReGaHss
set isecmd ""
append isecmd "var x = dom.GetObject('SonyVolumeKi');"
append isecmd "x.State('$input');"
rega_script $isecmd
-
- Beiträge: 542
- Registriert: 24.07.2011, 16:38
Re: Multiroom Audio mit HomeMatic und Sony
Hallo,
überlege gerade ob ich 2x zuschlagen soll
http://www.ifun.de/sony-sa-ns410-guenst ... ion-45682/
EDIT äh heute Vormittag haben die noch 89 Euro gekostet, jetzt wieder 173 Euro
überlege gerade ob ich 2x zuschlagen soll
http://www.ifun.de/sony-sa-ns410-guenst ... ion-45682/
EDIT äh heute Vormittag haben die noch 89 Euro gekostet, jetzt wieder 173 Euro
Re: Multiroom Audio mit HomeMatic und Sony
Hallo,
bei 89 hätte ich 3 genommen. Einen könnte ich noch gebrauchen und warte nur auf einen guten Preis. Die anderen 2 zum tauschen der 310'er die ich dann für 189 also 10 unterm aktuelle gebraucht tiefpreis verkauft hättet_heinrich hat geschrieben: EDIT äh heute Vormittag haben die noch 89 Euro gekostet, jetzt wieder 173 Euro
-
- Beiträge: 542
- Registriert: 24.07.2011, 16:38
Re: Multiroom Audio mit HomeMatic und Sony
Oh man echt ärgerlich.
Falls ich was mitbekomme, meld ich mich; kannst du ja umgekehrt auch machen
Falls ich was mitbekomme, meld ich mich; kannst du ja umgekehrt auch machen