[openhab.binding.onkyo]: add channel for changing the Audyssey EQ Mode (#14316)

* Values are Off, Movie, and Music and and corspond to 0,1,2

Signed-off-by: Matt Filetto <matt.filetto@gmail.com>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
Matt Filetto 2024-05-09 14:53:06 -07:00 committed by Ciprian Pascu
parent 8aefad2376
commit 56169e3f2a
8 changed files with 302 additions and 11 deletions

View 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' ]

View 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";

View 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", ""),

View 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);

View 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

View 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>

View File

@ -103,6 +103,18 @@
</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>

View File

@ -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>