diff --git a/CODEOWNERS b/CODEOWNERS index 59a56ddd9f1..79a33f3c15e 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -264,6 +264,7 @@ /bundles/org.openhab.binding.oppo/ @mlobstein /bundles/org.openhab.binding.orbitbhyve/ @octa22 /bundles/org.openhab.binding.orvibo/ @tavalin +/bundles/org.openhab.binding.panasonicbdp/ @mlobstein /bundles/org.openhab.binding.paradoxalarm/ @theater /bundles/org.openhab.binding.pentair/ @jsjames /bundles/org.openhab.binding.phc/ @gnlpfjh diff --git a/bom/openhab-addons/pom.xml b/bom/openhab-addons/pom.xml index dd5cb09900a..44ad3d72de5 100644 --- a/bom/openhab-addons/pom.xml +++ b/bom/openhab-addons/pom.xml @@ -1306,6 +1306,11 @@ org.openhab.binding.orvibo ${project.version} + + org.openhab.addons.bundles + org.openhab.binding.panasonicbdp + ${project.version} + org.openhab.addons.bundles org.openhab.binding.paradoxalarm diff --git a/bundles/org.openhab.binding.panasonicbdp/NOTICE b/bundles/org.openhab.binding.panasonicbdp/NOTICE new file mode 100644 index 00000000000..38d625e3492 --- /dev/null +++ b/bundles/org.openhab.binding.panasonicbdp/NOTICE @@ -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 diff --git a/bundles/org.openhab.binding.panasonicbdp/README.md b/bundles/org.openhab.binding.panasonicbdp/README.md new file mode 100644 index 00000000000..0eb3ef1aefa --- /dev/null +++ b/bundles/org.openhab.binding.panasonicbdp/README.md @@ -0,0 +1,242 @@ +# Panasonic Blu-ray Player Binding + +This binding connects Panasonic Blu-ray players from 2011/2012 and UHD Blu-ray players from 2018 to openHAB. +**Supported Blu-ray models:** DMP-BDT110, DMP-BDT210, DMP-BDT310, DMP-BDT120, DMP-BDT220, DMP-BDT320, DMP-BBT01 & DMP-BDT500. +**Supported UHD models:** DP-UB420/424, DP-UB820/824 & DP-UB9000/9004. + +**Please note:** The player must be on the same IP subnet as the openHAB server for this binding to function. +If the connection to the player originates from a different subnet, 404 response errors are sent in response to all requests. + +To enable network remote control of the Blu-ray model players, configure the following settings: +**Player Settings/Network/Network Settings/Remote Device Settings** +Then make sure you have the following values set: +**Remote Device Operation: On** +**Registration Type: Automatic** + +For the UHD models, Voice Control must be enabled for the player's http interface to be active: +**Player Settings/Network/Voice Control: On** + +To enable the binding to control the player while off (network active while off), Quick Start mode must be On as follows: +**Player Settings/System/Quick Start: On** + +**UHD Model Command Authentication:** +The UHD models require authentication to use the control API. +A player key must be specified in the thing configuration in order for the `power`, `button` and `control` channels to work. +UHD model players that are patched do not require a player key. +See the [AVForums discussions](https://www.avforums.com/forums/blu-ray-dvd-player-multiregion-hacks.126/) of the DP-UB420/820/9000 players for more information. + +## Supported Things + +There are two supported thing types, which represent either a BD player or a UHD player. +A supported Blu-ray player uses the `bd-player` id and a supported UHD Blu-ray player uses the `uhd-player` id. +Multiple Things can be added if more than one player is to be controlled. + +## Discovery + +Auto-discovery is supported if the player can be located on the local network using UPnP. +Otherwise the thing must be manually added. + +## Binding Configuration + +The binding has no configuration options, all configuration is done at Thing level. + +## Thing Configuration + +The Thing has a few configuration parameters: + +| Name | Type | Description | Default | Required | +|-----------|---------|-------------------------------------------------------------------------------------------------------|---------|----------| +| hostName | text | The host name or IP address of the player. | N/A | yes | +| refresh | integer | Overrides the refresh interval of the player status. Minimum interval is 5 seconds. | 5 | no | +| playerKey | text | For UHD models, to enable authentication of control commands, a key for the player must be specified. | N/A | no | + +Some notes: + +* The control protocol of these players is undocumented and may not work consistently in all situations +* The UHD models only support playback elapsed time (not title total time or chapter information) reporting +* The time and chapter information is only available when playing a Blu-ray disc (not DVD or CD) +* There are reports in forum postings that not all commands work on all of the older models (i.e.: Power does not work on DMP-BDT110) +* Not all status information is available from all BD models (i.e.: playback elapsed time not reported by some models) + +## Channels + +The following channels are available: + +| Channel ID | Item Type | Read/Write | Description | +|-----------------|-------------|------------|---------------------------------------------------------------------------------------| +| power | Switch | RW | Turn the power for the player ON or OFF. | +| button | String | W | Sends a command to the player. See lists of available commands in Appendix A below. | +| control | Player | RW | Control Playback e.g. Play/Pause/Next/Previous/FForward/Rewind. | +| player-status | String | R | The player status i.e.: Power Off, Tray Open, Stopped, Playback, Pause Playback, etc. | +| time-elapsed | Number:Time | R | The total number of seconds of playback time elapsed. | +| time-total | Number:Time | R | The total length of the current playing title in seconds. Not on UHD models. | +| chapter-current | Number | R | The current chapter number. Not on UHD models. | +| chapter-total | Number | R | The total number of chapters in the current title. Not on UHD models. | + +## Full Example + +panasonicbdp.things: + +```java +panasonicbdp:bd-player:mybdplayer "My Blu-ray player" [ hostName="192.168.10.1", refresh=5 ] +panasonicbdp:uhd-player:myuhdplayer "My UHD Blu-ray player" [ hostName="192.168.10.1", refresh=5, playerKey="ABCDEF1234567890abcdef0123456789" ] +``` + +panasonicbdp.items: + +```java +// BD Player +Switch Player_Power "Power" { channel="panasonicbdp:bd-player:mybdplayer:power" } +String Player_Button "Send Command" { channel="panasonicbdp:bd-player:mybdplayer:button", autoupdate="false" } +Player Player_Control "Control" { channel="panasonicbdp:bd-player:mybdplayer:control" } +String Player_PlayerStatus "Status: [%s]" { channel="panasonicbdp:bd-player:mybdplayer:player-status" } +Number:Time Player_TimeElapsed "Elapsed Time: [%d %unit%]" { channel="panasonicbdp:bd-player:mybdplayer:time-elapsed" } +Number:Time Player_TimeTotal "Total Time: [%d %unit%]" { channel="panasonicbdp:bd-player:mybdplayer:time-total" } +Number Player_ChapterCurrent "Current Chapter: [%d]" { channel="panasonicbdp:bd-player:mybdplayer:chapter-current" } +Number Player_ChapterTotal "Total Chapters: [%d]" { channel="panasonicbdp:bd-player:mybdplayer:chapter-total" } + +// UHD Player +Switch Player_Power "Power" { channel="panasonicbdp:uhd-player:myuhdplayer:power" } +String Player_Button "Send Command" { channel="panasonicbdp:uhd-player:myuhdplayer:button", autoupdate="false" } +Player Player_Control "Control" { channel="panasonicbdp:uhd-player:myuhdplayer:control" } +String Player_PlayerStatus "Status: [%s]" { channel="panasonicbdp:uhd-player:myuhdplayer:player-status" } +Number:Time Player_TimeElapsed "Elapsed Time: [%d %unit%]" { channel="panasonicbdp:uhd-player:myuhdplayer:time-elapsed" } +``` + +panasonicbdp.sitemap: + +```perl +sitemap panasonicbdp label="Panasonic Blu-ray" { + Frame label="Blu-ray Player" { + Switch item=Player_Power + Selection item=Player_Button icon="player" + Default item=Player_Control + Text item=Player_PlayerStatus + Text item=Player_TimeElapsed icon="time" + // The following three channels are not available on UHD models + Text item=Player_TimeTotal icon="time" + Text item=Player_ChapterCurrent icon="time" + Text item=Player_ChapterTotal icon="time" + } +} +``` + +### Appendix A - 'button' channel command codes: + +**List of available button commands for BD players:** + +| Function | Command | +|--------------------------|----------| +| Power On | POWERON | +| Power Off | POWEROFF | +| Power Toggle | POWER | +| Play | PLAYBACK | +| Pause | PAUSE | +| Stop | STOP | +| Fast Forward | CUE | +| Reverse | REV | +| Skip Forward | SKIPFWD | +| Skip Back | SKIPREV | +| Open/Close | OP_CL | +| Status | DSPSEL | +| Top Menu | TITLE | +| Pop-Up Menu | PUPMENU | +| Up | UP | +| Down | DOWN | +| Left | LEFT | +| Right | RIGHT | +| OK | SELECT | +| Submenu | MENU | +| Return | RETURN | +| 1 (@.) | D1 | +| 2 (ABC) | D2 | +| 3 (DEF) | D3 | +| 4 (GHI) | D4 | +| 5 (JKL) | D5 | +| 6 (MNO) | D6 | +| 7 (PQRS) | D7 | +| 8 (TUV) | D8 | +| 9 (WXYZ) | D9 | +| 0 (-,) | D0 | +| 12 | D12 | +| * (Cancel) | CLEAR | +| # ([_]) | SHARP | +| Red | RED | +| Green | GREEN | +| Blue | BLUE | +| Yellow | YELLOW | +| Home | MLTNAVI | +| Netflix (broken/too old) | NETFLIX | +| VIERA Cast | V_CAST | +| Network | NETWORK | +| Setup | SETUP | +| Exit | EXIT | +| Audio | AUDIOSEL | +| 3D | 3D | +| Playback View (buttons not in other views)|| +| PIP | P_IN_P | +| OSD (DISPLAY) | OSDONOFF | +| Shuttle(BD) View (buttons not in other views)|| +| Swipe in CW circle | SHFWD2 | +| Swipe in CCW circle | SHREV2 | + +**List of available button commands for UHD players:** + +| Function | Command | +|------------------|------------------| +| Power On | POWERON | +| Power Off | POWEROFF | +| Power Toggle | POWER | +| Play | PLAYBACK | +| Pause | PAUSE | +| Stop | STOP | +| Fast Forward | CUE | +| Reverse | REV | +| Skip Forward | SKIPFWD | +| Skip Back | SKIPREV | +| Manual Skip +60s | MNSKIP | +| Manual Skip -10s | MNBACK | +| Open/Close | OP_CL | +| Status | DSPSEL | +| Top Menu | TITLE | +| Pop-up Menu | PUPMENU | +| Up | UP | +| Down | DOWN | +| Left | LEFT | +| Right | RIGHT | +| OK | SELECT | +| Submenu | MENU | +| Return | RETURN | +| 1 (@.) | D1 | +| 2 (ABC) | D2 | +| 3 (DEF) | D3 | +| 4 (GHI) | D4 | +| 5 (JKL) | D5 | +| 6 (MNO) | D6 | +| 7 (PQRS) | D7 | +| 8 (TUV) | D8 | +| 9 (WXYZ) | D9 | +| 0 (-,) | D0 | +| 12 | D12 | +| * (Cancel) | CLEAR | +| # ([_]) | SHARP | +| Red | RED | +| Green | GREEN | +| Blue | BLUE | +| Yellow | YELLOW | +| Home | MLTNAVI | +| Netflix | NETFLIX | +| VIERA Cast | V_CAST | +| Network | NETWORK | +| Setup | SETUP | +| Exit | EXIT | +| Audio | AUDIOSEL | +| Subtitle | TITLEONOFF | +| Closed Caption | CLOSED_CAPTION | +| Playback Info | PLAYBACKINFO | +| HDR Picture Mode | HDR_PICTUREMODE | +| Mirroring | MIRACAST | +| Picture Setting | PICTURESETTINGS | +| Sound Effect | SOUNDEFFECT | +| High Clarity | HIGHCLARITY | +| Skip The Trailer | SKIP_THE_TRAILER | diff --git a/bundles/org.openhab.binding.panasonicbdp/pom.xml b/bundles/org.openhab.binding.panasonicbdp/pom.xml new file mode 100644 index 00000000000..31e68629262 --- /dev/null +++ b/bundles/org.openhab.binding.panasonicbdp/pom.xml @@ -0,0 +1,17 @@ + + + + 4.0.0 + + + org.openhab.addons.bundles + org.openhab.addons.reactor.bundles + 4.2.0-SNAPSHOT + + + org.openhab.binding.panasonicbdp + + openHAB Add-ons :: Bundles :: Panasonic Blu-ray Player Binding + + diff --git a/bundles/org.openhab.binding.panasonicbdp/src/main/feature/feature.xml b/bundles/org.openhab.binding.panasonicbdp/src/main/feature/feature.xml new file mode 100644 index 00000000000..1fcdbde0013 --- /dev/null +++ b/bundles/org.openhab.binding.panasonicbdp/src/main/feature/feature.xml @@ -0,0 +1,10 @@ + + + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features + + + openhab-runtime-base + openhab-transport-upnp + mvn:org.openhab.addons.bundles/org.openhab.binding.panasonicbdp/${project.version} + + diff --git a/bundles/org.openhab.binding.panasonicbdp/src/main/java/org/openhab/binding/panasonicbdp/internal/PanaBlurayBindingConstants.java b/bundles/org.openhab.binding.panasonicbdp/src/main/java/org/openhab/binding/panasonicbdp/internal/PanaBlurayBindingConstants.java new file mode 100644 index 00000000000..580887d6659 --- /dev/null +++ b/bundles/org.openhab.binding.panasonicbdp/src/main/java/org/openhab/binding/panasonicbdp/internal/PanaBlurayBindingConstants.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) 2010-2024 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.panasonicbdp.internal; + +import java.util.Map; +import java.util.Set; + +import javax.measure.Unit; +import javax.measure.quantity.Time; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jetty.util.Fields; +import org.openhab.core.library.unit.Units; +import org.openhab.core.thing.ThingTypeUID; + +/** + * The {@link PanaBlurayBindingConstants} class defines common constants, which are + * used across the whole binding. + * + * @author Michael Lobstein - Initial contribution + */ +@NonNullByDefault +public class PanaBlurayBindingConstants { + public static final String BINDING_ID = "panasonicbdp"; + public static final String PROPERTY_UUID = "uuid"; + public static final String PROPERTY_HOST_NAME = "hostName"; + + // List of all Thing Type UIDs + public static final ThingTypeUID THING_TYPE_BD_PLAYER = new ThingTypeUID(BINDING_ID, "bd-player"); + public static final ThingTypeUID THING_TYPE_UHD_PLAYER = new ThingTypeUID(BINDING_ID, "uhd-player"); + + // List of all Channel id's + public static final String POWER = "power"; + public static final String BUTTON = "button"; + public static final String CONTROL = "control"; + public static final String PLAYER_STATUS = "player-status"; + public static final String TIME_ELAPSED = "time-elapsed"; + public static final String TIME_TOTAL = "time-total"; + public static final String CHAPTER_CURRENT = "chapter-current"; + public static final String CHAPTER_TOTAL = "chapter-total"; + + public static final Set SUPPORTED_THING_TYPES_UIDS = Set.of(THING_TYPE_BD_PLAYER, + THING_TYPE_UHD_PLAYER); + + // Units of measurement of the data delivered by the API + public static final Unit