Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[denonmarantz] Add HTTP protocol support for newer receivers #16747

Closed
jlaur opened this issue May 11, 2024 · 0 comments · Fixed by #16748
Closed

[denonmarantz] Add HTTP protocol support for newer receivers #16747

jlaur opened this issue May 11, 2024 · 0 comments · Fixed by #16748
Assignees
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@jlaur
Copy link
Contributor

jlaur commented May 11, 2024

I recently purchased a Denon AVC-X4800H as replacement for my 17 year old Denon AVR-3808.

Previously I had not been using the binding, since I need the telnet port for other purposes (mainly Denon/Marantz-plugin for Android).

Now, I thought I'd give the binding a try since I assumed the new receiver would have proper HTTP protocol support.

I quickly discovered that the protocol was accessible through port 8080, but also noticed this remark:

// the above attempt failed. Let's try on port 8080, as for some models a subset of the HTTP API is
// available

After having added a new Thing, the next discovery was:

Trace logs
2024-05-11 23:34:07.456 [TRACE] [ector.http.DenonMarantzHttpConnector] - Refreshing Denon status
2024-05-11 23:34:07.456 [TRACE] [ector.http.DenonMarantzHttpConnector] - Refreshing URL: http://192.168.0.40:8080/goform/formMainZone_MainZoneXml.xml
2024-05-11 23:34:07.509 [TRACE] [ector.http.DenonMarantzHttpConnector] - result of getDocument for uri 'http://192.168.0.40:8080/goform/formMainZone_MainZoneXml.xml':
Error 403: Forbidden
Access Forbidden
2024-05-11 23:34:07.512 [DEBUG] [ector.http.DenonMarantzHttpConnector] - Failed to unmarshal xml document: null
2024-05-11 23:34:07.512 [TRACE] [ector.http.DenonMarantzHttpConnector] - Refreshing URL: http://192.168.0.40:8080/goform/formMainZone_MainZoneXmlStatus.xml
2024-05-11 23:34:07.515 [TRACE] [ector.http.DenonMarantzHttpConnector] - result of getDocument for uri 'http://192.168.0.40:8080/goform/formMainZone_MainZoneXmlStatus.xml':
Error 403: Forbidden
Access Forbidden
2024-05-11 23:34:07.519 [DEBUG] [ector.http.DenonMarantzHttpConnector] - Failed to unmarshal xml document: null
2024-05-11 23:34:07.520 [TRACE] [ector.http.DenonMarantzHttpConnector] - Refreshing URL: http://192.168.0.40:8080/goform/formZone2_Zone2XmlStatusLite.xml
2024-05-11 23:34:07.570 [TRACE] [ector.http.DenonMarantzHttpConnector] - result of getDocument for uri 'http://192.168.0.40:8080/goform/formZone2_Zone2XmlStatusLite.xml':
<?xml version="1.0" encoding="utf-8" ?>
<item>
<Power><value>OFF</value></Power>
<InputFuncSelect><value>SOURCE</value></InputFuncSelect>
<VolumeDisplay><value>Relative</value></VolumeDisplay>
<MasterVolume><value>-40</value></MasterVolume>
<Mute><value>off</value></Mute>
</item>

I loaded an old app project and found the HTTP implementation I did with help from a user (based on Wireshark captures/debug versions back and forth) almost 10 years ago, and located the interesting part for getting main zone information:

POST http://denon.local:8080/goform/AppCommand.xml

Request payload:

<?xml version="1.0" encoding="utf-8"?>
<tx>
 <cmd id="1">GetAllZonePowerStatus</cmd>
 <cmd id="1">GetVolumeLevel</cmd>
 <cmd id="1">GetMuteStatus</cmd>
</tx>

Response:

<?xml version="1.0" encoding="utf-8" ?>
<rx>
    <cmd>
        <zone1>OFF</zone1>
        <zone2>OFF</zone2>
        <zone3>OFF</zone3>
    </cmd>
    <cmd>
        <volume>-62.0</volume>
        <state>variable</state>
        <limit>  0.0</limit>
        <disptype>RELATIVE</disptype>
        <dispvalue>-62.0dB</dispvalue>
    </cmd>
    <cmd>
        <mute>off</mute>
    </cmd>
</rx>

Using this information it will be possible to adapt the method for retrieving main zone information for at least receivers since 2015. However, the tricky part will be to figure out which receivers supports the current binding's method, and which needs adaptation. There is also this small hint in the README:

Models >= 2016 use port 8080 and have a slightly different API

I have an old database of models and features, but it's very lacking:
https://vindvejr.dk/apps/denon-plugin/

I will also try to poke my old receiver and verify if it actually does support any of this.

I plan to create an enhancement for supporting my receiver. In the first draft version I imagine I'll make it conditional depending on the configured port number. As end result it should probably be the other way around. If it can be determined that port 8080 is directly related to the new method, and that this is actually a change that happened more than 10 years ago, we could make a more direct option.

During my research so far I also noticed that the binding is quite well written. 👍 Thanks @idserda, @jwveldhuis and others.

Your Environment

  • Version used: 4.2 latest snapshot
@jlaur jlaur added the enhancement An enhancement or new feature for an existing add-on label May 11, 2024
@jlaur jlaur self-assigned this May 11, 2024
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 11, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 11, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 13, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 13, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 13, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 14, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 14, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 15, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 23, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 24, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 24, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 24, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
jlaur added a commit to jlaur/openhab-addons that referenced this issue May 25, 2024
Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
lolodomo pushed a commit that referenced this issue May 25, 2024
* Add HTTP protocol support for newer receivers

Resolves #16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
LeeC77 pushed a commit to LeeC77/openhab-addons that referenced this issue May 27, 2024
…#16748)

* Add HTTP protocol support for newer receivers

Resolves openhab#16747

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: LeeC77 <lee.charlton00@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant