Sonos integration

  • Opdateret

media.svg

Introduction

The Sonos adapter allows you to control your Sonos speakers from Futurehome.

You can create automations through Thingsplex flows. This way you can for example have your music start playing when you open a door, and stop playing when you close it, or similar. Please see example flow at the end of this article.

If you make a flow that works well for you, and you want to share it with the rest of the Futurehome community, please do so in forum.futurehome.io.

The adapter supports:

  • Play or pause music/radio
  • Skip to next or previous song
  • Mute speakers
  • Turn on/off shuffle, repeat, repeat one and crossfade
  • Controll volume
  • Get metadata (song name, artist, album, album art)

The adapter talks to the Sonos, and will start playing from the same song that was last playing. If there has been a power outage you may need to start a playlist from the Sonos app, so that the adapter knows what to play.

Installation

To install the adapter you need to be in the Futurehome app, and follow these steps:

  1. Go to settings settings.svg -> playground -> Sonos adapter and click the install button.
  2. Click on the button with three dots -> login.
  3. Enter your Sonos username and password, and authenticate Futurehome.
  4. Click one advanced setup and choose which households you want to include to Futurehome, and click «save».

If you successfully logged in, all the devices in your chosen household(s) will be included to Futurehome.

Automation example

sonos_flow.png

The source code is available at the bottom of this document. To make this flow work with your speakers, follow these steps:

  • Copy the source code at the bottom of this document
  • Click on «import» in flows and paste the source code provided

You will then have to change the addresses of the motion sensor and your Sonos speaker.

Start by clicking into the trigger node. Under "Advanced service binding" you can change the address of your contact sensor. You can find the address of your device in the Futurehome app as shown below.

 sonos_flow_sensor_presence.pngsonos_flow_motion_sensor_address.jpg

 

Then you need to do the same for the action node.

sonos_flow_action_node.pngsonos_flow_sonos_address.jpg

 

When everything is setup remember to click the "Save" button in the lower left corner.

sonos_flow_save.png

List of supported interfaces:
https://github.com/thingsplex/sonos-ad

Source

{
"Id": "D7spKRB6EBGPilz",
"ClassId": "D7spKRB6EBGPilz",
"Author": "",
"Version": 0,
"CreatedAt": "2020-07-28T13:23:06.661122011+02:00",
"UpdatedAt": "2020-08-11T10:46:43.682278005+02:00",
"Name": "Sonos test flow",
"Group": "sonos",
"Description": "",
"Nodes": [
{
"Id": "2",
"Type": "action",
"Label": "Play",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:sonos/ad:1/sv:media_player/ad:7828CAD39E4201400",
"Service": "media_player",
"ServiceInterface": "cmd.playback.set",
"Config": {
"DefaultValue": {
"Value": "play",
"ValueType": "string"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 102,
"y": 449
}
},
{
"Id": "4",
"Type": "action",
"Label": "Pause",
"SuccessTransition": "",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:cmd/rt:dev/rn:sonos/ad:1/sv:media_player/ad:7828CAD39E4201400",
"Service": "media_player",
"ServiceInterface": "cmd.playback.set",
"Config": {
"DefaultValue": {
"Value": "pause",
"ValueType": "string"
},
"IsVariableGlobal": false,
"Props": {},
"RegisterAsVirtualService": false,
"ResponseToTopic": "",
"VariableName": "",
"VirtualServiceGroup": "",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 365,
"y": 450
}
},
{
"Id": "7",
"Type": "trigger",
"Label": "presence",
"SuccessTransition": "2",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:sensor_presence/ad:7_0",
"Service": "sensor_presence",
"ServiceInterface": "evt.presence.report",
"Config": {
"IsValueFilterEnabled": true,
"LookupServiceNameAndLocation": false,
"RegisterAsVirtualService": false,
"Timeout": 0,
"ValueFilter": {
"Value": true,
"ValueType": "bool"
},
"VirtualServiceGroup": "ch_0",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 68,
"y": 237
}
},
{
"Id": "8",
"Type": "trigger",
"Label": "presence",
"SuccessTransition": "4",
"TimeoutTransition": "",
"ErrorTransition": "",
"Address": "pt:j1/mt:evt/rt:dev/rn:zw/ad:1/sv:sensor_presence/ad:7_0",
"Service": "sensor_presence",
"ServiceInterface": "evt.presence.report",
"Config": {
"IsValueFilterEnabled": true,
"LookupServiceNameAndLocation": false,
"RegisterAsVirtualService": false,
"Timeout": 0,
"ValueFilter": {
"Value": false,
"ValueType": "bool"
},
"VirtualServiceGroup": "ch_0",
"VirtualServiceProps": {}
},
"Ui": {
"nodeType": "",
"x": 324,
"y": 237
}
}
],
"Settings": null,
"IsDisabled": false,
"IsDefault": false,
"ParallelExecution": "parallel"
}

Var denne artikel en hjælp?

1 ud af 1 fandt dette nyttigt

Har du flere spørgsmål? Indsend en anmodning

Kommentarer

0 kommentarer

Artiklen er lukket for kommentarer.