added migrated 2.x add-ons

Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
Kai Kreuzer
2020-09-21 01:58:32 +02:00
parent bbf1a7fd29
commit 6df6783b60
11662 changed files with 1302875 additions and 11 deletions

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.openhab.binding.sonos</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,13 @@
This content is produced and maintained by the openHAB project.
* Project home: https://www.openhab.org
== Declared Project Licenses
This program and the accompanying materials are made available under the terms
of the Eclipse Public License 2.0 which is available at
https://www.eclipse.org/legal/epl-2.0/.
== Source Code
https://github.com/openhab/openhab-addons

View File

@@ -0,0 +1,151 @@
# Sonos Binding
This binding integrates the [Sonos Multi-Room Audio system](https://www.sonos.com).
**Attention:**
You might run into trouble if your control system (the binding) is in another subnet than your Sonos device.
Sonos devices make use of multicast which in most cases needs additional router configuration outside of a single subnet.
If you observe communication errors (COMMUNICATION_ERROR/not registered), you might need to configure your router to increase the TTL of the packets send by your Sonos device.
This happens because of a TTL=1 for ALIVE packets send by Sonos devices, resulting in dropped packets after one hop.
## Supported Things
All available Sonos (playback) devices are supported by this binding. This includes the One, OneSL, Play:1, Play:3, Play:5, Connect, Connect:Amp, Port, Amp, Playbar, Playbase, Beam and Sub. The Bridge and Boost are not supported, but these devices do only have an auxiliary role in the Sonos network and do not have any playback capability. All supported Sonos devices are registered as an audio sink in the framework.
When being defined in a \*.things file, the specific thing types One, OneSL, PLAY1, PLAY3, PLAY5, PLAYBAR, PLAYBASE, Beam, CONNECT, CONNECTAMP, Port and Amp should be used.
Please note that these thing types are case sensitive (you need to define them **exactly as stated above**).
## Discovery
The Sonos devices are discovered through UPnP in the local network and all devices are put in the Inbox. Beware that all Sonos devices have to be added to the local Sonos installation as described in the Sonos setup procedure, e.g. through the Sonos Controller software or smartphone app.
## Binding Configuration
The binding has the following configuration options, which can be set for "binding:sonos":
| Parameter | Name | Description | Required |
|-------------|------------------|--------------------------------------------------------------------------|----------|
| opmlUrl | OPML Service URL | URL for the OPML/tunein.com service | no |
| callbackUrl | Callback URL | URL to use for playing notification sounds, e.g. http://192.168.0.2:8080 | no |
## Thing Configuration
The Sonos Thing requires the UPnP UDN (Unique Device Name) as a configuration value in order for the binding to know how to access it.
All the Sonos UDN have the "RINCON_000E58D8403A0XXXX" format (value to be found via Sonos item in the Paper UI Inbox).
Additionally, a refresh interval, used to poll the Sonos device, can be specified (in seconds).
You can use the `notificationVolume` property for setting a default volume (in percent) to be used to play notifications.
In the thing file, this looks e.g. like
```
Thing sonos:PLAY1:1 [udn="RINCON_000E58D8403A0XXXX", refresh=60, notificationVolume=25]
```
## Channels
The devices support the following channels:
| Channel Type ID | Item Type | Access Mode | Description | Thing types |
|---------------------|-----------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
| add | String | W | Add the given Zone Player to the group of this Zone Player | all |
| alarm | Switch | W | Set the first occurring alarm either ON or OFF. Alarms first have to be defined through the Sonos Controller app | all |
| alarmproperties | String | R | Properties of the alarm currently running | all |
| alarmrunning | Switch | R | Set to ON if the alarm was triggered | all |
| clearqueue | Switch | W | Suppress all songs from the current queue | all |
| control | Player | RW | Control the Zone Player, e.g. PLAY/PAUSE/NEXT/PREVIOUS | all |
| coordinator | String | R | UDN of the coordinator for the current group | all |
| currentalbum | String | R | Name of the album currently playing | all |
| currentalbumart | Image | R | Cover art of the album currently playing | all |
| currentalbumarturl | String | R | Cover art URL of the album currently playing | all |
| currentartist | String | R | Name of the artist currently playing | all |
| currenttitle | String | R | Title of the song currently playing | all |
| currenttrack | String | R | Name of the current track or radio station currently playing | all |
| currenttrackuri | String | R | URI of the current track | all |
| currenttransporturi | String | R | URI of the current AV transport | all |
| favorite | String | W | Play the given favorite entry. The favorite entry has to be predefined in the Sonos Controller app | all |
| led | Switch | RW | Set or get the status of the white LED on the front of the Zone Player | all |
| linein | Switch | R | Indicator set to ON when the line-in of the Zone Player is connected | PLAY5, CONNECT, CONNECTAMP, PLAYBAR, PLAYBASE, Beam, Port |
| analoglinein | Switch | R | Indicator set to ON when the analog line-in of the Zone Player is connected | Amp |
| digitallinein | Switch | R | Indicator set to ON when the digital line-in of the Zone Player is connected | Amp |
| localcoordinator | Switch | R | Indicator set to ON if the this Zone Player is the Zone Group Coordinator | all |
| mute | Switch | RW | Set or get the mute state of the master volume of the Zone Player | all |
| nightmode | Switch | RW | Enable or disable the night mode feature | PLAYBAR, PLAYBASE, Beam, Amp |
| notificationsound | String | W | Play a notification sound by a given URI | all |
| playlinein | String | W | This channel supports playing the audio source connected to the line-in of the zoneplayer identified by the Thing UID or UPnP UDN provided by the String. | All |
| playlist | String | W | Play the given playlist. The playlist has to predefined in the Sonos Controller app | all |
| playqueue | Switch | W | Play the songs from the current queue | all |
| playtrack | Number | W | Play the given track number from the current queue | all |
| playuri | String | W | Play the given URI | all |
| publicaddress | Switch | W | Put all Zone Players in one group, and stream audio from the line-in from the Zone Player that triggered the command | all except Amp |
| publicanalogaddress | Switch | W | Put all Zone Players in one group, and stream audio from the analog line-in from the Zone Player that triggered the command | Amp |
| publicdigitaladdress| Switch | W | Put all Zone Players in one group, and stream audio from the digital line-in from the Zone Player that triggered the command | Amp |
| radio | String | W | Play the given radio station. The radio station has to be predefined in the Sonos Controller app | all |
| remove | String | W | Remove the given Zone Player from the group of this Zone Player | all |
| repeat | String | RW | Repeat the track or queue playback. The accepted values are OFF, ONE and ALL | all |
| restore | Switch | W | Restore the state of the Zone Player | all |
| restoreall | Switch | W | Restore the state of all the Zone Players | all |
| save | Switch | W | Save the state of the Zone Player | all |
| saveall | Switch | W | Save the state of all the Zone Players | all |
| shuffle | Switch | RW | Shuffle the queue playback | all |
| sleeptimer | Number | RW | Set/show the duration of the SleepTimer in seconds | all |
| snooze | Number | W | Snooze the running alarm, if any, with the given number of minutes | all |
| speechenhancement | Switch | RW | Enable or disable the speech enhancement feature | PLAYBAR, PLAYBASE, Beam, One, Amp |
| standalone | Switch | W | Make the Zone Player leave its Group and become a standalone Zone Player | all |
| state | String | R | The State channel contains state of the Zone Player, e.g. PLAYING, STOPPED, ... | all |
| stop | Switch | W | Write `ON` to this channel: Stops the Zone Player player. | all |
| tuneinstationid | String | RW | Provide the current TuneIn station id or play the TuneIn radio given by its station id | all |
| volume | Dimmer | RW | Set or get the master volume of the Zone Player | all |
| zonegroupid | String | R | Id of the Zone Group the Zone Player belongs to | all |
| zonename | String | R | Name of the Zone associated to the Zone Player | all |
The `playline` channel accepts as command either the thing UID or the UPnP UDN.
Note that you can prefix your command value with "Analog," or "Digital," to distinguish the line-in of your Sonos device.
This is useful for the Sonos Amp in particular.
## Audio Support
All supported Sonos devices are registered as an audio sink in the framework.
Audio streams are treated as notifications, i.e. they are fed into the `notificationsound` channel.
The `notificationsound` channel change the volume of the audio sink to the value defined in the `notificationVolume` property of the thing and restores it after finished playing.
Note that the Sonos binding has a limit of 20 seconds for notification sounds.
Any sound that is longer than that will be cut off.
URL audio streams (e.g. an Internet radio stream) are an exception and do not get sent to the `notificationsound` channel.
Instead, these will be sent to the `playuri` channel.
## Full Example
demo.things:
```
Thing sonos:PLAY1:living [ udn="RINCON_000E58D8403A0XXXX", refresh=60]
```
demo.items:
```
Group Sonos <player>
Player Sonos_Controller "Controller" (Sonos) {channel="sonos:PLAY1:living:control"}
Dimmer Sonos_Volume "Volume [%.1f %%]" <soundvolume> (Sonos) {channel="sonos:PLAY1:living:volume"}
Switch Sonos_Mute "Mute" <soundvolume_mute> (Sonos) {channel="sonos:PLAY1:living:mute"}
Switch Sonos_LED "LED" <switch> (Sonos) {channel="sonos:PLAY1:living:led"}
String Sonos_CurrentTrack "Now playing [%s]" <text> (Sonos) {channel="sonos:PLAY1:living:currenttrack"}
String Sonos_State "Status [%s]" <text> (Sonos) {channel="sonos:PLAY1:living:state"}
```
demo.sitemap:
```
sitemap demo label="Main Menu"
{
Frame label="Sonos" {
Default item=Sonos_Controller
Slider item=Sonos_Volume
Switch item=Sonos_Mute
Switch item=Sonos_LED
Text item=Sonos_CurrentTrack
Text item=Sonos_State
}
}
```

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>org.openhab.binding.sonos</artifactId>
<name>openHAB Add-ons :: Bundles :: Sonos Binding</name>
</project>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.sonos-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>
<feature name="openhab-binding-sonos" description="Sonos Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<feature>openhab-transport-upnp</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.sonos/${project.version}</bundle>
</feature>
</features>

View File

@@ -0,0 +1,116 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal;
import org.eclipse.jdt.annotation.NonNullByDefault;
/**
* The {@link SonosAlarm} is a datastructure to describe
* alarms in the Sonos ecosystem
*
* @author Karel Goderis - Initial contribution
*/
@NonNullByDefault
public class SonosAlarm {
private final int id;
private String startTime;
private final String duration;
private final String recurrence;
private boolean enabled;
private final String roomUUID;
private final String programURI;
private final String programMetaData;
private final String playMode;
private final int volume;
private final boolean includeLinkedZones;
public SonosAlarm(int id, String startTime, String duration, String recurrence, boolean enabled, String roomUUID,
String programURI, String programMetaData, String playMode, int volume, boolean includeLinkedZones) {
this.id = id;
this.startTime = startTime;
this.duration = duration;
this.recurrence = recurrence;
this.enabled = enabled;
this.roomUUID = roomUUID;
this.programURI = programURI;
this.programMetaData = programMetaData;
this.playMode = playMode;
this.volume = volume;
this.includeLinkedZones = includeLinkedZones;
}
public int getId() {
return id;
}
public String getStartTime() {
return startTime;
}
/**
* @param startTime the startTime to set
*/
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getDuration() {
return duration;
}
public String getRecurrence() {
return recurrence;
}
public boolean getEnabled() {
return enabled;
}
/**
* @param enabled the enabled to set
*/
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public String getRoomUUID() {
return roomUUID;
}
public String getProgramURI() {
return programURI;
}
public String getProgramMetaData() {
return programMetaData;
}
public String getPlayMode() {
return playMode;
}
public int getVolume() {
return volume;
}
public boolean getIncludeLinkedZones() {
return includeLinkedZones;
}
@Override
public String toString() {
return "SonosAlarm [ID=" + id + ", start=" + startTime + ", duration=" + duration + ", enabled=" + enabled
+ ", UUID=" + roomUUID + "]";
}
}

View File

@@ -0,0 +1,150 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal;
import java.io.IOException;
import java.util.Collections;
import java.util.Locale;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.io.IOUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.sonos.internal.handler.ZonePlayerHandler;
import org.openhab.core.audio.AudioFormat;
import org.openhab.core.audio.AudioHTTPServer;
import org.openhab.core.audio.AudioSink;
import org.openhab.core.audio.AudioStream;
import org.openhab.core.audio.FileAudioStream;
import org.openhab.core.audio.FixedLengthAudioStream;
import org.openhab.core.audio.URLAudioStream;
import org.openhab.core.audio.UnsupportedAudioFormatException;
import org.openhab.core.audio.UnsupportedAudioStreamException;
import org.openhab.core.audio.utils.AudioStreamUtils;
import org.openhab.core.library.types.OnOffType;
import org.openhab.core.library.types.PercentType;
import org.openhab.core.library.types.StringType;
import org.openhab.core.thing.util.ThingHandlerHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This makes a Sonos speaker to serve as an {@link AudioSink}-
*
* @author Kai Kreuzer - Initial contribution and API
* @author Christoph Weitkamp - Added getSupportedStreams() and UnsupportedAudioStreamException
*
*/
@NonNullByDefault
public class SonosAudioSink implements AudioSink {
private final Logger logger = LoggerFactory.getLogger(SonosAudioSink.class);
private static final Set<AudioFormat> SUPPORTED_AUDIO_FORMATS = Collections
.unmodifiableSet(Stream.of(AudioFormat.MP3, AudioFormat.WAV).collect(Collectors.toSet()));
private static final Set<Class<? extends AudioStream>> SUPPORTED_AUDIO_STREAMS = Collections
.unmodifiableSet(Stream.of(FixedLengthAudioStream.class, URLAudioStream.class).collect(Collectors.toSet()));
private AudioHTTPServer audioHTTPServer;
private ZonePlayerHandler handler;
private @Nullable String callbackUrl;
public SonosAudioSink(ZonePlayerHandler handler, AudioHTTPServer audioHTTPServer, @Nullable String callbackUrl) {
this.handler = handler;
this.audioHTTPServer = audioHTTPServer;
this.callbackUrl = callbackUrl;
}
@Override
public String getId() {
return handler.getThing().getUID().toString();
}
@Override
public @Nullable String getLabel(@Nullable Locale locale) {
return handler.getThing().getLabel();
}
@Override
public void process(@Nullable AudioStream audioStream)
throws UnsupportedAudioFormatException, UnsupportedAudioStreamException {
if (audioStream == null) {
// in case the audioStream is null, this should be interpreted as a request to end any currently playing
// stream.
logger.trace("Stop currently playing stream.");
handler.stopPlaying(OnOffType.ON);
} else if (audioStream instanceof URLAudioStream) {
// it is an external URL, the speaker can access it itself and play it.
URLAudioStream urlAudioStream = (URLAudioStream) audioStream;
handler.playURI(new StringType(urlAudioStream.getURL()));
try {
audioStream.close();
} catch (IOException e) {
}
} else if (audioStream instanceof FixedLengthAudioStream) {
// we serve it on our own HTTP server and treat it as a notification
// Note that we have to pass a FixedLengthAudioStream, since Sonos does multiple concurrent requests to
// the AudioServlet, so a one time serving won't work.
if (callbackUrl != null) {
String relativeUrl = audioHTTPServer.serve((FixedLengthAudioStream) audioStream, 10).toString();
String url = callbackUrl + relativeUrl;
AudioFormat format = audioStream.getFormat();
if (!ThingHandlerHelper.isHandlerInitialized(handler)) {
logger.warn("Sonos speaker '{}' is not initialized - status is {}", handler.getThing().getUID(),
handler.getThing().getStatus());
} else if (AudioFormat.WAV.isCompatible(format)) {
handler.playNotificationSoundURI(
new StringType(url + AudioStreamUtils.EXTENSION_SEPARATOR + FileAudioStream.WAV_EXTENSION));
} else if (AudioFormat.MP3.isCompatible(format)) {
handler.playNotificationSoundURI(
new StringType(url + AudioStreamUtils.EXTENSION_SEPARATOR + FileAudioStream.MP3_EXTENSION));
} else {
throw new UnsupportedAudioFormatException("Sonos only supports MP3 or WAV.", format);
}
} else {
logger.warn("We do not have any callback url, so Sonos cannot play the audio stream!");
}
} else {
IOUtils.closeQuietly(audioStream);
throw new UnsupportedAudioStreamException(
"Sonos can only handle FixedLengthAudioStreams and URLAudioStreams.", audioStream.getClass());
// Instead of throwing an exception, we could ourselves try to wrap it into a
// FixedLengthAudioStream, but this might be dangerous as we have no clue, how much data to expect from
// the stream.
}
}
@Override
public Set<AudioFormat> getSupportedFormats() {
return SUPPORTED_AUDIO_FORMATS;
}
@Override
public Set<Class<? extends AudioStream>> getSupportedStreams() {
return SUPPORTED_AUDIO_STREAMS;
}
@Override
public PercentType getVolume() {
String volume = handler.getVolume();
return volume != null ? new PercentType(volume) : PercentType.ZERO;
}
@Override
public void setVolume(PercentType volume) {
handler.setVolume(volume);
}
}

View File

@@ -0,0 +1,133 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.thing.ThingTypeUID;
/**
* The {@link SonosBinding} class defines common constants, which are
* used across the whole binding.
*
* @author Karel Goderis - Initial contribution
* @author Kai Kreuzer - Changed ESH-PREFIX and cleaned up warnings
*/
@NonNullByDefault
public class SonosBindingConstants {
public static final String BINDING_ID = "sonos";
public static final String ESH_PREFIX = "smarthome-";
// List of all Thing Type UIDs
// Column (:) is not used for PLAY:1, PLAY:3, PLAY:5 and CONNECT:AMP because of
// ThingTypeUID and device pairing name restrictions
public static final ThingTypeUID ONE_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "One");
public static final ThingTypeUID ONE_SL_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "OneSL");
public static final ThingTypeUID PLAY1_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "PLAY1");
public static final ThingTypeUID PLAY3_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "PLAY3");
public static final ThingTypeUID PLAY5_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "PLAY5");
public static final ThingTypeUID PLAYBAR_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "PLAYBAR");
public static final ThingTypeUID PLAYBASE_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "PLAYBASE");
public static final ThingTypeUID BEAM_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "Beam");
public static final ThingTypeUID CONNECT_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "CONNECT");
public static final ThingTypeUID PORT_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "Port");
public static final ThingTypeUID CONNECTAMP_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "CONNECTAMP");
public static final ThingTypeUID AMP_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "Amp");
public static final ThingTypeUID SYMFONISK_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "SYMFONISK");
public static final ThingTypeUID ZONEPLAYER_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, "zoneplayer");
public static final Set<ThingTypeUID> WITH_LINEIN_THING_TYPES_UIDS = Stream
.of(PLAY5_THING_TYPE_UID, PLAYBAR_THING_TYPE_UID, PLAYBASE_THING_TYPE_UID, BEAM_THING_TYPE_UID,
CONNECT_THING_TYPE_UID, CONNECTAMP_THING_TYPE_UID, PORT_THING_TYPE_UID)
.collect(Collectors.toSet());
public static final Set<ThingTypeUID> WITH_ANALOG_LINEIN_THING_TYPES_UIDS = Stream.of(AMP_THING_TYPE_UID)
.collect(Collectors.toSet());
public static final Set<ThingTypeUID> WITH_DIGITAL_LINEIN_THING_TYPES_UIDS = Stream.of(AMP_THING_TYPE_UID)
.collect(Collectors.toSet());
public static final Set<ThingTypeUID> SUPPORTED_KNOWN_THING_TYPES_UIDS = Stream.of(ONE_THING_TYPE_UID,
ONE_SL_THING_TYPE_UID, PLAY1_THING_TYPE_UID, PLAY3_THING_TYPE_UID, PLAY5_THING_TYPE_UID,
PLAYBAR_THING_TYPE_UID, PLAYBASE_THING_TYPE_UID, BEAM_THING_TYPE_UID, CONNECT_THING_TYPE_UID,
CONNECTAMP_THING_TYPE_UID, PORT_THING_TYPE_UID, AMP_THING_TYPE_UID, SYMFONISK_THING_TYPE_UID)
.collect(Collectors.toSet());
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>(SUPPORTED_KNOWN_THING_TYPES_UIDS);
static {
SUPPORTED_THING_TYPES_UIDS.add(ZONEPLAYER_THING_TYPE_UID);
}
// List of all Channel ids
public static final String ADD = "add";
public static final String ALARM = "alarm";
public static final String ALARMPROPERTIES = "alarmproperties";
public static final String ALARMRUNNING = "alarmrunning";
public static final String CLEARQUEUE = "clearqueue";
public static final String CONTROL = "control";
public static final String COORDINATOR = "coordinator";
public static final String CURRENTALBUM = "currentalbum";
public static final String CURRENTALBUMART = "currentalbumart";
public static final String CURRENTALBUMARTURL = "currentalbumarturl";
public static final String CURRENTARTIST = "currentartist";
public static final String CURRENTTITLE = "currenttitle";
public static final String CURRENTTRACK = "currenttrack";
public static final String CURRENTTRACKURI = "currenttrackuri";
public static final String CURRENTTRANSPORTURI = "currenttransporturi";
public static final String FAVORITE = "favorite";
public static final String LED = "led";
public static final String LINEIN = "linein";
public static final String ANALOGLINEIN = "analoglinein";
public static final String DIGITALLINEIN = "digitallinein";
public static final String LOCALCOORDINATOR = "localcoordinator";
public static final String MUTE = "mute";
public static final String NIGHTMODE = "nightmode";
public static final String NOTIFICATIONSOUND = "notificationsound";
public static final String PLAYLINEIN = "playlinein";
public static final String PLAYLIST = "playlist";
public static final String PLAYQUEUE = "playqueue";
public static final String PLAYTRACK = "playtrack";
public static final String PLAYURI = "playuri";
public static final String PUBLICADDRESS = "publicaddress";
public static final String PUBLICANALOGADDRESS = "publicanalogaddress";
public static final String PUBLICDIGITALADDRESS = "publicdigitaladdress";
public static final String RADIO = "radio";
public static final String REMOVE = "remove";
public static final String REPEAT = "repeat";
public static final String RESTORE = "restore";
public static final String RESTOREALL = "restoreall";
public static final String SAVE = "save";
public static final String SAVEALL = "saveall";
public static final String SHUFFLE = "shuffle";
public static final String SLEEPTIMER = "sleeptimer";
public static final String SNOOZE = "snooze";
public static final String SPEECHENHANCEMENT = "speechenhancement";
public static final String STANDALONE = "standalone";
public static final String STATE = "state";
public static final String STOP = "stop";
public static final String TUNEINSTATIONID = "tuneinstationid";
public static final String VOLUME = "volume";
public static final String ZONEGROUPID = "zonegroupid";
public static final String ZONENAME = "zonename";
public static final String MODELID = "modelId";
// List of properties
public static final String IDENTIFICATION = "identification";
public static final String MAC_ADDRESS = "macAddress";
public static final String IP_ADDRESS = "ipAddress";
}

