nfarina / homebridge-sonos

Sonos plugin for homebridge: https://github.com/nfarina/homebridge
155 stars 52 forks source link

Will a command start a radio station straight away? #25

Open miguelmolez opened 8 years ago

miguelmolez commented 8 years ago

I'm upgrading my kitchen speaker to a Sonos Play 3, I was wondering if I could set a scene.

e.g - "Its Morning" So my Wemo starts with a kettle and the Sonos automatically plays a station?

BrekiTomasson commented 8 years ago

Yes. You'll need to set the station to be a favorite through your normal Sonos application, though. I have an "I'm home" scene, for example, which turns on the lights in my hallway and living room and activates a "Top 100 tracks today" playlist from Spotify over Sonos in the same two rooms.

miguelmolez commented 8 years ago

Thanks for the reply. Just to confirm the sonos ap has a function to start a favourite on start up? No further action needed?

Nousemusic commented 8 years ago

@BrekiTomasson How do you start a specific Sonos favorite in a scene? I'm using the Eve-App and there I can only define Power and Volume for the Sonos-Players. Thanky for your support in advance.

BrekiTomasson commented 8 years ago

Here's an example of a scene I'm using in the presets.json file:

"sleep30": {
  "players": [
    { "roomName": "Bedroom", "volume": 5 }
  ],
  "state": "playing",
  "favorite": "Nightstorms",
  "playMode": "SHUFFLE",
  "sleep": "00:30:00",
  "crossfade": true,
  "pauseOthers": true
}

This preset pauses all other players that might be out there, starts up a favorite that I call "Nightstorms" on my Bedroom Sonos, with a 5% volume, and puts a sleep timer on 30 minutes. Then just call this "device" in your scene.

miguelmolez commented 8 years ago

Where do you run the presets.json file? Is there a separate plugin?

gizbod commented 8 years ago

@BrekiTomasson, would love some more info on presets. I've done a lot of searching and struggling to find anything. Where do you save the presets file and have you got an example of the full json? Thanks

mattnewham commented 8 years ago

@miguelmolez @gizbod - I believe @BrekiTomasson is referring https://github.com/jishi/node-sonos-http-api

I'd be interested to know how this integrates (if at all) with the homebridge plugin, I'm not sure if the sones-http-api exposes a sonos "player" to the plugin?

Probably worth installing the nodejs HTTP interface and seeing what happens - I'll update if I find anything, but this sounds perfect for integrating SONOS fully

mattnewham commented 8 years ago

It looks like the HTTP API is incredibly flexible, and IMO the best way forward would be to start that API as a separate nodeJS service, and send commands to it via the HTTP plugin

samuel-larsson commented 8 years ago

Hang on, so you can actually create a scene in for example the Eve app, which starts a specific (favorite) playlist from the Sonos app? If so, I'd love to learn how.

mattnewham commented 8 years ago

@samuel-larsson Yes. It's not exactly simple and doesn't use this plugin at all - join the slack team at https://homebridgeteam.slack.com/ and send me a DM I will show you how

I'll probably write this up somewhere soon

gizbod commented 8 years ago

@mattnewham Matt thanks for looking into this, I will try set this up but i might have to ask for some guidance on the slack page also. :)

lsmith07 commented 7 years ago

@mattnewham have you had success? I'm also looking for a solution to add a sonos playlist to an Eve app (or other) scene. I tried joining the slack team, but can't do that without an invite.

gizbod commented 7 years ago

@lsmith07 you need to use the jishi Sonos api. Along with the http plugin to do that. This Sonos plugin doesn't give you the options you need to do what you want as far as I'm aware. Also if you follow the slack link, I don't think you you an invitation for this slack team. You should just be able to sign up.

nfarina commented 7 years ago

@lsmith07 Anyone can join the Slack team using the invite link from the Homebridge page: https://homebridge-slackin.herokuapp.com/