]> git.basschouten.com Git - openhab-addons.git/commitdiff
[openhab.binding.onkyo]: add channel for changing the Audyssey EQ Mode (#14316)
authorMatt Filetto <matt.filetto@gmail.com>
Thu, 9 May 2024 21:53:06 +0000 (14:53 -0700)
committerGitHub <noreply@github.com>
Thu, 9 May 2024 21:53:06 +0000 (23:53 +0200)
* Values are Off, Movie, and Music and and corspond to 0,1,2

Signed-off-by: Matt Filetto <matt.filetto@gmail.com>
bundles/org.openhab.binding.onkyo/README.md
bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoBindingConstants.java
bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpCommand.java
bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/handler/OnkyoHandler.java
bundles/org.openhab.binding.onkyo/src/main/resources/OH-INF/i18n/onkyo.properties
bundles/org.openhab.binding.onkyo/src/main/resources/OH-INF/thing/channel-groups.xml
bundles/org.openhab.binding.onkyo/src/main/resources/OH-INF/thing/channels.xml
bundles/org.openhab.binding.onkyo/src/main/resources/OH-INF/update/instructions.xml [new file with mode: 0644]

index 041f1e353ebf40cdbb4d7cfdbc11bdc1e9a73773..fa4aa6cd9255dd8d3f1d985ca8626dbe454269ab 100644 (file)
@@ -28,7 +28,7 @@ At the moment only the following models are supported:
 - TX-NR555
 - TX-NR575
 - TX-NR575E
-    TX-NR609
+- TX-NR609
 - TX-NR616
 - TX-NR626
 - TX-NR636
@@ -65,9 +65,9 @@ Moreover, if the openHAB auto-discovery is disabled, the Onkyo AVR auto-discover
 
 The binding has the following configuration options, which can be set for "binding:onkyo":
 
-| Parameter   | Name         | Description                                                              | Required |
-|-------------|--------------|--------------------------------------------------------------------------|----------|
-| callbackUrl | Callback URL | URL to use for playing notification sounds, e.g. <http://192.168.0.2:8080> | no       |
+| Parameter   | Name         | Description                                                                                     | Required |
+| ----------- | ------------ | ----------------------------------------------------------------------------------------------- | -------- |
+| callbackUrl | Callback URL | URL to use for playing notification sounds, e.g.[http://192.168.0.2:8080](http://192.168.0.2:8080) | no       |
 
 When an Onkyo receiver is used as an audio sink, the receiver connects to openHAB to get the audio stream.
 By default, the binding sends the URL for getting the audio stream based on the Primary Address (Network Settings configuration) and the openHAB HTTP port.
@@ -114,12 +114,12 @@ This can be necessary if your receiver uses a different scaling system than 0-10
 You can specify a decimal number that acts as the coefficient for scaling.
 See below for a few examples:
 
-| Value  | Description                                          | Value for 100%   |
-|--------|------------------------------------------------------|------------------|
-| 1      | Default, don't scale                                 |              100 |
-| 2      | For receivers that support 0.5 increments in volume  |              200 |
-| 0.8    | For receivers that go from 0-80                      |               80 |
-| 0.5    | For receivers that go from 0-50                      |               50 |
+| Value | Description                                         | Value for 100% |
+| ----- | --------------------------------------------------- | -------------- |
+| 1     | Default, don't scale                                | 100            |
+| 2     | For receivers that support 0.5 increments in volume | 200            |
+| 0.8   | For receivers that go from 0-80                     | 80             |
+| 0.5   | For receivers that go from 0-50                     | 50             |
 
 Note that this is applied after the volume limiting took place.
 
@@ -134,7 +134,7 @@ The binding will send value 200 for maximum volume to the receiver.
 The Onkyo AVR supports the following channels (some channels are model specific):
 
 | Channel Type ID           | Item Type | Description                                                                                                     |
-|---------------------------|-----------|-----------------------------------------------------------------------------------------------------------------|
+| ------------------------- | --------- | --------------------------------------------------------------------------------------------------------------- |
 | zone1#power               | Switch    | Power on/off your device                                                                                        |
 | zone1#mute                | Switch    | Mute/unmute zone 1                                                                                              |
 | zone1#input               | Number    | The input for zone 1                                                                                            |
@@ -153,6 +153,7 @@ The Onkyo AVR supports the following channels (some channels are model specific)
 | player#artist             | String    | Artist name of the current song (available if playing from Network or USB)                                      |
 | player#currentPlayingTime | String    | Current playing time of the current song (available if playing from Network or USB)                             |
 | player#listenmode         | Number    | Current listening mode e.g. Stereo, 5.1ch Surround, ...                                                         |
+| player#audysseyeq         | Number    | Current Audyseey EQ mode (e.g. OFF, Movie, Music)                                                               |
 | player#audioinfo          | String    | Current audio info (Refresh timer must be configured for updates)                                               |
 | player#playuri            | String    | Plays the URI provided to the channel                                                                           |
 | player#albumArt           | Image     | Image of the current album art of the current song                                                              |
@@ -245,6 +246,7 @@ String avrLrPlayer_Album              "Album [%s]"              <text>        {
 String avrLrPlayer_Artist             "Artist [%s]"             <parents_2_5> { channel="onkyo:onkyoAVR:avr-livingroom:player#artist" }
 String avrLrPlayer_CurrentPlayingTime "CurrentPlayingTime [%s]" <clock>       { channel="onkyo:onkyoAVR:avr-livingroom:player#currentPlayingTime" }
 Number avrLrPlayer_Listenmode         "Listenmode [%d]"         <text>        { channel="onkyo:onkyoAVR:avr-livingroom:player#listenmode" }
+Number avrLrPlayer_AudysseyEQ         "AudysseeyEQ [%d]"        <text>        { channel="onkyo:onkyoAVR:avr-livingroom:player#audysseyeq" }
 String avrLrPlayer_PlayURI            "PlayURI [%s]"            <text>        { channel="onkyo:onkyoAVR:avr-livingroom:player#playuri" }
 Image  avrLrPlayer_AlbumArt           "AlbumArt [%s]"           <text>        { channel="onkyo:onkyoAVR:avr-livingroom:player#albumArt" }
 String avrLrPlayer_AlbumArtUrl        "AlbumArtURL [%s]"        <text>        { channel="onkyo:onkyoAVR:avr-livingroom:player#albumArtUrl" }
@@ -297,7 +299,9 @@ sitemap demo label="Onkyo AVR"
         Text      item=avrLrPlayer_Artist
         Text      item=avrLrPlayer_CurrentPlayingTime
         Selection item=avrLrPlayer_Listenmode mappings=[0=Stereo, 1=Direct, 2=Surround, 15=Mono, 31="Whole House", 66="THX Cinema"]
+        Selection item=avrLrPlayer_AudysseyEQ mappings=[0=Off, 1=Movie, 2=Music]
     }
+
     Frame label="NetMenu" {
         Text      item=avrLrNet_Title
         Selection item=avrLrNet_Control   mappings=[ Up='Up', Down='Down', Select='Select', Back='Back', PageUp='PageUp', PageDown='PageDow', Select0='Select0', Select1='Select1', Select2='Select2', Select3='Select3', Select4='Select4', Select5='Select5', Select6='Select6', Select7='Select7', Select8='Select8', Select9='Select9' ]
index 63cfc0c59d62d58a5c5f11ef2777ee3a390fda35..e47b80d88d1827c6ec71142499366a7628c3b96c 100644 (file)
@@ -75,6 +75,7 @@ public class OnkyoBindingConstants {
     public static final String CHANNEL_LISTENMODE = "player#listenmode";
     public static final String CHANNEL_AUDIOINFO = "player#audioinfo";
     public static final String CHANNEL_PLAY_URI = "player#playuri";
+    public static final String CHANNEL_AUDYSSEYEQ = "player#audysseyeq";
 
     public static final String CHANNEL_NET_MENU_TITLE = "netmenu#title";
     public static final String CHANNEL_NET_MENU_CONTROL = "netmenu#control";
index 6f9eb6473873982d0c4fa477cb98dd9e51293978..4884c911f621e23d2b2973df1223c36c1fe23baf 100644 (file)
@@ -55,6 +55,10 @@ public enum EiscpCommand {
     LISTEN_MODE_SET("LMD", "%02X"),
     LISTEN_MODE("LMD", ""),
 
+    AUDYSSEYEQ_QUERY("ADY", "QSTN"),
+    AUDYSSEYEQ_SET("ADY", "%02X"),
+    AUDYSSEYEQ("ADY", ""),
+
     INFO_QUERY("NRI", "QSTN"),
     INFO("NRI", ""),
 
index 19e075657d9d6eb4923e08f9218480dd7b56ac61..e54784a1af54e4aacfcc32d4949d388bdf9d3e1e 100644 (file)
@@ -191,6 +191,13 @@ public class OnkyoHandler extends OnkyoUpnpHandler implements OnkyoEventListener
                     sendCommand(EiscpCommand.LISTEN_MODE_QUERY);
                 }
                 break;
+            case CHANNEL_AUDYSSEYEQ:
+                if (command instanceof DecimalType) {
+                    sendCommand(EiscpCommand.AUDYSSEYEQ_SET, command);
+                } else if (command.equals(RefreshType.REFRESH)) {
+                    sendCommand(EiscpCommand.AUDYSSEYEQ_QUERY);
+                }
+                break;
 
             /*
              * ZONE 2
@@ -419,6 +426,10 @@ public class OnkyoHandler extends OnkyoUpnpHandler implements OnkyoEventListener
                     updateState(CHANNEL_LISTENMODE,
                             convertDeviceValueToOpenHabState(data.getValue(), DecimalType.class));
                     break;
+                case AUDYSSEYEQ:
+                    updateState(CHANNEL_AUDYSSEYEQ,
+                            convertDeviceValueToOpenHabState(data.getValue(), DecimalType.class));
+                    break;
 
                 /*
                  * ZONE 2
@@ -826,6 +837,7 @@ public class OnkyoHandler extends OnkyoUpnpHandler implements OnkyoEventListener
             sendCommand(EiscpCommand.INFO_QUERY);
             sendCommand(EiscpCommand.AUDIOINFO_QUERY);
             sendCommand(EiscpCommand.VIDEOINFO_QUERY);
+            sendCommand(EiscpCommand.AUDYSSEYEQ_QUERY);
 
             if (isChannelAvailable(CHANNEL_POWERZONE2)) {
                 sendCommand(EiscpCommand.ZONE2_POWER_QUERY);
index 0a2a4d55447aa927929a15ff205d98d46d59cae2..24323ce7de61417b6c75e50a0515942fc524d570 100644 (file)
@@ -143,6 +143,11 @@ channel-type.onkyo.audioOut.label = Audio Output Info
 channel-type.onkyo.audioOut.description = Audio Output Stream Information
 channel-type.onkyo.audioinfo.label = Audio Info
 channel-type.onkyo.audioinfo.description = Detailed audio info
+channel-type.onkyo.audysseyeq.label = Audyssey EQ Mode
+channel-type.onkyo.audysseyeq.description = Choose between Audyssey 2EQ/MultiEQ Equalizer curves
+channel-type.onkyo.audysseyeq.state.option.0 = Audyssey EQ Off
+channel-type.onkyo.audysseyeq.state.option.1 = Audyssey EQ Movie
+channel-type.onkyo.audysseyeq.state.option.2 = Audyssey EQ Music
 channel-type.onkyo.control.label = Control
 channel-type.onkyo.control.description = Control the Zone Player, e.g. start/stop/next/previous/ffward/rewind
 channel-type.onkyo.currentPlayingTime.label = Playing Time
index 919636d9e0a38c0bbd2cca9860ee26a5f5471532..5f4fe5e8c2751979fff6cd5cdf1f06c5fb5fcf60 100644 (file)
@@ -49,6 +49,7 @@
                        <channel id="playuri" typeId="playuri"/>
                        <channel id="albumArt" typeId="albumArt"/>
                        <channel id="albumArtUrl" typeId="albumArtUrl"/>
+                       <channel id="audysseyeq" typeId="audysseyeq"/>
                </channels>
        </channel-group-type>
 
index d3d2d490f788777d56645d667cecf3a492140de4..ffad34b7f418fb79aeb2cd068b2f109d33b1fd42 100644 (file)
                        </options>
                </state>
        </channel-type>
+       <channel-type id="audysseyeq" advanced="true">
+               <item-type>Number</item-type>
+               <label>Audyssey EQ Mode</label>
+               <description>Choose between Audyssey 2EQ/MultiEQ Equalizer curves</description>
+               <state>
+                       <options>
+                               <option value="0">Off</option>
+                               <option value="1">Movie</option>
+                               <option value="2">Music</option>
+                       </options>
+               </state>
+       </channel-type>
        <channel-type id="playuri" advanced="true">
                <item-type>String</item-type>
                <label>Play URI</label>
diff --git a/bundles/org.openhab.binding.onkyo/src/main/resources/OH-INF/update/instructions.xml b/bundles/org.openhab.binding.onkyo/src/main/resources/OH-INF/update/instructions.xml
new file mode 100644 (file)
index 0000000..f304f14
--- /dev/null
@@ -0,0 +1,252 @@
+<?xml version="1.0" ?>
+<ns0:update-descriptions xmlns:ns0="https://openhab.org/schemas/update-description/v1.0.0"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">
+
+       <thing-type uid="onkyo:TX-NR609">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+
+       <thing-type uid="onkyo:onkyoAVR">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:ht-RC560">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR545">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR575">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR838">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR828">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR727">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR646">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR414">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR509">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR515">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR609">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:tx-rz900">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR807">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR717">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR575e">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:channel-groups">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR737">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR474">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR555">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR747">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR809">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:HT-RC440">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR616">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR818">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR636">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR535">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR656">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR708">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR525">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR3007">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR626">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR686">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+       <thing-type uid="onkyo:TX-NR676">
+               <instruction-set targetVersion="1">
+                       <add-channel id="audysseyeq">
+                               <type>onkyo:audysseyeq</type>
+                       </add-channel>
+               </instruction-set>
+       </thing-type>
+</ns0:update-descriptions>