View File

@@ -0,0 +1,154 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal;
import java.io.Serializable;
import org.apache.commons.lang.StringEscapeUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
/**
* The {@link SonosEntry} is a datastructure to describe
* multimedia "entries" in the Sonos ecosystem
*
* @author Karel Goderis - Initial contribution
*/
@NonNullByDefault
public class SonosEntry implements Serializable {
private static final long serialVersionUID = -4543607156929701588L;
private final String id;
private final String title;
private final String parentId;
private final String upnpClass;
private final String res;
private final String album;
private final String albumArtUri;
private final String creator;
private final int originalTrackNumber;
private final @Nullable SonosResourceMetaData resourceMetaData;
private @Nullable String desc;
public SonosEntry(String id, String title, String parentId, String album, String albumArtUri, String creator,
String upnpClass, String res) {
this(id, title, parentId, album, albumArtUri, creator, upnpClass, res, -1);
}
public SonosEntry(String id, String title, String parentId, String album, String albumArtUri, String creator,
String upnpClass, String res, int originalTrackNumber) {
this(id, title, parentId, album, albumArtUri, creator, upnpClass, res, originalTrackNumber, null);
}
public SonosEntry(String id, String title, String parentId, String album, String albumArtUri, String creator,
String upnpClass, String res, int originalTrackNumber, @Nullable SonosResourceMetaData resourceMetaData) {
this.id = id;
this.title = title;
this.parentId = parentId;
this.album = album;
this.albumArtUri = albumArtUri;
this.creator = creator;
this.upnpClass = upnpClass;
this.res = res;
this.originalTrackNumber = originalTrackNumber;
this.resourceMetaData = resourceMetaData;
this.desc = null;
}
/**
* @return the title of the entry.
*/
@Override
public String toString() {
return title;
}
/**
* @return the unique identifier of this entry.
*/
public String getId() {
return id;
}
/**
* @return the title of the entry.
*/
public String getTitle() {
return title;
}
/**
* @return the unique identifier of the parent of this entry.
*/
public String getParentId() {
return parentId;
}
/**
* @return a URI of this entry.
*/
public String getRes() {
return res;
}
/**
* @return the UPnP classname for this entry.
*/
public String getUpnpClass() {
return upnpClass;
}
/**
* @return the name of the album.
*/
public String getAlbum() {
return album;
}
/**
* @return the URI for the album art.
*/
public String getAlbumArtUri() {
return StringEscapeUtils.unescapeXml(albumArtUri);
}
/**
* @return the name of the artist who created the entry.
*/
public String getCreator() {
return creator;
}
public int getOriginalTrackNumber() {
return originalTrackNumber;
}
/**
* The resourceMetaData field from the ResMD parent, this will be login info for
* streaming accounts to use in favorites
*
* @return
*/
public @Nullable SonosResourceMetaData getResourceMetaData() {
return resourceMetaData;
}
public @Nullable String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}

