-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Spotify in SingleRoom mode #4
Comments
(Btw, I suspect that it would be possibly to control Spotify playing on Raumfeld devices using the Spotify Integegration, however what I'm looking for is basic controls (e.g. play/pause, next, volume) irrespective of what is currently playing, so this wouldn't help me much). |
I guess you're pointing in the right direction. Spotify in When you look at a current response of |
The $ curl -L speaker-wohnzimmer:47365/listDevices <?xml version='1.0' encoding='UTF-8'?>
<devices>
<device udn='uuid:1225735b-aec8-4058-892e-01018aa7d420' type='urn:schemas-upnp-org:device:MediaRenderer:1' location='http://192.168.3.116:54421/1225735b-aec8-4058-892e-01018aa7d420.xml'>Speaker Schlafzimmer</device>
<device udn='uuid:1f63dfb3-f96c-49b6-85fe-4807a5470fd1' type='urn:schemas-raumfeld-com:device:ConfigDevice:1' location='http://192.168.3.115:60751/1f63dfb3-f96c-49b6-85fe-4807a5470fd1.xml'>Raumfeld ConfigDevice</device>
<device udn='uuid:666d35e9-f74f-4c0d-a59e-270f39e20a15' type='urn:schemas-upnp-org:device:MediaRenderer:1' location='http://192.168.3.115:49957/666d35e9-f74f-4c0d-a59e-270f39e20a15.xml'>Speaker Wohnzimmer</device>
<device udn='uuid:6daa3668-9a53-4ea2-bd2e-2dbe0c5ea8c5' type='urn:schemas-raumfeld-com:device:RaumfeldDevice:1' location='http://192.168.3.116:51146/6daa3668-9a53-4ea2-bd2e-2dbe0c5ea8c5.xml'>Teufel Raumfeld Device</device>
<device udn='uuid:84064897-c811-4c8a-b79d-ff8f5280321b' type='urn:schemas-upnp-org:device:MediaServer:1' location='http://192.168.3.115:59198/84064897-c811-4c8a-b79d-ff8f5280321b.xml'>Raumfeld MediaServer</device>
<device udn='uuid:9E67F123-86B5-4137-BDE3-569F56E05BF9' type='urn:schemas-upnp-org:device:MediaRenderer:1' location='http://192.168.3.115:59852/9E67F123-86B5-4137-BDE3-569F56E05BF9.xml'>Schlafzimmer</device>
<device udn='uuid:b3516060-b8b2-49b1-ab64-0903f6261421' type='urn:schemas-raumfeld-com:device:RaumfeldDevice:1' location='http://192.168.3.115:55659/b3516060-b8b2-49b1-ab64-0903f6261421.xml'>Teufel Raumfeld Device</device>
</devices> |
Would have been too easy, I guess :) from hassfeld.upnp import pause, play
location = "http://192.168.3.115:49957/666d35e9-f74f-4c0d-a59e-270f39e20a15.xml"
play(location)
#pause(location) |
I haven't tested any of the other methods. |
Great! With this we can work. |
Can you please provide me the content of the sites |
|
Thanks for sharing! I just applied for the Spotify Premium plan for better testing. Unfortunately only to find out that it doesn't work over different networks. |
Then even more so, thanks for looking into this.
Done. One issue: if room["renderer"]["@spotifyConnect"] == "ACTIVE": needs to compare against lowercase "active". After fixing that, all the new methods (
|
Thanks for the feedback! Did your test cover only |
Ah, I didn't realize that |
Alright, I did some tests: The room is recognized as "active" when Spotify is playing. However the play state does not appear to be correctly detected: A "Play" (instead of "Pause") button is shown, and attempting to click it fails with If I manually pause Spotify, and then click the play button, the music starts playing but the action still produces an error: Error:
|
The error during Though that does not fix the "play state" detection. |
Logging the result of
|
Alright, I've been experimenting some more:
If I
then the play / pause button in HomeAssistant works. If HomeAssistant and Spotify disagree on the state, then button in HomeAssistant does not work (because it attempts to do the incorrect action). |
I merged the changes to master for easier testing (starting from 65947ef). However, I fear I depend on external feedback/support to progress here due to the inability to test on my side. |
Thanks a lot for your work on this! If just tested this and found the following issue: With >>> import hassfeld
>>> h = hassfeld.RaumfeldHost("speaker-wohnzimmer.lan"); h.start_update_thread()
>>> h.room_is_spotify_single_room('Wohnzimmer')
False Downgrading back to the dev branch: >>> import hassfeld
>>> h = hassfeld.RaumfeldHost("speaker-wohnzimmer.lan"); h.start_update_thread()
>>> h.room_is_spotify_single_room('Wohnzimmer')
True It looks like the "Spotify active" check uses the wrong case again, changing Play / Pause from the Home Assistant UI seems to work reliably now! 🎉 🎊 🥳 I'll test this more over the next few days, and will report back with any issues. |
Thanks for the feedback! The failing "Spotify active" check was indeed a regression. It's fixed again with B5r1oJ0A9G/hassfeld@de86cc9. What other controls are missing for single-room support? Edit:
|
In 840a4b1 support for {set,get}_volume, {next,previous}_track is ready for testing. |
I really appreciate the effort that went into this application, and it does work great with local files. |
Hello @MaxSchuck , @TimNN and me worked on several aspects together. Can you please clarify what exactly you're referring to. Also, some information about your setup can be helpful too. |
I have trouble using your extension in HA with my Raumfeldspeaker if spotify plays media in Single-Room modus. The speaker is playing via spotify, but in HA it is viewed as off. If i turn it on to change volume for example, spotify gets stopped. Everthing works as expected. If i use the multiroom modus after brief testing. To me, this sounds as if i might just have an outdated version, but i installed via the HACS extension, that should take care of updates for me. Update pollingn is activated |
@MaxSchuck, |
am on 0.1.12-alpha4 but I still face the same issue sadly. |
allright, now it partly works for me, I don't know what exactly changed, I did a ton of restarting, reinstalling and so on concerning other problems. HA still does not realize if music is playing via spotify multiroom. If I hit play though, it starts playing from the multiroom speaker. Background-image still does not appear, but who cares. What bothers me is that i cant skip or replay songs. Imma just dump the log report here, can't make out what is of relevance and what not ` [140228859544000] 'HassRaumfeldHost' object has no attribute 'async_room_next_track' Traceback (most recent call last): |
Hi there, commenting on this old issue again, it seems I experience the same problem. using v0.1.12-alpha4 installed through HACS 1.30 on Home Assistant version 2023.1.7 I have Teufel Raumfeld devices from the second generation. (Stereo M) Steps to reproduce:
In addition, I cannot play any media on the device until I use the Raumfeld app to choose anything without Spotify. What does work:
Happy to help debugging or fixing the issue if you point me in the right direction. Best Exception when clicking "next" while Spotify is being played:
Exception when trying to choose media through a Service after Spotify has been used:
|
Hi!
First of all, thank you for this! I've been experimenting a bit with this and found that Spotify does not appear to be supported in SingleRoom mode.
To recap: Raumfeld supports two modes for Spotify: SingleRoom and MultiRoom. In SingleRoom mode, each room is separately available as a Device in Spotify. In MultiRoom mode, a single Device is available in Spotify, and the Teufel App can be used to configure which speakers actually play the music from Spotify.
Using Spotify in MultiRoom mode seems to mostly work (though I haven't experimented long with it).
Spotify in SingleRoom mode does not work: The Room shows as not active / playing. I suspect that this is because of this:
Note that the room where Spotify is active is listed as in
unassignedRooms
.I don't understand enough about the data model here to determine if there's an ~easy fix for this or not. I'd be happy to test potential patches or even to try and write a patch myself if you can point me in the correct direction.
(Note: I totally understand if this is not a priority for you, but wanted to open this so that there's at least a central place for tracking this).
The text was updated successfully, but these errors were encountered: