Squeezebox Modul - erste Version

Begonnen von bugster_de, 17 Dezember 2013, 22:12:10

Vorheriges Thema - Nächstes Thema

oliv06

@weltspion

What works with my SB boom to power on the subwoofer with it :
define SB_boom_onoff_n notify SB_boom:(on|off) set subwoofer $EVENT
Needs to have this in your SB definition :
attr SB_boom donotnotify false

In order to find out if it there is a bug in the module or if the Touch has another behavior,  check what events are generated by the SB server on one hand :
telnet sbserver 9090
listen 1


and on fhem on the other hand :
telnet fhem 7070
inform on SB_boom.*


Do you have last version from the SVN (power on/off event handling was changed)

weltspion

Hi oliv06,

thanks for your quick response.

I switched the donotnotify to false, as noted in your post.

Then I listened to the Squeezebox Server using telnet while starting the SB Touch, pressing play, pause, an play again:

00%3A04%3A20%3A22%3A3b%3A04 power 1 0 seq_no%3A158
00%3A04%3A20%3A29%3A0b%3A32 menustatus ARRAY(0xcf09378) add 00%3A04%3A20%3A29%3A0b%3A32
00%3A04%3A20%3A17%3A64%3A60 prefset server power 1
00%3A04%3A20%3A17%3A64%3A60 menustatus ARRAY(0xcf0b0f8) add 00%3A04%3A20%3A17%3A64%3A60
00%3A04%3A20%3A22%3A3b%3A04 prefset server power 1
00%3A04%3A20%3A22%3A3b%3A04 menustatus ARRAY(0xcd6b018) add 00%3A04%3A20%3A22%3A3b%3A04
00%3A04%3A20%3A17%3A64%3A60 displaynotify showbriefly HASH(0xceb30b8) HASH(0xced68e0)
00%3A04%3A20%3A22%3A3b%3A04 displaynotify showbriefly HASH(0xcf1b238) HASH(0xced6d80)
00%3A04%3A20%3A22%3A3b%3A04 displaynotify showbriefly HASH(0xca31e00) HASH(0xc629790)
00%3A04%3A20%3A22%3A3b%3A04 pause 0
00%3A04%3A20%3A22%3A3b%3A04 playlist jump 0
00%3A04%3A20%3A17%3A64%3A60 playlist open http%3A%2F%2Fuwstream2.somafm.com%3A8808%2F
00%3A04%3A20%3A17%3A64%3A60 playlist open http%3A%2F%2Fuwstream2.somafm.com%3A8808%2F
00%3A04%3A20%3A17%3A64%3A60 displaynotify showbriefly HASH(0xcd9a790) HASH(0xcd65938)
00%3A04%3A20%3A22%3A3b%3A04 displaynotify showbriefly HASH(0xcf06e40) HASH(0xc801a50)
00%3A04%3A20%3A22%3A3b%3A04 displaynotify showbriefly HASH(0xc019750) HASH(0xcf06468)
00%3A04%3A20%3A22%3A3b%3A04 displaynotify showbriefly HASH(0xcd99418) HASH(0xcd62fd8)
00%3A04%3A20%3A22%3A3b%3A04 displaynotify showbriefly HASH(0xcd6b018) HASH(0xcf1b1d8)
00%3A04%3A20%3A22%3A3b%3A04 displaynotify showbriefly HASH(0xcd47038) HASH(0xcd71350)
00%3A04%3A20%3A22%3A3b%3A04 displaynotify showbriefly HASH(0xcc4c368) HASH(0xceb2ba8)
00%3A04%3A20%3A22%3A3b%3A04 displaynotify showbriefly HASH(0xcb59eb8) HASH(0xc903940)
00%3A04%3A20%3A22%3A3b%3A04 displaynotify showbriefly HASH(0xbcf5578) HASH(0xcd9c840)
00%3A04%3A20%3A17%3A64%3A60 playlist newsong SomaFM%3A%20Lush%20(%231%20130k%20aac)%3A%20Se
s%2C%20mostly%20female%2C%20with%20an%20electronic%20influence. 0
00%3A04%3A20%3A22%3A3b%3A04 displaynotify showbriefly HASH(0xcdbe990)
00%3A04%3A20%3A22%3A3b%3A04 pause 1
00%3A04%3A20%3A17%3A64%3A60 playlist pause 1
00%3A04%3A20%3A22%3A3b%3A04 menustatus ARRAY(0x8785618) add 00%3A04%3A20%3A22%3A3b%3A04
00%3A04%3A20%3A22%3A3b%3A04 displaynotify showbriefly HASH(0xcb06eb8)
00%3A04%3A20%3A22%3A3b%3A04 pause 0
00%3A04%3A20%3A17%3A64%3A60 playlist pause 0
00%3A04%3A20%3A22%3A3b%3A04 menustatus ARRAY(0xc823890) add 00%3A04%3A20%3A22%3A3b%3A04
00%3A04%3A20%3A17%3A64%3A60 newmetadata
00%3A04%3A20%3A17%3A64%3A60 playlist newsong Goldfrapp%20-%20Deer%20Stop