View File

@@ -0,0 +1,174 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal;
import static org.openhab.binding.sonos.internal.SonosBindingConstants.SUPPORTED_THING_TYPES_UIDS;
import static org.openhab.binding.sonos.internal.config.ZonePlayerConfiguration.UDN;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.sonos.internal.handler.ZonePlayerHandler;
import org.openhab.core.audio.AudioHTTPServer;
import org.openhab.core.audio.AudioSink;
import org.openhab.core.config.core.Configuration;
import org.openhab.core.io.transport.upnp.UpnpIOService;
import org.openhab.core.net.HttpServiceUtil;
import org.openhab.core.net.NetworkAddressService;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingRegistry;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.ThingUID;
import org.openhab.core.thing.binding.BaseThingHandlerFactory;
import org.openhab.core.thing.binding.ThingHandler;
import org.openhab.core.thing.binding.ThingHandlerFactory;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The {@link SonosHandlerFactory} is responsible for creating things and thing
* handlers.
*
* @author Karel Goderis - Initial contribution
*/
@NonNullByDefault
@Component(service = ThingHandlerFactory.class, configurationPid = "binding.sonos")
public class SonosHandlerFactory extends BaseThingHandlerFactory {
private final Logger logger = LoggerFactory.getLogger(SonosHandlerFactory.class);
// Bindings should not use the ThingRegistry! See https://github.com/openhab/openhab-addons/pull/6080 and
// https://github.com/eclipse/smarthome/issues/5182
private final ThingRegistry thingRegistry;
private final UpnpIOService upnpIOService;
private final AudioHTTPServer audioHTTPServer;
private final NetworkAddressService networkAddressService;
private final SonosStateDescriptionOptionProvider stateDescriptionProvider;
private final Map<String, @Nullable ServiceRegistration<AudioSink>> audioSinkRegistrations = new ConcurrentHashMap<>();
// optional OPML URL that can be configured through configuration admin
private @Nullable String opmlUrl;
// url (scheme+server+port) to use for playing notification sounds
private @Nullable String callbackUrl;
@Activate
public SonosHandlerFactory(final @Reference ThingRegistry thingRegistry,
final @Reference UpnpIOService upnpIOService, final @Reference AudioHTTPServer audioHTTPServer,
final @Reference NetworkAddressService networkAddressService,
final @Reference SonosStateDescriptionOptionProvider stateDescriptionProvider) {
this.thingRegistry = thingRegistry;
this.upnpIOService = upnpIOService;
this.audioHTTPServer = audioHTTPServer;
this.networkAddressService = networkAddressService;
this.stateDescriptionProvider = stateDescriptionProvider;
}
@Override
protected void activate(ComponentContext componentContext) {
super.activate(componentContext);
Dictionary<String, Object> properties = componentContext.getProperties();
opmlUrl = (String) properties.get("opmlUrl");
callbackUrl = (String) properties.get("callbackUrl");
}
@Override
public @Nullable Thing createThing(ThingTypeUID thingTypeUID, Configuration configuration,
@Nullable ThingUID thingUID, @Nullable ThingUID bridgeUID) {
if (SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID)) {
ThingUID sonosDeviceUID = getPlayerUID(thingTypeUID, thingUID, configuration);
logger.debug("Creating a sonos thing with ID '{}'", sonosDeviceUID);
return super.createThing(thingTypeUID, configuration, sonosDeviceUID, null);
}
throw new IllegalArgumentException(
"The thing type " + thingTypeUID + " is not supported by the sonos binding.");
}
@Override
public boolean supportsThingType(ThingTypeUID thingTypeUID) {
return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID);
}
@Override
protected @Nullable ThingHandler createHandler(Thing thing) {
ThingTypeUID thingTypeUID = thing.getThingTypeUID();
if (SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID)) {
logger.debug("Creating a ZonePlayerHandler for thing '{}' with UDN '{}'", thing.getUID(),
thing.getConfiguration().get(UDN));
ZonePlayerHandler handler = new ZonePlayerHandler(thingRegistry, thing, upnpIOService, opmlUrl,
stateDescriptionProvider);
// register the speaker as an audio sink
String callbackUrl = createCallbackUrl();
SonosAudioSink audioSink = new SonosAudioSink(handler, audioHTTPServer, callbackUrl);
@SuppressWarnings("unchecked")
ServiceRegistration<AudioSink> reg = (ServiceRegistration<AudioSink>) getBundleContext()
.registerService(AudioSink.class.getName(), audioSink, new Hashtable<>());
audioSinkRegistrations.put(thing.getUID().toString(), reg);
return handler;
}
return null;
}
private @Nullable String createCallbackUrl() {
if (callbackUrl != null) {
return callbackUrl;
} else {
final String ipAddress = networkAddressService.getPrimaryIpv4HostAddress();
if (ipAddress == null) {
logger.warn("No network interface could be found.");
return null;
}
// we do not use SSL as it can cause certificate validation issues.
final int port = HttpServiceUtil.getHttpServicePort(bundleContext);
if (port == -1) {
logger.warn("Cannot find port of the http service.");
return null;
}
return "http://" + ipAddress + ":" + port;
}
}
@Override
public void unregisterHandler(Thing thing) {
super.unregisterHandler(thing);
ServiceRegistration<AudioSink> reg = audioSinkRegistrations.get(thing.getUID().toString());
if (reg != null) {
reg.unregister();
}
}
private ThingUID getPlayerUID(ThingTypeUID thingTypeUID, @Nullable ThingUID thingUID, Configuration configuration) {
if (thingUID != null) {
return thingUID;
} else {
String udn = (String) configuration.get(UDN);
return new ThingUID(thingTypeUID, udn);
}
}
}

View File

@@ -0,0 +1,97 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal;
import org.eclipse.jdt.annotation.NonNullByDefault;
/**
* The {@link SonosMetaData} is a datastructure to the metadata
* of audio in the Sonos ecosystem
*
* @author Karel Goderis - Initial contribution
*/
@NonNullByDefault
public class SonosMetaData {
private final String id;
private final String parentId;
private final String resource;
private final String streamContent;
private final String albumArtUri;
private final String title;
private final String upnpClass;
private final String creator;
private final String album;
private final String albumArtist;
public SonosMetaData(String id, String parentId, String res, String streamContent, String albumArtUri, String title,
String upnpClass, String creator, String album, String albumArtist) {
this.id = id;
this.parentId = parentId;
this.resource = res;
this.streamContent = streamContent;
this.albumArtUri = albumArtUri;
this.title = title;
this.upnpClass = upnpClass;
this.creator = creator;
this.album = album;
this.albumArtist = albumArtist;
}
@Override
public String toString() {
return "SonosMetaData [id=" + id + ", parentID=" + parentId + ", resource=" + resource + " ,streamContent="
+ streamContent + ", arturi=" + albumArtUri + ", title=" + title + ", upnpclass=" + upnpClass
+ ", creator=" + creator + ", album=" + album + ", albumtartist=" + albumArtist + "]";
}
public String getAlbum() {
return album;
}
public String getAlbumArtist() {
return albumArtist;
}
public String getAlbumArtUri() {
return albumArtUri;
}
public String getCreator() {
return creator;
}
public String getResource() {
return resource;
}
public String getStreamContent() {
return streamContent;
}
public String getTitle() {
return title;
}
public String getUpnpClass() {
return upnpClass;
}
public String getId() {
return id;
}
public String getParentId() {
return parentId;
}
}

View File

@@ -0,0 +1,55 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
/**
* The {@link SonosMusicService} is a datastructure to describe a Sonos music service
*
* @author Laurent Garnier - Initial contribution
*/
@NonNullByDefault
public class SonosMusicService {
private String id;
private String name;
private @Nullable Integer type;
public SonosMusicService(String id, String name, @Nullable Integer type) {
this.id = id;
this.name = name;
this.type = type;
}
public SonosMusicService(String id, String name) {
this(id, name, null);
}
public String getId() {
return id;
}
public String getName() {
return name;
}
public @Nullable Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
}

View File

@@ -0,0 +1,93 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal;
import java.io.Serializable;
import org.eclipse.jdt.annotation.NonNullByDefault;
/**
* Contains the resource meta data within a browse response result
* "<r:resMD>..</r:resMD>". This is used for SONOS favorites.
*
* @author Dan Cunningham - Initial contribution
*
*/
@NonNullByDefault
public class SonosResourceMetaData implements Serializable {
private static final long serialVersionUID = 7438424501599637712L;
String id;
String parentId;
String title;
String upnpClass;
String desc;
public SonosResourceMetaData(String id, String parentId, String title, String upnpClass, String desc) {
super();
this.id = id;
this.parentId = parentId;
this.title = title;
this.upnpClass = upnpClass;
this.desc = desc;
}
/**
* The parent id for the resource meta data
*
* @return
*/
public String getId() {
return id;
}
/**
* The parent id for the resource meta data
*
* @return
*/
public String getParentId() {
return parentId;
}
/**
* title from the resource meta data
*
* @return
*/
public String getTitle() {
return title;
}
/**
* The upnp class for the resource meta data. This can be different from the
* parent meta data class and should be used to match the play type over the
* parent value.
*
* @return
*/
public String getUpnpClass() {
return upnpClass;
}
/**
* The desc text for the resource meta data. This contains the service login
* id for streaming accounts (pandora, spotify, etc..)
*
* @return
*/
public String getDesc() {
return desc;
}
}

