Updated external content (Jenkins build 2620)

final
openHAB Build Server 2025-05-16 05:55:15 +00:00
parent 2bc70be4cf
commit bc41299a6c
3 changed files with 334 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,178 @@
---
id: emby
label: Emby
title: Emby - Bindings
type: binding
description: "The **Emby Binding** integrates [Emby](https://emby.media/), a personal media server, with openHAB."
since: 3x
install: auto
---
<!-- Attention authors: Do not edit directly. Please add your changes to the appropriate source repository -->
{% include base.html %}
# Emby Binding
The **Emby Binding** integrates [Emby](https://emby.media/), a personal media server, with openHAB.
It allows controlling Emby players and retrieving player status data.
For example, you can monitor the currently playing movie title or automatically dim your lights when playback starts.
This binding supports multiple Emby clients connected to a single Emby Media Server.
It provides functionality similar to the Plex Binding.
## Supported Things
This binding defines the following Thing Type IDs:
- `controller`
Represents a connection to an Emby server (a Bridge Thing).
- `device`
Represents a client/player device connected to the Emby server.
## Automatic Discovery
The binding supports automatic discovery for both servers (`controller`) and clients (`device`).
## Binding Configuration
There is no global binding-level configuration required or supported.
## Thing Configuration
### `controller` Bridge Configuration
The following Configuration Parameter Keys are available:
| Name | Type | Description | Default | Required | Advanced |
|-----------------|---------|---------------------------------------------------------|---------|----------|----------|
| ipAddress | Text | IP address or hostname of the Emby server. | N/A | Yes | No |
| api | Text | API Key generated from Emby for authorization. | N/A | Yes | No |
| bufferSize | Integer | WebSocket buffer size in bytes. | 10,000 | No | No |
| refreshInterval | Integer | Polling interval for play-state updates (milliseconds). | 10,000 | No | No |
| port | Integer | Port in which EMBY is listening for communication. | 8096 | No | No |
| discovery | Boolean | Enable or disable automatic device discovery. | true | No | Yes |
### `device` Thing Configuration
The following Configuration Parameter Key is available:
- `deviceID`
The unique identifier for the client device connected to the Emby server.
## Channels
The following Channel IDs are available for a `device` Thing:
| Channel ID | Item Type | Config Parameters | Description |
|--------------|-------------|-----------------------------------------------------------------------|-----------------------------------------------------------------------|
| control | Player | None | Playback control (play, pause, next, previous, fast-forward, rewind). |
| stop | Switch | None | Indicates playback state; OFF stops playback. |
| title | String | None | Title of the currently playing song. |
| show-title | String | None | Title of the currently playing movie or TV show. |
| mute | Switch | None | Mute status control. |
| image-url | String | imageUrlMaxHeight, imageMaxWidth, imageUrlType, imageUrlPercentPlayed | URL for current media artwork. |
| current-time | Number:Time | None | Current playback position. |
| duration | Number:Time | None | Total media duration. |
| media-type | String | None | Type of media (e.g., Movie, Episode). |
## `image-url` Config Parameters
| Parameter Name | Type | Default | Description |
|-------------------------|---------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `imageUrlType` | Text | Primary | Specifies the image type to retrieve. Options include `Primary`, `Art`, `Backdrop`, `Banner`, `Logo`, `Thumb`, `Disc`, `Box`, `Screenshot`, `Menu`, and `Chapter`. |
| `imageUrlMaxHeight` | Text | None | The maximum height (in pixels) of the retrieved image. |
| `imageUrlMaxWidth` | Text | None | The maximum width (in pixels) of the retrieved image. |
| `imageUrlPercentPlayed` | Boolean | false | If true, adds an overlay indicating the percent played (e.g., 47%). |
## Full Example
### `emby.things` Example
```java
Bridge emby:controller:myEmbyServer [
ipAddress="192.168.1.100",
api="YOUR_EMBY_API_KEY",
bufferSize=16384,
refreshInterval=2000,
discovery=true
] {
Thing emby:device:myClientDevice [
deviceID="YOUR_CLIENT_DEVICE_ID"
]
}
```
### `emby.items` Example
```java
Switch Emby_PlayPause "Play/Pause" { channel="emby:device:myEmbyServer:myClientDevice:control" }
Switch Emby_Stop "Stop" { channel="emby:device:myEmbyServer:myClientDevice:stop" }
Switch Emby_Mute "Mute" { channel="emby:device:myEmbyServer:myClientDevice:mute" }
String Emby_Title "Title [%s]" { channel="emby:device:myEmbyServer:myClientDevice:title" }
String Emby_ShowTitle "Show Title [%s]" { channel="emby:device:myEmbyServer:myClientDevice:show-title" }
Number:Time Emby_CurrentTime "Current Time [%d %unit%]" { channel="emby:device:myEmbyServer:myClientDevice:current-time" }
Number:Time Emby_Duration "Duration [%d %unit%]" { channel="emby:device:myEmbyServer:myClientDevice:duration" }
String Emby_MediaType "Media Type [%s]" { channel="emby:device:myEmbyServer:myClientDevice:media-type" }
String Emby_ImageURL "Artwork URL [%s]" { channel="emby:device:myEmbyServer:myClientDevice:image-url" }
```
### `emby.sitemap` Configuration Example
```perl
sitemap emby label="Emby Control"
{
Frame label="Controls" {
Switch item=Emby_PlayPause
Switch item=Emby_Stop
Switch item=Emby_Mute
}
Frame label="Now Playing" {
Text item=Emby_Title
Text item=Emby_ShowTitle
Text item=Emby_MediaType
Text item=Emby_CurrentTime
Text item=Emby_Duration
Text item=Emby_ImageURL
}
}
```
## Rule Actions
All playback and control commands are now implemented as Rule Actions rather than channels. Use the standard `getActions` API in your rules to invoke these.
### Available Actions
| Action ID | Method Signature | Description |
|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| sendPlay | `sendPlay(ItemIds: String, PlayCommand: String, StartPositionTicks: Integer?, MediaSourceId: String?, AudioStreamIndex: Integer?, SubtitleStreamIndex: Integer?, StartIndex: Integer?)` | Send a play command with optional parameters to an Emby player. |
| sendGeneralCommand | `sendGeneralCommand(CommandName: String)` | Send a generic Emby control command (e.g., MoveUp, ToggleMute, GoHome). |
| sendGeneralCommandWithArgs | `sendGeneralCommandWithArgs(CommandName: String, Arguments: String)` | Send a generic Emby control command with a JSON arguments blob (e.g., SetVolume, DisplayMessage, etc.). |
### Example Rule (XTend)
```xtend
rule "Play Movie on Emby"
when
Item MySwitch changed to ON
then
val embyActions = getActions("emby", "emby:device:myServer:myDevice")
// Play item IDs "abc,def" immediately
embyActions.sendPlay("abc,def", "PlayNow", null, null, null, null, null)
end
```
### Example Rule (JavaScript)
```javascript
// inside a JS Scripting rule
let emby = actions.getActions("emby", "emby:device:myServer:myDevice");
emby.sendGeneralCommand("ToggleMute");
```
## References
- [Emby Remote Control API Documentation](https://github.com/MediaBrowser/Emby/wiki/Remote-control)

View File

@ -0,0 +1,155 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="emby"
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">
<!-- Sample Thing Type -->
<bridge-type id="controller">
<label>EMBY Server</label>
<description>This is the Bridge to an instance of an EMBY server you want to connect to.</description>
<semantic-equipment-tag>NetworkAppliance</semantic-equipment-tag>
<config-description>
<parameter name="api" type="text" required="true">
<label>API Key</label>
<description>This is the API key generated from EMBY used for Authorization.</description>
</parameter>
<parameter name="ipAddress" type="text" required="true">
<label>Server Host</label>
<description>IP address or hostname of the EMBY server.</description>
<context>network-address</context>
</parameter>
<parameter name="port" type="integer" min="1" max="65535" required="true">
<label>Server Port</label>
<description>Port number for the EMBY server.</description>
<default>8096</default>
</parameter>
<parameter name="refreshInterval" type="integer" min="1000">
<label>Refresh Interval</label>
<description>Polling interval for play-state updates.</description>
<default>10000</default>
</parameter>
<parameter name="discovery" type="boolean">
<label>Auto Discover</label>
<description>Enable or disable automatic device discovery.</description>
<default>true</default>
<advanced>true</advanced>
</parameter>
</config-description>
</bridge-type>
<thing-type id="device">
<supported-bridge-type-refs>
<bridge-type-ref id="controller"/>
</supported-bridge-type-refs>
<label>EMBY Device</label>
<description>This is a player device which connects to an EMBY server.</description>
<semantic-equipment-tag>MediaPlayer</semantic-equipment-tag>
<channels>
<channel id="control" typeId="control"/>
<channel id="stop" typeId="stop"/>
<channel id="title" typeId="title"/>
<channel id="mute" typeId="mute"/>
<channel id="show-title" typeId="show-title"/>
<channel id="image-url" typeId="image-url"/>
<channel id="current-time" typeId="current-time"/>
<channel id="duration" typeId="duration"/>
<channel id="media-type" typeId="media-type"/>
</channels>
<config-description>
<parameter name="deviceID" type="text" required="true">
<label>DeviceID</label>
<description>This is the deviceId you want to connect to.</description>
</parameter>
</config-description>
</thing-type>
<channel-type id="title">
<item-type>String</item-type>
<label>Title</label>
<description>Title of the current song</description>
<state readOnly="true" pattern="%s"/>
</channel-type>
<channel-type id="show-title">
<item-type>String</item-type>
<label>Show Title</label>
<description>Title of the current show</description>
<state readOnly="true" pattern="%s"/>
</channel-type>
<channel-type id="control">
<item-type>Player</item-type>
<label>Control</label>
<description>Control the Emby Player, e.g. start/stop/next/previous/ffward/rewind</description>
<category>Player</category>
</channel-type>
<channel-type id="stop">
<item-type>Switch</item-type>
<label>Stop</label>
<description>Stops the player. ON if the player is stopped.</description>
</channel-type>
<channel-type id="mute">
<item-type>Switch</item-type>
<label>Mute</label>
<description>Mute/unmute your device</description>
</channel-type>
<channel-type id="current-time">
<item-type>Number:Time</item-type>
<label>Current Time</label>
<description>Current time of currently playing media</description>
<state readOnly="true" pattern="%d %unit%"/>
</channel-type>
<channel-type id="duration">
<item-type>Number:Time</item-type>
<label>Duration</label>
<description>Length of currently playing media</description>
<state readOnly="true" pattern="%d %unit%"/>
</channel-type>
<channel-type id="media-type">
<item-type>String</item-type>
<label>Media Type</label>
<description>Media type of the current file</description>
<state readOnly="true" pattern="%s"/>
</channel-type>
<channel-type id="image-url">
<item-type>String</item-type>
<label>image url</label>
<description>The url of the playing media</description>
<state readOnly="true" pattern="%s"/>
<config-description>
<parameter name="imageUrlType" type="text">
<default>Primary</default>
<options>
<option value="Primary">Primary</option>
<option value="Art">Art</option>
<option value="Backdrop">Backdrop</option>
<option value="Banner">Banner</option>
<option value="Logo">Logo</option>
<option value="Thumb">Thumb</option>
<option value="Disc">Disc</option>
<option value="Box">Box</option>
<option value="Screenshot">Screenshot</option>
<option value="Menu">Menu</option>
<option value="Chapter">Chapter</option>
</options>
</parameter>
<parameter name="imageUrlMaxHeight" type="text">
<label>Image Max Height</label>
<description>The maximum height of the image that will be retrieved.</description>
</parameter>
<parameter name="imageUrlMaxWidth" type="text">
<label>Image Max Width</label>
<description>The maximum width of the image that will be retrieved.</description>
</parameter>
<parameter name="imageUrlPercentPlayed" type="boolean">
<label>Show Percent Played Overlay</label>
<description>If set to true, a percent played overlay will be added to the image. For example, using
PercentPlayed=47 will overlay a 47% progress indicator. Default is false.</description>
</parameter>
</config-description>
</channel-type>
</thing:thing-descriptions>