Looks not too bad in my opinion.

I tried to listen to FHEM port 7070, but failed to connect (FHEM runs on FritzBox here). Instead of that I had a look at the events protocol of the FHEM frontend. It paged the following messages while pressing power, and play:


2014-02-14 20:39:55 SB_PLAYER SB_Bad lastunkowncmd: prefsetserver power 1
2014-02-14 20:39:55 SB_PLAYER SB_Bad lastunkowncmd: menustatusARRAY(0xbcf33b8) add 00:04:20:22:3b:04
2014-02-14 20:39:56 SB_PLAYER SB_Bad currentArtist:
2014-02-14 20:39:56 SB_PLAYER SB_Bad currentAlbum:
2014-02-14 20:39:56 SB_PLAYER SB_Bad currentTitle: NRJ Classic RnB
2014-02-14 20:39:56 SB_PLAYER SB_Bad signalstrength: 100
2014-02-14 20:39:59 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xcf07740) HASH(0xc1c43c0)
2014-02-14 20:39:59 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xc8ab5f0) HASH(0xce5fe58)
2014-02-14 20:39:59 SB_PLAYER SB_Bad playStatus: paused
2014-02-14 20:40:00 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xcd48828) HASH(0xc1c7210)
2014-02-14 20:40:01 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xce60708) HASH(0xc1c7580)
2014-02-14 20:40:01 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xc0b6a18) HASH(0xc1d1718)
2014-02-14 20:40:01 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xcf05e98) HASH(0xc96fbf0)
2014-02-14 20:40:02 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xcf187d8) HASH(0xbd0a370)
2014-02-14 20:40:02 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xbe3c748) HASH(0xcf161c0)
2014-02-14 20:40:02 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xc8ae6f0) HASH(0xcdb9318)
2014-02-14 20:40:02 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xc97ab08) HASH(0xcf06068)
2014-02-14 20:40:03 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xc1c3e00) HASH(0xc36ef68)
2014-02-14 20:40:03 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xcc1b318) HASH(0xcd68bc0)


Interestingly I got no play signal, or anything looking like a play status. Only playStatus: paused is sent.

A quick toggle between pause and play looks like this:

2014-02-14 20:41:29 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xc94a9e8)
2014-02-14 20:41:29 SB_PLAYER SB_Bad playStatus: paused
2014-02-14 20:41:29 SB_PLAYER SB_Bad lastunkowncmd: menustatusARRAY(0xca49448) add 00:04:20:22:3b:04
2014-02-14 20:41:31 SB_PLAYER SB_Bad lastunkowncmd: displaynotifyshowbriefly HASH(0xc938ac8)
2014-02-14 20:41:32 SB_PLAYER SB_Bad playStatus: paused
2014-02-14 20:41:32 SB_PLAYER SB_Bad lastunkowncmd: menustatusARRAY(0xce5cab0) add 00:04:20:22:3b:04


I hope these logs may help you. Any help is appreciated!

regards
Torsten


bugster_de