View File

@@ -0,0 +1,50 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal;
import java.util.List;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.binding.BaseDynamicStateDescriptionProvider;
import org.openhab.core.thing.i18n.ChannelTypeI18nLocalizationService;
import org.openhab.core.thing.type.DynamicStateDescriptionProvider;
import org.openhab.core.types.StateOption;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
/**
* Dynamic provider of state options while leaving other state description fields as original.
*
* @author Laurent Garnier - Initial contribution
*/
@Component(service = { DynamicStateDescriptionProvider.class, SonosStateDescriptionOptionProvider.class })
@NonNullByDefault
public class SonosStateDescriptionOptionProvider extends BaseDynamicStateDescriptionProvider {
public @Nullable List<StateOption> getStateOptions(ChannelUID channelUID) {
return channelOptionsMap.get(channelUID);
}
@Reference
protected void setChannelTypeI18nLocalizationService(
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.channelTypeI18nLocalizationService = channelTypeI18nLocalizationService;
}
protected void unsetChannelTypeI18nLocalizationService(
final ChannelTypeI18nLocalizationService channelTypeI18nLocalizationService) {
this.channelTypeI18nLocalizationService = null;
}
}

View File

@@ -0,0 +1,61 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.jdt.annotation.NonNullByDefault;
/**
* The {@link SonosZoneGroup} is data structure to describe
* Groups of Zone Players in the Sonos ecosystem
*
* @author Karel Goderis - Initial contribution
*/
@NonNullByDefault
public class SonosZoneGroup {
private final List<String> members;
private List<String> memberZoneNames;
private final String coordinator;
private final String id;
public SonosZoneGroup(String id, String coordinator, Collection<String> members,
Collection<String> memberZoneNames) {
this.members = new ArrayList<>(members);
if (!this.members.contains(coordinator)) {
this.members.add(coordinator);
}
this.memberZoneNames = new ArrayList<>(memberZoneNames);
this.coordinator = coordinator;
this.id = id;
}
public List<String> getMembers() {
return members;
}
public List<String> getMemberZoneNames() {
return memberZoneNames;
}
public String getCoordinator() {
return coordinator;
}
public String getId() {
return id;
}
}

View File

@@ -0,0 +1,32 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
/**
* The {@link SonosZonePlayerState} is data structure to describe
* state of a Zone Player
*
* @author Karel Goderis - Initial contribution
*/
@NonNullByDefault
public class SonosZonePlayerState {
public @Nullable String transportState;
public @Nullable String volume;
public @Nullable String relTime;
public @Nullable SonosEntry entry;
public long track;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal.config;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
/**
*
* @author Karel Goderis - Initial contribution
*/
@NonNullByDefault
public class ZonePlayerConfiguration {
public static final String UDN = "udn";
public static final String REFRESH = "refresh";
public static final String NOTIFICATION_TIMEOUT = "notificationTimeout";
public static final String NOTIFICATION_VOLUME = "notificationVolume";
public @Nullable String udn;
public int refresh = 60;
public int notificationTimeout = 20;
public @Nullable Integer notificationVolume;
}

View File

@@ -0,0 +1,123 @@
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.sonos.internal.discovery;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.jupnp.model.meta.RemoteDevice;
import org.openhab.binding.sonos.internal.SonosBindingConstants;
import org.openhab.binding.sonos.internal.SonosXMLParser;
import org.openhab.binding.sonos.internal.config.ZonePlayerConfiguration;
import org.openhab.core.config.discovery.DiscoveryResult;
import org.openhab.core.config.discovery.DiscoveryResultBuilder;
import org.openhab.core.config.discovery.upnp.UpnpDiscoveryParticipant;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.ThingUID;
import org.osgi.service.component.annotations.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The {@link ZonePlayerDiscoveryParticipant} is responsible processing the
* results of searches for UPNP devices
*
* @author Karel Goderis - Initial contribution
*/
@NonNullByDefault
@Component(immediate = true)
public class ZonePlayerDiscoveryParticipant implements UpnpDiscoveryParticipant {
private final Logger logger = LoggerFactory.getLogger(ZonePlayerDiscoveryParticipant.class);
@Override
public Set<ThingTypeUID> getSupportedThingTypeUIDs() {
return SonosBindingConstants.SUPPORTED_THING_TYPES_UIDS;
}
@Override
public @Nullable DiscoveryResult createResult(RemoteDevice device) {
ThingUID uid = getThingUID(device);
if (uid != null) {
String roomName = getSonosRoomName(device);
if (roomName != null) {
Map<String, Object> properties = new HashMap<>(3);
String label = "Sonos device";
try {
label = device.getDetails().getModelDetails().getModelName();
} catch (Exception e) {
// ignore and use default label
}
label += " (" + roomName + ")";
properties.put(ZonePlayerConfiguration.UDN, device.getIdentity().getUdn().getIdentifierString());
properties.put(SonosBindingConstants.IDENTIFICATION, roomName);
DiscoveryResult result = DiscoveryResultBuilder.create(uid).withProperties(properties).withLabel(label)
.withRepresentationProperty(ZonePlayerConfiguration.UDN).build();
logger.debug("Created a DiscoveryResult for device '{}' with UDN '{}'",
device.getDetails().getFriendlyName(), device.getIdentity().getUdn().getIdentifierString());
return result;
}
}
return null;
}
@Override
public @Nullable ThingUID getThingUID(RemoteDevice device) {
if (device.getDetails().getManufacturerDetails().getManufacturer() != null) {
if (device.getDetails().getManufacturerDetails().getManufacturer().toUpperCase().contains("SONOS")) {
String modelName = getModelName(device);
switch (modelName) {
case "ZP80":
modelName = "CONNECT";
break;
case "ZP100":
modelName = "CONNECTAMP";
break;
case "One SL":
modelName = "OneSL";
break;
default:
break;
}
ThingTypeUID thingUID = new ThingTypeUID(SonosBindingConstants.BINDING_ID, modelName);
if (!SonosBindingConstants.SUPPORTED_KNOWN_THING_TYPES_UIDS.contains(thingUID)) {
// Try with the model name all in uppercase
thingUID = new ThingTypeUID(SonosBindingConstants.BINDING_ID, modelName.toUpperCase());
// In case a new "unknown" Sonos player is discovered a generic ThingTypeUID will be used
if (!SonosBindingConstants.SUPPORTED_KNOWN_THING_TYPES_UIDS.contains(thingUID)) {
thingUID = SonosBindingConstants.ZONEPLAYER_THING_TYPE_UID;
}
}
logger.debug("Discovered a Sonos '{}' thing with UDN '{}'", thingUID,
device.getIdentity().getUdn().getIdentifierString());
return new ThingUID(thingUID, device.getIdentity().getUdn().getIdentifierString());
}
}
return null;
}
private String getModelName(RemoteDevice device) {
return SonosXMLParser.extractModelName(device.getDetails().getModelDetails().getModelName());
}
private @Nullable String getSonosRoomName(RemoteDevice device) {
return SonosXMLParser.getRoomName(device.getIdentity().getDescriptorURL().toString());
}
}

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<binding:binding id="sonos" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:binding="https://openhab.org/schemas/binding/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd">
<name>Sonos Binding</name>
<description>This is the binding for the Sonos multi-room audio system.</description>
<author>Karel Goderis</author>
<config-description>
<parameter name="opmlUrl" type="text">
<label>OPML Service URL</label>
<description>URL for the OPML/tunein.com service</description>
<required>false</required>
</parameter>
<parameter name="callbackUrl" type="text">
<label>Callback URL</label>
<description>URL to use for playing notification sounds, e.g. http://192.168.0.2:8080</description>
<required>false</required>
</parameter>
</config-description>
</binding:binding>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<config-description:config-descriptions
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 https://openhab.org/schemas/config-description-1.0.0.xsd">
<config-description uri="thing-type:sonos:zoneplayer">
<parameter name="udn" type="text" required="true">
<label>Unique Device Name</label>
<description>The UDN identifies the Zone Player.</description>
</parameter>
<parameter name="notificationTimeout" type="integer" unit="s">
<label>Notification Timeout</label>
<description>Specifies the amount of time in seconds for which the notification sound will be played</description>
<default>20</default>
</parameter>
<parameter name="notificationVolume" type="integer" min="0" max="100" step="1" unit="%">
<label>Notification Sound Volume</label>
<description>Specifies the volume in percent applied to a notification sound</description>
</parameter>
<parameter name="refresh" type="integer" unit="s">
<label>Refresh Interval</label>
<description>Specifies the refresh interval in seconds</description>
<default>60</default>
</parameter>
</config-description>
</config-description:config-descriptions>

View File

@@ -0,0 +1,4 @@
# Thing status descriptions
offline.conf-error-missing-udn = The parameter "Unique Device Name" must be configured.
offline.upnp-device-not-registered = The UPnP device {0} is not yet registered.
offline.not-available-on-network = The Sonos player {0} is not available in local network.

View File

@@ -0,0 +1,137 @@
# binding
binding.sonos.name = Sonos Binding
binding.sonos.description = Dieses Binding integriert das Home Sound System von Sonos. Durch dieses können Sonos Speaker und Gruppen gesteuert werden.
binding.config.sonos.opmlUrl.label = OPML Service URL
binding.config.sonos.opmlUrl.description = URL für den OPML/tunein.com Service.
binding.config.sonos.callbackUrl.label = Callback URL
binding.config.sonos.callbackUrl.description = URL zum Abspielen von Benachrichtigungen (z.B. http://192.168.0.2:8080).
# thing types
thing-type.sonos.CONNECT.label = CONNECT
thing-type.sonos.CONNECT.description = Dient zur Steuerung von Sonos CONNECT Geräten.
thing-type.sonos.CONNECTAMP.label = CONNECT:AMP
thing-type.sonos.CONNECTAMP.description = Dient zur Steuerung von Sonos CONNECT:AMP Geräten.
thing-type.sonos.PLAY1.label = PLAY:1
thing-type.sonos.PLAY1.description = Dient zur Steuerung von Sonos PLAY:1 Speakern.
thing-type.sonos.PLAY3.label = PLAY:3
thing-type.sonos.PLAY3.description = Dient zur Steuerung von Sonos PLAY:3 Speakern.
thing-type.sonos.PLAY5.label = PLAY:5
thing-type.sonos.PLAY5.description = Dient zur Steuerung von Sonos PLAY:5 Speakern.
thing-type.sonos.PLAYBAR.label = PLAYBAR
thing-type.sonos.PLAYBAR.description = Dient zur Steuerung von Sonos PLAYBAR Speakern.
thing-type.sonos.PLAYBASE.label = PLAYBASE
thing-type.sonos.PLAYBASE.description = Dient zur Steuerung von Sonos PLAYBASE Speakern.
thing-type.sonos.Beam.label = Beam
thing-type.sonos.Beam.description = Dient zur Steuerung von Sonos Beam Speakern.
thing-type.sonos.zoneplayer.label = Gruppen Player
thing-type.sonos.zoneplayer.description = Dient zur Steuerung von unbekannten Sonos Speakern.
thing-type.sonos.One.label = One
thing-type.sonos.One.description = Dient zur Steuerung von Sonos One Speakern.
thing-type.sonos.SYMFONISK.label = SYMFONISK
thing-type.sonos.SYMFONISK.description = Dient zur Steuerung von IKEA SYMFONISK Speakern.
thing-type.config.sonos.zoneplayer.udn.label = Eindeutiger Name (UDN)
thing-type.config.sonos.zoneplayer.udn.description = Der UDN zur Identifizierung des Sonos Gerätes.
thing-type.config.sonos.zoneplayer.notificationTimeout.label = Timeout für Benachrichtigungen
thing-type.config.sonos.zoneplayer.notificationTimeout.description = Timeout für Benachrichtigungen (in Sekunden).
thing-type.config.sonos.zoneplayer.notificationVolume.label = Lautstärke der Benachrichtigung
thing-type.config.sonos.zoneplayer.notificationVolume.description = Lautstärke für Benachrichtigungen (in %).
thing-type.config.sonos.zoneplayer.refresh.label = Abfrageintervall
thing-type.config.sonos.zoneplayer.refresh.description = Intervall zur Abfrage des Sonos Gerätes (in Sekunden).
# channel types
channel-type.sonos.add.label = Hinzufügen
channel-type.sonos.add.description = Fügt den aktuellen Sonos Speaker zur aktuellen Gruppe hinzu.
channel-type.sonos.alarm.label = Alarm aktivieren
channel-type.sonos.alarm.description = Ermöglicht die Aktivierung des Alarms. Alarm Einstellung müssen in der Sonos Controller App erfolgen.
channel-type.sonos.alarmproperties.label = Alarm Einstellungen
channel-type.sonos.alarmproperties.description = Zeigt die Einstellungen des aktuellen Alarms an.
channel-type.sonos.alarmrunning.label = Alarm aktiviert?
channel-type.sonos.alarmrunning.description = Zeigt an, ob der Alarm aktiviert ist.
channel-type.sonos.clearqueue.label = Wiedergabeliste leeren
channel-type.sonos.clearqueue.description = Leert die aktuelle Wiedergabeliste.
channel-type.sonos.coordinator.label = Master
channel-type.sonos.coordinator.description = Zeigt den UDN des Masters der aktuellen Gruppe an.
channel-type.sonos.currentalbum.label = Album
channel-type.sonos.currentalbum.description = Zeigt das Album des aktuellen Stücks an.
channel-type.sonos.currentalbumart.label = Coverbild
channel-type.sonos.currentalbumart.description = Zeigt das Coverbild des aktuellen Stücks an.
channel-type.sonos.currentalbumarturl.label = Coverbild URL
channel-type.sonos.currentalbumarturl.description = Zeigt die URL zum Coverbild des aktuellen Stücks an.
channel-type.sonos.currenttrack.label = Track Name
channel-type.sonos.currenttrack.description = Zeigt den Namen des aktuellen Tracks oder des aktuellen Radiosenders an.
channel-type.sonos.currenttrackuri.label = Track URI
channel-type.sonos.currenttrackuri.description = Zeigt die URI des aktuellen Tracks an.
channel-type.sonos.currenttransporturi.label = AV Transport URI
channel-type.sonos.currenttransporturi.description = Zeigt die URI des aktuellen AV Transportes an.
channel-type.sonos.favorite.label = Favorit
channel-type.sonos.favorite.description = Ermöglicht das Abspielen des eingestellten Favoriten. Einstellung von Favoriten müssen in der Sonos Controller App erfolgen.
channel-type.sonos.led.label = LED
channel-type.sonos.led.description = Ermöglicht die Steuerung der LED des Sonos Speakers.
channel-type.sonos.localcoordinator.label = Lokaler Master
channel-type.sonos.localcoordinator.description = Zeigt an, ob der aktuelle Sonos Speaker Master der aktuellen Gruppe ist.
channel-type.sonos.nightmode.label = Nacht-Modus
channel-type.sonos.nightmode.description = Aktivieren oder deaktivieren Sie die Nachtmodusfunktion
channel-type.sonos.notificationsound.label = Benachrichtigung abspielen
channel-type.sonos.notificationsound.description = Ermöglicht das Abspielen einer Benachrichtigung.
channel-type.sonos.playlist.label = Playlist abspielen
channel-type.sonos.playlist.description = Ermöglicht das Abspielen einer Playlist. Einstellung von Playlisten müssen in der Sonos Controller App erfolgen.
channel-type.sonos.playqueue.label = Wiedergabeliste abspielen
channel-type.sonos.playqueue.description = Ermöglicht das Abspielen der aktuellen Wiedergabeliste.
channel-type.sonos.playtrack.label = Track abspielen
channel-type.sonos.playtrack.description = Ermöglicht das Abspielen eines Tracks.
channel-type.sonos.playuri.label = URI abspielen
channel-type.sonos.playuri.description = Ermöglicht das Abspielen einer URI.
channel-type.sonos.publicaddress.label = Öffentliche Adresse
channel-type.sonos.publicaddress.description = Fügt alle Sonos Geräte in eine neue Gruppe und spielt die Line-in Quelle des aktuellen Sonos Speakers ab.
channel-type.sonos.radio.label = Radiosender
channel-type.sonos.radio.description = Ermöglicht das Abspielen eines Radiosenders. Einstellung von Radiosendern müssen in der Sonos Controller App erfolgen.
channel-type.sonos.remove.label = Entfernen
channel-type.sonos.remove.description = Entfernt den aktuellen Sonos Speaker aus der aktuellen Gruppe.
channel-type.sonos.repeat.label = Wiederholen
channel-type.sonos.repeat.description = Ermöglicht die Wiederholung des aktuellen Stücks oder der aktuellen Wiedergabeliste.
channel-type.sonos.repeat.state.option.OFF = Aus
channel-type.sonos.repeat.state.option.ONE = Stück
channel-type.sonos.repeat.state.option.ALL = Wiedergabeliste
channel-type.sonos.restore.label = Wiederherstellen
channel-type.sonos.restore.description = Stellt den Status des aktuellen Sonos Speaker wieder her.
channel-type.sonos.restoreall.label = Alle wiederherstellen
channel-type.sonos.restoreall.description = Stellt den Status aller Sonos Speaker wieder her.
channel-type.sonos.save.label = Speichern
channel-type.sonos.save.description = Speichert den Status des aktuellen Sonos Speakers.
channel-type.sonos.saveall.label = Alle speichern
channel-type.sonos.saveall.description = Speichert den Status aller Sonos Speaker.
channel-type.sonos.shuffle.label = Shuffle
channel-type.sonos.shuffle.description = Ermöglicht das Abspielen der aktuellen Wiedergabeliste in zufälliger Reihenfolge.
channel-type.sonos.sleeptimer.label = Sleep Timer
channel-type.sonos.sleeptimer.description = (Ein-)Schlaffunktion (in Sekunden).
channel-type.sonos.snooze.label = Snooze
channel-type.sonos.snooze.description = Ermöglicht die Snooze-Funktion für den aktuellen Alarm (in Minuten).
channel-type.sonos.speechenhancement.label = Sprachverbesserung
channel-type.sonos.speechenhancement.description = Aktivieren oder deaktivieren Sie die Sprachverbesserungsfunktion
channel-type.sonos.standalone.label = Stand-Alone
channel-type.sonos.standalone.description = Entfernt den aktuellen Sonos Speaker aus der aktuellen Gruppe und stellt ihn als Stand-Alone Speaker bereit.
channel-type.sonos.state.label = Status
channel-type.sonos.state.description = Zeigt den Status des Sonos Speakers an (z.B. spielt, gestoppt, ...)
channel-type.sonos.state.state.option.STOPPED = Gestoppt
channel-type.sonos.state.state.option.PLAYING = Spielt
channel-type.sonos.state.state.option.PAUSED_PLAYBACK = Pausiert
channel-type.sonos.state.state.option.TRANSITIONING = Übergang
channel-type.sonos.stop.label = Stop
channel-type.sonos.stop.description = Ermöglicht das Stoppen der Wiedergabe.
channel-type.sonos.tuneinstationid.label = TuneIn Sender Id
channel-type.sonos.tuneinstationid.description = Zeigt die aktuelle TuneIn Sender Id an.
channel-type.sonos.zonegroupid.label = Id der Gruppe
channel-type.sonos.zonegroupid.description = Zeigt die Id der aktuellen Gruppe an.
channel-type.sonos.zonename.label = Name der Gruppe
channel-type.sonos.zonename.description = Zeigt den Namen der aktuellen Gruppe an.
channel-type.sonos.linein.label = Line-in
channel-type.sonos.linein.description = Zeigt an, ob die Line-In Quelle des Sonos Speaker angeschlossen ist.
channel-type.sonos.playlinein.label = Line-in abspielen
channel-type.sonos.playlinein.description = Ermöglicht das Abspielen der Line-in Quelle.
# Thing status descriptions
offline.conf-error-missing-udn = Der Parameter "Eindeutiger Name (UDN)" muss konfiguriert werden.
offline.upnp-device-not-registered = Der UPnP Speaker {0} ist nicht registriert.
offline.not-available-on-network = Der Sonos Speaker {0} ist nicht im Netzwerk verfügbar.

View File

@@ -0,0 +1,137 @@
# binding
binding.sonos.name = Sonos Binding
binding.sonos.description = Dieses Binding integriert das Home Sound System von Sonos. Durch dieses können Sonos Speaker und Gruppen gesteuert werden.
binding.config.sonos.opmlUrl.label = OPML Service URL
binding.config.sonos.opmlUrl.description = URL für den OPML/tunein.com Service.
binding.config.sonos.callbackUrl.label = Callback URL
binding.config.sonos.callbackUrl.description = URL zum Abspielen von Benachrichtigungen (z.B. http://192.168.0.2:8080).
# thing types
thing-type.sonos.CONNECT.label = CONNECT
thing-type.sonos.CONNECT.description = Dient zur Steuerung von Sonos CONNECT Geräten.
thing-type.sonos.CONNECTAMP.label = CONNECT:AMP
thing-type.sonos.CONNECTAMP.description = Dient zur Steuerung von Sonos CONNECT:AMP Geräten.
thing-type.sonos.PLAY1.label = PLAY:1
thing-type.sonos.PLAY1.description = Dient zur Steuerung von Sonos PLAY:1 Speakern.
thing-type.sonos.PLAY3.label = PLAY:3
thing-type.sonos.PLAY3.description = Dient zur Steuerung von Sonos PLAY:3 Speakern.
thing-type.sonos.PLAY5.label = PLAY:5
thing-type.sonos.PLAY5.description = Dient zur Steuerung von Sonos PLAY:5 Speakern.
thing-type.sonos.PLAYBAR.label = PLAYBAR
thing-type.sonos.PLAYBAR.description = Dient zur Steuerung von Sonos PLAYBAR Speakern.
thing-type.sonos.PLAYBASE.label = PLAYBASE
thing-type.sonos.PLAYBASE.description = Dient zur Steuerung von Sonos PLAYBASE Speakern.
thing-type.sonos.Beam.label = Beam
thing-type.sonos.Beam.description = Dient zur Steuerung von Sonos Beam Speakern.
thing-type.sonos.zoneplayer.label = Gruppen Player
thing-type.sonos.zoneplayer.description = Dient zur Steuerung von unbekannten Sonos Speakern.
thing-type.sonos.One.label = One
thing-type.sonos.One.description = Dient zur Steuerung von Sonos One Speakern.
thing-type.sonos.SYMFONISK.label = SYMFONISK
thing-type.sonos.SYMFONISK.description = Dient zur Steuerung von IKEA SYMFONISK Speakern.
thing-type.config.sonos.zoneplayer.udn.label = Eindeutiger Name (UDN)
thing-type.config.sonos.zoneplayer.udn.description = Der UDN zur Identifizierung des Sonos Gerätes.
thing-type.config.sonos.zoneplayer.notificationTimeout.label = Timeout für Benachrichtigungen
thing-type.config.sonos.zoneplayer.notificationTimeout.description = Timeout für Benachrichtigungen (in Sekunden).
thing-type.config.sonos.zoneplayer.notificationVolume.label = Lautstärke der Benachrichtigung
thing-type.config.sonos.zoneplayer.notificationVolume.description = Lautstärke für Benachrichtigungen (in %).
thing-type.config.sonos.zoneplayer.refresh.label = Abfrageintervall
thing-type.config.sonos.zoneplayer.refresh.description = Intervall zur Abfrage des Sonos Gerätes (in Sekunden).
# channel types
channel-type.sonos.add.label = Hinzufügen
channel-type.sonos.add.description = Fügt den aktuellen Sonos Speaker zur aktuellen Gruppe hinzu.
channel-type.sonos.alarm.label = Alarm aktivieren
channel-type.sonos.alarm.description = Ermöglicht die Aktivierung des Alarms. Alarm Einstellung müssen in der Sonos Controller App erfolgen.
channel-type.sonos.alarmproperties.label = Alarm Einstellungen
channel-type.sonos.alarmproperties.description = Zeigt die Einstellungen des aktuellen Alarms an.
channel-type.sonos.alarmrunning.label = Alarm aktiviert?
channel-type.sonos.alarmrunning.description = Zeigt an, ob der Alarm aktiviert ist.
channel-type.sonos.clearqueue.label = Wiedergabeliste leeren
channel-type.sonos.clearqueue.description = Leert die aktuelle Wiedergabeliste.
channel-type.sonos.coordinator.label = Master
channel-type.sonos.coordinator.description = Zeigt den UDN des Masters der aktuellen Gruppe an.
channel-type.sonos.currentalbum.label = Album
channel-type.sonos.currentalbum.description = Zeigt das Album des aktuellen Stücks an.
channel-type.sonos.currentalbumart.label = Coverbild
channel-type.sonos.currentalbumart.description = Zeigt das Coverbild des aktuellen Stücks an.
channel-type.sonos.currentalbumarturl.label = Coverbild URL
channel-type.sonos.currentalbumarturl.description = Zeigt die URL zum Coverbild des aktuellen Stücks an.
channel-type.sonos.currenttrack.label = Track Name
channel-type.sonos.currenttrack.description = Zeigt den Namen des aktuellen Tracks oder des aktuellen Radiosenders an.
channel-type.sonos.currenttrackuri.label = Track URI
channel-type.sonos.currenttrackuri.description = Zeigt die URI des aktuellen Tracks an.
channel-type.sonos.currenttransporturi.label = AV Transport URI
channel-type.sonos.currenttransporturi.description = Zeigt die URI des aktuellen AV Transportes an.
channel-type.sonos.favorite.label = Favorit
channel-type.sonos.favorite.description = Ermöglicht das Abspielen des eingestellten Favoriten. Einstellung von Favoriten müssen in der Sonos Controller App erfolgen.
channel-type.sonos.led.label = LED
channel-type.sonos.led.description = Ermöglicht die Steuerung der LED des Sonos Speakers.
channel-type.sonos.localcoordinator.label = Lokaler Master
channel-type.sonos.localcoordinator.description = Zeigt an, ob der aktuelle Sonos Speaker Master der aktuellen Gruppe ist.
channel-type.sonos.nightmode.label = Nacht-Modus
channel-type.sonos.nightmode.description = Aktivieren oder deaktivieren Sie die Nachtmodusfunktion
channel-type.sonos.notificationsound.label = Benachrichtigung abspielen
channel-type.sonos.notificationsound.description = Ermöglicht das Abspielen einer Benachrichtigung.
channel-type.sonos.playlist.label = Playlist abspielen
channel-type.sonos.playlist.description = Ermöglicht das Abspielen einer Playlist. Einstellung von Playlisten müssen in der Sonos Controller App erfolgen.
channel-type.sonos.playqueue.label = Wiedergabeliste abspielen
channel-type.sonos.playqueue.description = Ermöglicht das Abspielen der aktuellen Wiedergabeliste.
channel-type.sonos.playtrack.label = Track abspielen
channel-type.sonos.playtrack.description = Ermöglicht das Abspielen eines Tracks.
channel-type.sonos.playuri.label = URI abspielen
channel-type.sonos.playuri.description = Ermöglicht das Abspielen einer URI.
channel-type.sonos.publicaddress.label = Öffentliche Adresse
channel-type.sonos.publicaddress.description = Fügt alle Sonos Geräte in eine neue Gruppe und spielt die Line-in Quelle des aktuellen Sonos Speakers ab.
channel-type.sonos.radio.label = Radiosender
channel-type.sonos.radio.description = Ermöglicht das Abspielen eines Radiosenders. Einstellung von Radiosendern müssen in der Sonos Controller App erfolgen.
channel-type.sonos.remove.label = Entfernen
channel-type.sonos.remove.description = Entfernt den aktuellen Sonos Speaker aus der aktuellen Gruppe.
channel-type.sonos.repeat.label = Wiederholen
channel-type.sonos.repeat.description = Ermöglicht die Wiederholung des aktuellen Stücks oder der aktuellen Wiedergabeliste.
channel-type.sonos.repeat.state.option.OFF = Aus
channel-type.sonos.repeat.state.option.ONE = Stück
channel-type.sonos.repeat.state.option.ALL = Wiedergabeliste
channel-type.sonos.restore.label = Wiederherstellen
channel-type.sonos.restore.description = Stellt den Status des aktuellen Sonos Speaker wieder her.
channel-type.sonos.restoreall.label = Alle wiederherstellen
channel-type.sonos.restoreall.description = Stellt den Status aller Sonos Speaker wieder her.
channel-type.sonos.save.label = Speichern
channel-type.sonos.save.description = Speichert den Status des aktuellen Sonos Speakers.
channel-type.sonos.saveall.label = Alle speichern
channel-type.sonos.saveall.description = Speichert den Status aller Sonos Speaker.
channel-type.sonos.shuffle.label = Shuffle
channel-type.sonos.shuffle.description = Ermöglicht das Abspielen der aktuellen Wiedergabeliste in zufälliger Reihenfolge.
channel-type.sonos.sleeptimer.label = Sleep Timer
channel-type.sonos.sleeptimer.description = (Ein-)Schlaffunktion (in Sekunden).
channel-type.sonos.snooze.label = Snooze
channel-type.sonos.snooze.description = Ermöglicht die Snooze-Funktion für den aktuellen Alarm (in Minuten).
channel-type.sonos.speechenhancement.label = Sprachverbesserung
channel-type.sonos.speechenhancement.description = Aktivieren oder deaktivieren Sie die Sprachverbesserungsfunktion
channel-type.sonos.standalone.label = Stand-Alone
channel-type.sonos.standalone.description = Entfernt den aktuellen Sonos Speaker aus der aktuellen Gruppe und stellt ihn als Stand-Alone Speaker bereit.
channel-type.sonos.state.label = Status
channel-type.sonos.state.description = Zeigt den Status des Sonos Speakers an (z.B. spielt, gestoppt, ...)
channel-type.sonos.state.state.option.STOPPED = Gestoppt
channel-type.sonos.state.state.option.PLAYING = Spielt
channel-type.sonos.state.state.option.PAUSED_PLAYBACK = Pausiert
channel-type.sonos.state.state.option.TRANSITIONING = Übergang
channel-type.sonos.stop.label = Stop
channel-type.sonos.stop.description = Ermöglicht das Stoppen der Wiedergabe.
channel-type.sonos.tuneinstationid.label = TuneIn Sender Id
channel-type.sonos.tuneinstationid.description = Zeigt die aktuelle TuneIn Sender Id an.
channel-type.sonos.zonegroupid.label = Id der Gruppe
channel-type.sonos.zonegroupid.description = Zeigt die Id der aktuellen Gruppe an.
channel-type.sonos.zonename.label = Name der Gruppe
channel-type.sonos.zonename.description = Zeigt den Namen der aktuellen Gruppe an.
channel-type.sonos.linein.label = Line-in
channel-type.sonos.linein.description = Zeigt an, ob die Line-In Quelle des Sonos Speaker angeschlossen ist.
channel-type.sonos.playlinein.label = Line-in abspielen
channel-type.sonos.playlinein.description = Ermöglicht das Abspielen der Line-in Quelle.
# Thing status descriptions
offline.conf-error-missing-udn = Der Parameter "Eindeutiger Name (UDN)" muss konfiguriert werden.
offline.upnp-device-not-registered = Der UPnP Speaker {0} ist nicht registriert.
offline.not-available-on-network = Der Sonos Speaker {0} ist nicht im Netzwerk verfügbar.

View File

@@ -0,0 +1,136 @@
# binding
binding.sonos.name = Extension Sonos
binding.sonos.description = Il s'agit de l'extension pour le système audio multiroom Sonos.
binding.config.sonos.opmlUrl.label = URL service OPML
binding.config.sonos.opmlUrl.description = URL pour le service OPML/tunein.com
binding.config.sonos.callbackUrl.label = URL callback
binding.config.sonos.callbackUrl.description = URL à utiliser pour les notifications sonores, par ex. http://192.168.0.2:8080
# thing types
thing-type.sonos.CONNECT.label = CONNECT
thing-type.sonos.CONNECT.description = Représente un lecteur pré-ampli Sonos CONNECT
thing-type.sonos.CONNECTAMP.label = CONNECT:AMP
thing-type.sonos.CONNECTAMP.description = Représente un lecteur ampli Sonos CONNECT:AMP
thing-type.sonos.PLAY1.label = PLAY:1
thing-type.sonos.PLAY1.description = Représente une enceinte Sonos PLAY:1
thing-type.sonos.PLAY3.label = PLAY:3
thing-type.sonos.PLAY3.description = Représente une enceinte Sonos PLAY:3
thing-type.sonos.PLAY5.label = PLAY:5
thing-type.sonos.PLAY5.description = Représente une enceinte Sonos PLAY:5
thing-type.sonos.PLAYBAR.label = PLAYBAR
thing-type.sonos.PLAYBAR.description = Représente une barre de son Sonos PLAYBAR
thing-type.sonos.PLAYBASE.label = PLAYBASE
thing-type.sonos.PLAYBASE.description = Représente une barre de son Sonos PLAYBASE
thing-type.sonos.Beam.label = Beam
thing-type.sonos.Beam.description = Représente une barre de son Sonos Beam
thing-type.sonos.zoneplayer.label = Autre Sonos
thing-type.sonos.zoneplayer.description = Représente un équipement Sonos inconnu de l'extension
thing-type.sonos.One.label = One
thing-type.sonos.One.description = Represente une enceinte Sonos One
thing-type.sonos.SYMFONISK.label = SYMFONISK
thing-type.sonos.SYMFONISK.description = Represente une enceinte meuble IKEA SYMFONISK
thing-type.config.sonos.zoneplayer.udn.label = Nom unique (UDN)
thing-type.config.sonos.zoneplayer.udn.description = Identifie de manière unique un Sonos
thing-type.config.sonos.zoneplayer.notificationTimeout.label = Délai max de notification
thing-type.config.sonos.zoneplayer.notificationTimeout.description = Spécifie le délai maximum en secondes pendant lequel les notifications sonores sont lues
thing-type.config.sonos.zoneplayer.notificationVolume.label = Volume notification sonore
thing-type.config.sonos.zoneplayer.notificationVolume.description = Définit le volume utilisé pour une notification sonore
thing-type.config.sonos.zoneplayer.refresh.label = Fréquence de rafraîchissement
thing-type.config.sonos.zoneplayer.refresh.description = Spécifie la fréquence de rafraîchissement en secondes
# channel types
channel-type.sonos.add.label = Ajoute au groupe
channel-type.sonos.add.description = Ajoute le Sonos désigné au groupe de ce Sonos
channel-type.sonos.alarm.label = Active l'alarme
channel-type.sonos.alarm.description = Active la première alarme (qu'elle soit déjà active ou pas). Des alarmes doivent avoir d'abord été définies avec l'application Sonos
channel-type.sonos.alarmproperties.label = Caractéristiques alarme
channel-type.sonos.alarmproperties.description = Les caractéristiques de l'alarme en cours
channel-type.sonos.alarmrunning.label = Alarme en cours
channel-type.sonos.alarmrunning.description = Indique si une alarme est en cours
channel-type.sonos.clearqueue.label = Vide la file d'attente
channel-type.sonos.clearqueue.description = Supprime toutes les chansons de la file d'attente
channel-type.sonos.coordinator.label = Coordinateur du groupe
channel-type.sonos.coordinator.description = L'identifiant du Sonos qui coordonne le groupe actuel
channel-type.sonos.currentalbum.label = Album
channel-type.sonos.currentalbum.description = Le nom de l'album en cours de lecture
channel-type.sonos.currentalbumart.label = Pochette album
channel-type.sonos.currentalbumart.description = La pochette de l'album en cours de lecture
channel-type.sonos.currentalbumarturl.label = URL pochette album
channel-type.sonos.currentalbumarturl.description = L'URL de la pochette de l'album en cours de lecture
channel-type.sonos.currenttrack.label = Piste
channel-type.sonos.currenttrack.description = La piste ou la station de radio en cours de lecture
channel-type.sonos.currenttrackuri.label = URI piste
channel-type.sonos.currenttrackuri.description = l'URI de la piste en cours
channel-type.sonos.currenttransporturi.label = URI transport AV
channel-type.sonos.currenttransporturi.description = L'URI du transport AV en cours
channel-type.sonos.favorite.label = Lit un favori
channel-type.sonos.favorite.description = Lit le favori Sonos désigné. Le favori Sonos doit d'abord avoir été défini avec l'application Sonos
channel-type.sonos.led.label = Led
channel-type.sonos.led.description = Indique ou modifie l'état de la Led blanche en façade de ce Sonos
channel-type.sonos.localcoordinator.label = Coordonne le groupe
channel-type.sonos.localcoordinator.description = Indique si ce Sonos est le coordinateur du groupe
channel-type.sonos.nightmode.label = Mode nuit
channel-type.sonos.nightmode.description = Active ou désactive le mode nuit
channel-type.sonos.notificationsound.label = Lit une notification sonore
channel-type.sonos.notificationsound.description = Lit la notification sonore désignée par l'URI fournie
channel-type.sonos.playlist.label = Lit une liste de lecture
channel-type.sonos.playlist.description = Lit la liste de lecture désignée. La liste de lecture doit d'abord avoir été définie avec l'application Sonos
channel-type.sonos.playqueue.label = Lit la file d'attente
channel-type.sonos.playqueue.description = Lit les chansons dans la file d'attente
channel-type.sonos.playtrack.label = Lit une piste
channel-type.sonos.playtrack.description = Lit le numéro de piste désigné de la file d'attente
channel-type.sonos.playuri.label = Lit une URI
channel-type.sonos.playuri.description = Lit l'URI désignée
channel-type.sonos.publicaddress.label = Adresse publique
channel-type.sonos.publicaddress.description = Crée un groupe avec tous les Sonos et lit l'entrée source locale du Sonos qui reçoit cette commande
channel-type.sonos.radio.label = Lit une station radio
channel-type.sonos.radio.description = Lit la station radio favorite désignée. Les station favorites doivent d'abord avoir été définies avec l'application Sonos
channel-type.sonos.remove.label = Retire du groupe
channel-type.sonos.remove.description = Retire le Sonos désigné de son groupe
channel-type.sonos.repeat.label = Mode de répétition
channel-type.sonos.repeat.description = Indique ou modifie le mode de répétition (sans, piste, file)
channel-type.sonos.repeat.state.option.OFF = Sans
channel-type.sonos.repeat.state.option.ONE = Piste
channel-type.sonos.repeat.state.option.ALL = File
channel-type.sonos.restore.label = Restaure l'état
channel-type.sonos.restore.description = Restaure l'état sauvegardé de ce Sonos
channel-type.sonos.restoreall.label = Restaure l'état de tous les Sonos
channel-type.sonos.restoreall.description = Restaure l'état sauvegardé de chaque Sonos
channel-type.sonos.save.label = Sauve l'état
channel-type.sonos.save.description = Sauve l'état actuel de ce Sonos
channel-type.sonos.saveall.label = Sauve l'état de tous les Sonos
channel-type.sonos.saveall.description = Sauve l'état actuel de chaque Sonos
channel-type.sonos.shuffle.label = Mode de lecture aléatoire
channel-type.sonos.shuffle.description = Indique pu modifie le mode aléatoire de lecture des pistes de la file d'attente
channel-type.sonos.sleeptimer.label = Horloge de veille
channel-type.sonos.sleeptimer.description = Indique ou définit le temps restant en secondes avant la mise en veille de ce Sonos
channel-type.sonos.snooze.label = Gèle l'alarme
channel-type.sonos.snooze.description = Gèle l'alarme en cours du nombre de minutes précisé
channel-type.sonos.speechenhancement.label = Amélioration des dialogues
channel-type.sonos.speechenhancement.description = Active ou désactive la fonction d'amélioration des dialogues
channel-type.sonos.standalone.label = Lecteur autonome
channel-type.sonos.standalone.description = Sort ce Sonos de tout groupe et le rend autonome
channel-type.sonos.state.label = Etat du lecteur
channel-type.sonos.state.description = Etat de lecture de ce Sonos, par exemple lecture, stop,...
channel-type.sonos.state.state.option.STOPPED = Stop
channel-type.sonos.state.state.option.PLAYING = Lecture
channel-type.sonos.state.state.option.PAUSED_PLAYBACK = Pause
channel-type.sonos.state.state.option.TRANSITIONING = Transition
channel-type.sonos.stop.label = Stop lecture
channel-type.sonos.stop.description = Stoppe la lecture par ce Sonos
channel-type.sonos.tuneinstationid.label = Id radio TuneIn
channel-type.sonos.tuneinstationid.description = Fournit l'id de radio TuneIn en cours ou lit la radio TuneIn à partir de son id de station
channel-type.sonos.zonegroupid.label = Zone Group ID
channel-type.sonos.zonegroupid.description = Identifiant du groupe auquel appartient ce Sonos
channel-type.sonos.zonename.label = Pièce
channel-type.sonos.zonename.description = Pièce associée à ce Sonos
channel-type.sonos.linein.label = Entrée source connectée
channel-type.sonos.linein.description = Indique si l'entrée source locale de ce Sonos est connectée
channel-type.sonos.playlinein.label = Lit une entrée source
channel-type.sonos.playlinein.description = Lit l'entrée source du Sonos désigné
# Thing status descriptions
offline.conf-error-missing-udn = Le paramètre "Nom unique (UDN)" doit être configuré.
offline.upnp-device-not-registered = Le périphérique UPnP {0} n''est pas encore découvert.
offline.not-available-on-network = Le lecteur Sonos {0} n''est pas disponible sur le réseau local.

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Amplifier Amp Thing Type -->
<thing-type id="Amp" listed="false">
<!-- Label without column (:) because of device pairing name restrictions -->
<label>Amp</label>
<description>Represents SONOS Amp amplifier</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
<!-- Extended SONOS channels -->
<channel id="analoglinein" typeId="linein"/>
<channel id="publicanalogaddress" typeId="publicaddress"/>
<channel id="digitallinein" typeId="linein"/>
<channel id="publicdigitaladdress" typeId="publicaddress"/>
<channel id="nightmode" typeId="nightmode"/>
<channel id="speechenhancement" typeId="speechenhancement"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">Amp</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Soundbar Beam Thing Type -->
<thing-type id="Beam" listed="false">
<label>Beam</label>
<description>Represents SONOS Beam soundbar</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="publicaddress" typeId="publicaddress"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
<!-- Extended SONOS channels -->
<channel id="linein" typeId="linein"/>
<channel id="nightmode" typeId="nightmode"/>
<channel id="speechenhancement" typeId="speechenhancement"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">Beam</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Connector CONNECT Thing Type -->
<thing-type id="CONNECT" listed="false">
<label>CONNECT</label>
<description>Represents SONOS CONNECT connector</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="publicaddress" typeId="publicaddress"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
<!-- Extended SONOS channels -->
<channel id="linein" typeId="linein"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">CONNECT</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Amplifier CONNECT:AMP Thing Type -->
<thing-type id="CONNECTAMP" listed="false">
<!-- Label without column (:) because of device pairing name restrictions -->
<label>CONNECT AMP</label>
<description>Represents SONOS CONNECT:AMP amplifier</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="publicaddress" typeId="publicaddress"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
<!-- Extended SONOS channels -->
<channel id="linein" typeId="linein"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">CONNECT:AMP</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Player One Thing Type -->
<thing-type id="One" listed="false">
<!-- Label without column (:) because of device pairing name restrictions -->
<label>One</label>
<description>Represents SONOS One Zone Player</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="publicaddress" typeId="publicaddress"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
<channel id="speechenhancement" typeId="speechenhancement"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">One</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Player One SL Thing Type -->
<thing-type id="OneSL" listed="false">
<!-- Label without column (:) because of device pairing name restrictions -->
<label>One SL</label>
<description>Represents SONOS One SL Zone Player</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="publicaddress" typeId="publicaddress"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">One SL</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Player PLAY:1 Thing Type -->
<thing-type id="PLAY1" listed="false">
<!-- Label without column (:) because of device pairing name restrictions -->
<label>PLAY 1</label>
<description>Represents SONOS PLAY:1 Zone Player</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="publicaddress" typeId="publicaddress"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">PLAY:1</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Player PLAY:3 Thing Type -->
<thing-type id="PLAY3" listed="false">
<!-- Label without column (:) because of device pairing name restrictions -->
<label>PLAY 3</label>
<description>Represents SONOS PLAY:3 Zone Player</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="publicaddress" typeId="publicaddress"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">PLAY:3</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Player PLAY:5 Thing Type -->
<thing-type id="PLAY5" listed="false">
<!-- Label without column (:) because of device pairing name restrictions -->
<label>PLAY 5</label>
<description>Represents SONOS PLAY:5 Zone Player</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="publicaddress" typeId="publicaddress"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
<!-- Extended SONOS channels -->
<channel id="linein" typeId="linein"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">PLAY:5</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Soundbar PLAYBAR Thing Type -->
<thing-type id="PLAYBAR" listed="false">
<label>PLAYBAR</label>
<description>Represents SONOS PLAYBAR soundbar</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="publicaddress" typeId="publicaddress"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
<!-- Extended SONOS channels -->
<channel id="linein" typeId="linein"/>
<channel id="nightmode" typeId="nightmode"/>
<channel id="speechenhancement" typeId="speechenhancement"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">PLAYBAR</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Soundbar PLAYBASE Thing Type -->
<thing-type id="PLAYBASE" listed="false">
<label>PLAYBASE</label>
<description>Represents SONOS PLAYBASE soundbar</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="publicaddress" typeId="publicaddress"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
<!-- Extended SONOS channels -->
<channel id="linein" typeId="linein"/>
<channel id="nightmode" typeId="nightmode"/>
<channel id="speechenhancement" typeId="speechenhancement"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">PLAYBASE</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Sonos Port Thing Type -->
<thing-type id="Port" listed="false">
<label>Port</label>
<description>Represents SONOS Port connector</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="publicaddress" typeId="publicaddress"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
<!-- Extended SONOS channels -->
<channel id="linein" typeId="linein"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">Port</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- SYMFONISK Thing Type -->
<thing-type id="SYMFONISK" listed="false">
<label>SYMFONISK</label>
<description>Represents IKEA SYMFONISK speaker</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
</channels>
<properties>
<property name="vendor">IKEA</property>
<property name="modelId">SYMFONISK</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Generic Unknown Player Thing Type -->
<thing-type id="zoneplayer">
<!-- Label without column (:) because of device pairing name restrictions -->
<label>Zone Player</label>
<description>The Zone Player represents a Sonos Zone Player which is not known to this binding</description>
<channels>
<channel id="add" typeId="add"/>
<channel id="alarm" typeId="alarm"/>
<channel id="alarmproperties" typeId="alarmproperties"/>
<channel id="alarmrunning" typeId="alarmrunning"/>
<channel id="control" typeId="system.media-control"/>
<channel id="currentalbum" typeId="currentalbum"/>
<channel id="currentalbumart" typeId="currentalbumart"/>
<channel id="currentalbumarturl" typeId="currentalbumarturl"/>
<channel id="currentartist" typeId="system.media-artist"/>
<channel id="currenttitle" typeId="system.media-title"/>
<channel id="currenttrack" typeId="currenttrack"/>
<channel id="shuffle" typeId="shuffle"/>
<channel id="repeat" typeId="repeat"/>
<channel id="favorite" typeId="favorite"/>
<channel id="led" typeId="led"/>
<channel id="localcoordinator" typeId="localcoordinator"/>
<channel id="mute" typeId="system.mute"/>
<channel id="notificationsound" typeId="notificationsound"/>
<channel id="playlist" typeId="playlist"/>
<channel id="clearqueue" typeId="clearqueue"/>
<channel id="playlinein" typeId="playlinein"/>
<channel id="playqueue" typeId="playqueue"/>
<channel id="playtrack" typeId="playtrack"/>
<channel id="playuri" typeId="playuri"/>
<channel id="publicaddress" typeId="publicaddress"/>
<channel id="radio" typeId="radio"/>
<channel id="remove" typeId="remove"/>
<channel id="restore" typeId="restore"/>
<channel id="restoreall" typeId="restoreall"/>
<channel id="save" typeId="save"/>
<channel id="saveall" typeId="saveall"/>
<channel id="snooze" typeId="snooze"/>
<channel id="standalone" typeId="standalone"/>
<channel id="state" typeId="state"/>
<channel id="stop" typeId="stop"/>
<channel id="tuneinstationid" typeId="tuneinstationid"/>
<channel id="volume" typeId="system.volume"/>
<channel id="zonegroupid" typeId="zonegroupid"/>
<channel id="zonename" typeId="zonename"/>
<channel id="coordinator" typeId="coordinator"/>
<channel id="sleeptimer" typeId="sleeptimer"/>
<channel id="currenttransporturi" typeId="currenttransporturi"/>
<channel id="currenttrackuri" typeId="currenttrackuri"/>
</channels>
<properties>
<property name="vendor">SONOS</property>
<property name="modelId">ZonePlayer</property>
</properties>
<representation-property>udn</representation-property>
<config-description-ref uri="thing-type:sonos:zoneplayer"/>
</thing-type>
</thing:thing-descriptions>

View File

@@ -0,0 +1,288 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="sonos"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">
<!-- Channels common for all SONOS devices -->
<channel-type id="add" advanced="true">
<item-type>String</item-type>
<label>Add</label>
<description>Add the given Zone Player to the group of this Zone Player</description>
</channel-type>
<channel-type id="alarm" advanced="true">
<item-type>Switch</item-type>
<label>Set Alarm</label>
<description>Set the first occurring alarm either ON or OFF. Alarms first have to be defined through the Sonos
Controller app</description>
</channel-type>
<channel-type id="alarmproperties" advanced="true">
<item-type>String</item-type>
<label>Alarm Properties</label>
<description>Properties of the alarm currently running</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="alarmrunning" advanced="true">
<item-type>Switch</item-type>
<label>Alarm Is Running</label>
<description>Set to ON if the alarm was triggered</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="clearqueue" advanced="true">
<item-type>Switch</item-type>
<label>Clear Queue</label>
<description>Suppress all songs from the current queue</description>
</channel-type>
<channel-type id="coordinator" advanced="true">
<item-type>String</item-type>
<label>Coordinator</label>
<description>UDN of the coordinator for the current group</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="currentalbum">
<item-type>String</item-type>
<label>Current Album</label>
<description>Name of the album currently playing</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="currentalbumart">
<item-type>Image</item-type>
<label>Current Album Cover Art</label>
<description>Cover art of the album currently playing</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="currentalbumarturl" advanced="true">
<item-type>String</item-type>
<label>Current Album Cover Art URL</label>
<description>Cover art URL of the album currently playing</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="currenttrack" advanced="true">
<item-type>String</item-type>
<label>Current Track</label>
<description>Name of the current track or radio station currently playing</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="currenttrackuri" advanced="true">
<item-type>String</item-type>
<label>Current Track URI</label>
<description>URI of the current track</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="currenttransporturi" advanced="true">
<item-type>String</item-type>
<label>Current AV Transport URI</label>
<description>URI of the current AV transport</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="favorite" advanced="true">
<item-type>String</item-type>
<label>Favorite</label>
<description>Play the given favorite entry. The favorite entry has to be predefined in the Sonos Controller app</description>
</channel-type>
<channel-type id="led" advanced="true">
<item-type>Switch</item-type>
<label>Led</label>
<description>Set or get the status of the white led on the front of the Zone Player</description>
</channel-type>
<channel-type id="localcoordinator" advanced="true">
<item-type>Switch</item-type>
<label>Local Coordinator</label>
<description>Indicator set to ON if this Zone Player is the Zone Group Coordinator</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="nightmode" advanced="true">
<item-type>Switch</item-type>
<label>Night Mode</label>
<description>Enable or disable the night mode feature</description>
</channel-type>
<channel-type id="notificationsound" advanced="true">
<item-type>String</item-type>
<label>Notification Sound</label>
<description>Play a notification sound by a given URI</description>
</channel-type>
<channel-type id="playlist" advanced="true">
<item-type>String</item-type>
<label>Play Playlist</label>
<description>Play the given playlist. The playlist has to predefined in the Sonos Controller app</description>
</channel-type>
<channel-type id="playqueue" advanced="true">
<item-type>Switch</item-type>
<label>Play Queue</label>
<description>Play the songs from the current queue</description>
</channel-type>
<channel-type id="playtrack" advanced="true">
<item-type>Number</item-type>
<label>Play Track</label>
<description>Play the given track number from the current queue</description>
</channel-type>
<channel-type id="playuri" advanced="true">
<item-type>String</item-type>
<label>Play URI</label>
<description>Play the given URI</description>
</channel-type>
<channel-type id="publicaddress" advanced="true">
<item-type>Switch</item-type>
<label>Public Address</label>
<description>Put all Zone Players in one group, and stream audio from the line-in from the Zone Player that triggered
the command</description>
</channel-type>
<channel-type id="radio" advanced="true">
<item-type>String</item-type>
<label>Radio</label>
<description>Play the given radio station. The radio station has to be predefined in the Sonos Controller app</description>
</channel-type>
<channel-type id="remove" advanced="true">
<item-type>String</item-type>
<label>Remove</label>
<description>Remove the given Zone Player from the group of this Zone Player</description>
</channel-type>
<channel-type id="repeat" advanced="true">
<item-type>String</item-type>
<label>Repeat</label>
<description>Repeat track or queue playback</description>
<state readOnly="false">
<options>
<option value="OFF">Off</option>
<option value="ONE">Track</option>
<option value="ALL">Queue</option>
</options>
</state>
</channel-type>
<channel-type id="restore" advanced="true">
<item-type>Switch</item-type>
<label>Restore</label>
<description>Restore the state of the Zone Player</description>
</channel-type>
<channel-type id="restoreall" advanced="true">
<item-type>Switch</item-type>
<label>Restore All</label>
<description>Restore the state of all the Zone Players</description>
</channel-type>
<channel-type id="save" advanced="true">
<item-type>Switch</item-type>
<label>Save</label>
<description>Save the state of the Zone Player</description>
</channel-type>
<channel-type id="saveall" advanced="true">
<item-type>Switch</item-type>
<label>Save All</label>
<description>Save the state of all the Zone Players</description>
</channel-type>
<channel-type id="shuffle" advanced="true">
<item-type>Switch</item-type>
<label>Shuffle</label>
<description>Shuffle queue playback</description>
</channel-type>
<channel-type id="sleeptimer" advanced="true">
<item-type>Number</item-type>
<label>Sleep Timer</label>
<description>Set/show the duration of the sleep timer in seconds</description>
<state min="0" max="68399" step="1" readOnly="false" pattern="%d s"/>
</channel-type>
<channel-type id="snooze" advanced="true">
<item-type>Number</item-type>
<label>Snooze</label>
<description>Snooze the running alarm, if any, with the given number of minutes</description>
<state readOnly="false" pattern="%d min"/>
</channel-type>
<channel-type id="speechenhancement" advanced="true">
<item-type>Switch</item-type>
<label>Speech Enhancement</label>
<description>Enable or disable the speech enhancement feature</description>
</channel-type>
<channel-type id="standalone" advanced="true">
<item-type>Switch</item-type>
<label>Stand Alone</label>
<description>Make the Zone Player leave its group and become a standalone Zone Player</description>
</channel-type>
<!-- The Sonos State Type -->
<channel-type id="state" advanced="true">
<item-type>String</item-type>
<label>State</label>
<description>The State channel contains state of the Zone Player, e.g. PLAYING, STOPPED,...</description>
<state readOnly="true">
<options>
<option value="STOPPED">Stopped</option>
<option value="PLAYING">Playing</option>
<option value="PAUSED_PLAYBACK">Paused</option>
<option value="TRANSITIONING">Transitioning</option>
</options>
</state>
</channel-type>
<channel-type id="stop" advanced="true">
<item-type>Switch</item-type>
<label>Stop</label>
<description>Stop the Zone Player. ON if the player is stopped.</description>
</channel-type>
<channel-type id="tuneinstationid" advanced="true">
<item-type>String</item-type>
<label>TuneIn Station Id</label>
<description>Provide the current TuneIn station id or play the TuneIn radio given by its station id</description>
</channel-type>
<channel-type id="zonegroupid" advanced="true">
<item-type>String</item-type>
<label>Zone Group ID</label>
<description>Id of the Zone Group the Zone Player belongs to</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="zonename">
<item-type>String</item-type>
<label>Zone Name</label>
<description>Name of the Zone Group associated to the Zone Player</description>
<state readOnly="true"/>
</channel-type>
<!-- Extended channels (for SONOS PLAY5, CONNECT & CONNECT:AMP only) -->
<channel-type id="linein" advanced="true">
<item-type>Switch</item-type>
<label>Line-in Connected</label>
<description>Indicator set to ON when the line-in of the Zone Player is connected</description>
<state readOnly="true"/>
</channel-type>
<channel-type id="playlinein" advanced="true">
<item-type>String</item-type>
<label>Play Line-in</label>
<description>Play the line-in of the the Zone Player corresponding to the given UIN</description>
</channel-type>
</thing:thing-descriptions>