ZitatzB.: ich wache auf mit Sqeezebox (Wecker)
--> mach den Wecker aus der Sendet an FHEM Wackup und macht das Licht an Garage auf usw.....
ja das geht theoretisch, ist aber noch nicht fertig implementiert.

-->oliv06: the code for that is in the Parse function under alarm. It treats the SB-Server feedback but has only comments in it yet.

oliv06

@weltspion

What is the MAC address on your Touch ? On your CLI log it seems there are 3 SB . Is it 00:04:20:22:3b:04 ? (which appears as 00%3A04%3A20%3A22%3A3b%3A04)

Could you check you have installed very last version : http://sourceforge.net/p/fhem/code/HEAD/tree/trunk/fhem/contrib/98_SB_PLAYER.pm

With this one you should not have the behavior about playStatus always paused because it interprets correctly the CLI pause messages :
pause 0 = play
pause 1 = pause
(lines 396-401 of the code)

And if your MAC is 00:04:20:22:3b:04 according to the log it should be OK

akw

Bugster,

Das Modul ist echt geil, danke dafür. Ich muss Unterstützung dafür unbedingt in FHEMobile einbauen. Dann muss ich, um die Lautstärke zu ändern oder Pause zu Drücken nicht mehr extra auf iPeng switchen :-)

Ciao, akw
FHEM-SVN auf MacMini OSX 10.7.5

FS20,FHT,HMS,CUL_WS,CUL_HM,KS300,HUE,FB_DECT

FHEMobile: www.fhemobile.de

bugster_de

Hi,

Danke für die Blumen :-) Brauchst Du Info zum Modul, um es in FHEMmobile rein zu packen?

Persönlich finde ich ja die iPENG App eine der genialsten Apps im iOS Umfeld, aber seit die Hauptfunktionen der SB nun in FHEM drin sind, brauche ich die App auch eher nur sporadisch.

Viele Grüße

weltspion

Zitat von: oliv06 am 15 Februar 2014, 23:44:09
Could you check you have installed very last version : http://sourceforge.net/p/fhem/code/HEAD/tree/trunk/fhem/contrib/98_SB_PLAYER.pm
Hi oliv06!

I was running a version from January, 29th (?) - restarting the system with the lastest pm files fixed my problem immediately! Thank's for your valuable help...  8)

Wouldn't it be a great idea to add some release infomation into the header of the coding? That would - in my opinion - help the user identifying the current version running. Just my two pence from lessons learned with this issue.

Many thanks for your effort in creating and maintaining this cool application!

Regards,
Torsten


oliv06

Tips & tricks

If you want to use SB notifications, it is highly recommanded to filter them in order to limit them, e.g.

attr SB_boom donotnotify false
attr SB_boom event-on-change-reading .*

akw

Zitat von: bugster_de am 18 Februar 2014, 08:19:33
Brauchst Du Info zum Modul, um es in FHEMmobile rein zu packen?
Mal schauen,
auf jeden Fall müssen die Events bei Zustandsänderungen gesendet werden, sonst kriegt FHEMobile nix mit.
Ich kann aus FHEMobile heraus übrigens auch iPENG (7) starten. (x-callback-url) Ich glaube ich kann damit iPENG auch sagen, in welchen Screen es gehen soll. Damit muss ich mal experimentieren.

Für FHEMobile wollte ich erstmal nur einen Volume-Drehknopf, Play/Stop/Pause, Prev und Next einbauen. (Und ne Statusanzeige).

Ciao, Arno
FHEM-SVN auf MacMini OSX 10.7.5

FS20,FHT,HMS,CUL_WS,CUL_HM,KS300,HUE,FB_DECT

FHEMobile: www.fhemobile.de

bugster_de

Hi,

na diese Features reichen doch schon mal ganz schön weit.

Die Events werden gesendet wenn man das Attribut donotnotify auf false setzt (ist per default auf true, sprich default sind keine notifies).

akw

#160
Hi bugster,

ich hab einen kleine Bug gefunden:
Bei "volume" fehlt im Log ein Doppelpunkt. (FHEMobile braucht den zum Parsen der Zeile, da ein Leerzeichen auch was anderes bedeuten kann:

2014-02-22_14:27:46 SB_PLAYER_015413834551 volume 27
2014-02-22_14:27:49 SB_PLAYER_015413834551 playStatus: ?
2014-02-22_14:27:49 SB_PLAYER_015413834551 currentArtist: ?
2014-02-22_14:27:49 SB_PLAYER_015413834551 currentAlbum: ?
2014-02-22_14:27:49 SB_PLAYER_015413834551 currentTitle: ?
2014-02-22_14:27:49 SB_PLAYER_015413834551 signalstrength: ?
2014-02-22_14:27:49 SB_PLAYER_015413834551 shuffle: ?
2014-02-22_14:27:49 SB_PLAYER_015413834551 repeat: ?
2014-02-22_14:27:49 SB_PLAYER_015413834551 currentPlaylistName: ?
2014-02-22_14:27:49 SB_PLAYER_015413834551 currentPlaylistUrl: ?
2014-02-22_14:27:49 SB_PLAYER_015413834551 playStatus: ?
2014-02-22_14:27:49 SB_PLAYER_015413834551 playStatus: ?
2014-02-22_14:27:49 SB_PLAYER_015413834551 playStatus: ?
2014-02-22_14:27:49 SB_PLAYER_015413834551 playStatus: ?
2014-02-22_14:28:27 SB_PLAYER_015413834551 volume 34
2014-02-22_14:29:10 SB_PLAYER_015413834551 volume 39
2014-02-22_14:29:51 SB_PLAYER_015413834551 stop
2014-02-22_14:29:51 SB_PLAYER_015413834551 playStatus: stopped


Wie man sieht, ist der Doppelpunkt bei den anderen Befehlen da!
Würdest Du das updaten?

Achja, nochwas:

Bei "volume 0" geht der Wert auf "muted" (sollte besser ein integer bleiben).
Bei "mute") passiert bei mir gar nichts.
Mit mute/unmute sollte man die vorherige Lautstärke (die aus "volume") zurückholen können.
Es sollte ein weiteres reading "mutestatus" oder so geben mit den Werten 0 oder 1..


Ciao, Arno
FHEM-SVN auf MacMini OSX 10.7.5

FS20,FHT,HMS,CUL_WS,CUL_HM,KS300,HUE,FB_DECT

FHEMobile: www.fhemobile.de

akw

So oder so ähnlich wird's werden:

FHEM-SVN auf MacMini OSX 10.7.5

FS20,FHT,HMS,CUL_WS,CUL_HM,KS300,HUE,FB_DECT

FHEMobile: www.fhemobile.de

Alaska

Vielen Dank für das Spitzenmodul!!!

Ich hab den LMS zusammen mit Fhem auf auf einer Dockstar am laufen, in mehreren Räumen Squeezeplug auf RPi's installiert und in Bad und Küche mit dem WeekdayTimer festgelegt, dass die mit meinem Lieblingsradiosender laufen. Das täglich sobald ich aufgestanden bin bis zum rausgehen aus der Türe. Läuft spitze und sehr stabil!

bye

Klaus

bugster_de

#163
@akw: nutze doch einfach das volumeStraight reading. Das geht von 0..100. Das volume reading entspricht den Vorgaben für FHEM Multimedia-Module und da würde ich ungerne was ändern wollen.

@Alaska: Danke für die Blumen. Die Idee ist natürlich cool, die Radios dann beim Verlassen des Hauses automatisch auszuschalten. Like !

Achso: ich kämpfe immer noch mit meinem SB-Server Hibernate: wenn ich den Server aus dem Hibernate hole, dann erkennt FHEM jetzt zuverlässig, dass der Server und die Player wieder da sind. Aber die ersten Befehle, die ich absetze kommen irgendwie nicht durch. Ich muss dann immer die SB-Seite mittels iPENG zum Abspielen überreden. Hat jemand ebenfalls Erfahrungen mit SB-Server Hibernate? Ich finde das Problem nicht.

Alaska

hmmm.....meinen SB-Server schicke ich nie in den Hibernate, da fhem und SB-Server auf meiner Dockstar laufen....also always on. Sorry da kann ich leider nicht weiter helfen.