openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.58k forks source link

[WIP] Denon/Marantz 2.0 Binding #2204

Closed jwveldhuis closed 6 years ago

jwveldhuis commented 7 years ago

Hi all,

I started to work on a 2.0 Binding for Denon/Marantz AVR's. The 1.x Binding created by @idserda isn't working OK in OH2 and it doesn't seem like an easy upgrade to 2.0 from the existing code base, so I decided to start from scratch (and of course will reuse bits and pieces of the controlling logic were possible, the code of the 1.x Binding is well written). Let me know if someone else already started on this so we can collaborate.

As I did not develop any OH Binding before, so it will take me some time to get acquainted with the development process. Already got the IDE up and running and a skeleton binding working (thanks to the excellent documentation on docs.openhab.org and eclipse.org/smarthome :+1:)

I'm looking at the existing Pioneer, Yamaha and Onkyo Bindings for inspiration. When the time is there I need testers, as I only own 1 Marantz AVR myself ;)

Any advice I should look into before starting the implementation?


Update - 30 December 2017

The binding is almost finished and I'll sent it in for review soon. In the meantime you can install the binding manually:

nick1802 commented 6 years ago

@jwveldhuis i rebooted the raspberry and all 4 had been discovered.

DonFariac commented 6 years ago

Hallo

I installed your binding and it works fine for my Denon ( AVRX1200W) . 13 Channels were found. It's my first try with Openhab and I would like to have the QuikSelect Button into the Binding. I found the Commands "MS" with the parameter "QUICK" for example MSQUICK1 up to MSQUICK5 How can I insert this to the binding?

jwveldhuis commented 6 years ago

@DonFariac for the quick select you need to work on a rule that sends the commands.

E.g. make an item for the command (or assign it through paper UI) String marantz_command {channel="denonmarantz:avr:XXXXXX:command"}

In your rule send the command marantz_command.sendCommand("MSQUICK1")

Maybe create some virtual item with values 1..5, display those in your sitemap as [1][2][3][4][5], and make the rule trigger on 'when Item receives update'.

rule "quick select"
when Item vQuickSelect receives update
then
  marantz_command.sendCommand("MSQUICK" + vQuickSelect.state)
end
gooman-uk commented 6 years ago

@jwveldhuis Great job!

I'm using marantz_command.sendCommand to set the display dim level using the DIM command. All working well.

But I'd like to have a startup rule that sets the openHAB Item to match the actual setting of the device. The command reference shows a "DIM?" command to get the state - how do I get at the return value to be able to set the openHAB item?

jwveldhuis commented 6 years ago

@davidgurr there is no way to get a return value at the moment

You could configure persistence for the item, so OpenHAB restores the last known state at startup.

nick1802 commented 6 years ago

@jwveldhuis i dont use my zone2 much but i just noticed i can select input zones for zone 1 but have to enter them manually for zone 2. is this right or is my instance of OH2 not right? also is there away to change the volume from 0-100% to the -70dB -20dB type? i did see the volumedb in one of the files but have not tried changing it.

jwveldhuis commented 6 years ago

@nick1802 the volume in dB is a todo, did not implement that one yet. I believe each model can have a different range in min/max dB so need to test with that first.

jwveldhuis commented 6 years ago

@nick1802 just updated the binding (thanks for all your feedback):

https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.denonmarantz/2.3.0-SNAPSHOT/org.openhab.binding.denonmarantz-2.3.0-SNAPSHOT.jar

nick1802 commented 6 years ago

@jwveldhuis loving your work and at how quick you do it :) 💯 looking though your work but cant see how to do it myself. can you do the dB range for zone 2 and 3? from what i can see from my amp it doesn't do .5 intervals like main zone does.

thank you so much for all your work you have put into this binding!!!

jwveldhuis commented 6 years ago

I don't think the zones support a 'dB' scale, does your AVR show the volume in dB for them? Is the offset 80 as well?

nick1802 commented 6 years ago

All 3 modals that I have use dB or decimal -80 to 18 and 0 to 98 Main zone at intervals of .5 for the dB (not sure for dec)(will check when I have 5mins spare in the next few hrs) And zone 2 same ranges but at a 1 interval.

jwveldhuis commented 6 years ago

Added dB channels for Zone2 and 3 as well now. In Paper UI it works fine, it shows a slider with the range -80 - 18 dB With Basic UI and iOS app it isn't so great. You need to fiddle with Setpoint in the sitemap yourself:

Setpoint item=marantz_zone2_db label="Volume Zone 2 [%.1f dB]"  minValue=-80 maxValue=12 step=1
gitmaster2013 commented 6 years ago

Just got a Denon AVR X2400H for Christmas. I already figured out, that http is not supported anymore and that the 2.0 addon should default back to telnet (read&write). However on the paper UI I keep getting " OFFLINE - COMMUNICATION_ERROR - ... Server returned HTTP response code: 403...". Any idea on how I can track down the issue?

jwveldhuis commented 6 years ago

@gitmaster2013 Did you download the jar today? I just fixed the Discovery by checking whether HTTP is working and if not, revert to the telnet mode for initial configuration. Not sure if it is in the jar file already, because there are issues with the builds of openHAB currently.. :/ Edit: just checked.. it is not yet in the published jar, that is why you get this error as before my change it configured HTTP by default.

Alternatively, add the Thing manually and ignore the discovered item. Then enable telnet at the thing configuration before adding it.

pravussum commented 6 years ago

Had the same issues as @gitmaster2013, but after building the JAR from github (and activating telnet in the configuration) I confirm this to work with a Denon X4400H (Main Zone + Zone 2). Good job 👍

jwveldhuis commented 6 years ago

The build issue with OpenHAB is fixed: https://twitter.com/kaikreuzer/status/947511016308527105

Kicked off new build and the jar is just updated, so @gitmaster2013 you can try again by redownloading the jar file. @pravussum I don't even know how to build the jar locally, thanks for confirming ;)

gitmaster2013 commented 6 years ago

@jwveldhuis Thank you so much for the info and your great work! I just deleted the addon jar downloaded it again an restarted Openhab. Just like @pravussum it now works great for me too.

Xplorer88 commented 6 years ago

Hi @jwveldhuis , Thank you for your work! Some HTTP GET requests are available on port 8080 not 80. For example: http://:8080/goform/formMainZone_MainZoneXmlStatusLite.xml or http://:8080/goform/formiPhoneAppVolume.xml?1+- (Zone1) http://:8080/goform/formiPhoneAppVolume.xml?2+- (Zone2) Since the 2016 models the web api has changed. I have got a Denon x4300h. For the newer devices that support the HEOS protocol it is also worth to check the follwing binding: https://github.com/Wire82/org.openhab.binding.heos/releases

nick1802 commented 6 years ago

@jwveldhuis all the zone 2 labels are missing from the paper ui

jwveldhuis commented 6 years ago

@xploder88 only "some" or all?

/goform/formMainZone_MainZoneXml.xml
/goform/formMainZone_MainZoneXmlStatus.xml
/goform/formZone2_Zone2XmlStatusLite.xml
/goform/formZone3_Zone3XmlStatusLite.xml (in case of Zone 3)
/goform/Deviceinfo.xml
/goform/AppCommand.xml
/goform/formiPhoneAppDirect.xml

If all exists, could you test by manually adding the Thing and in the advanced parameter set http port to 8080?

@nick1802 hm ok, let me check on that. The code to add the addtitional channels for the zones might not be perfect. Did you try to remove and re-add the Thing?

jwveldhuis commented 6 years ago

As of today the binding is available through the Eclipse Marketplace: https://marketplace.eclipse.org/content/denonmarantz-binding (Install the Misc -> IoT Marketplace add-on, then the DenonMarantz binding should show up in Paper UI as binding to install, see https://community.openhab.org/t/distributing-bindings-through-the-iot-marketplace/24491 for more info).

nick1802 commented 6 years ago

hey @jwveldhuis , just reinstalled the binding. still no go on the zone 2 labels

Xplorer88 commented 6 years ago

@jwveldhuis unfortunately only some... I didn't find any updated api description yet. A couple of months ago i have changed the port of the 1.x binding and some functions worked. I'm not at home so i cannot try to change the port of the Thing. I can tell you more next week. Another possibility to get information from the AV receiver is to use the POST method on port 8080 (This API method should work for pre 2016 and 2016, 2017 receivers). Maybe you use it already...?

/goform/AppCommand.xml

Body:

<?xml version="1.0" encoding="utf-8"?>
<tx>
<cmd id="1">GetAllZonePowerStatus</cmd>
<cmd id="1">GetVolumeLevel</cmd>
<cmd id="1">GetMuteStatus</cmd>
<cmd id="1">GetSurroundModeStatus</cmd>
<cmd id="1">GetRestorerModeStatus</cmd>
...
</tx>
nick1802 commented 6 years ago

update on my issue with the zone2 text. i think it may have been my own doing as i have been editing the thing-type.xml file, changing the input list to match what i have renamed my inputs. when i 1st install binding on a fresh install of openhab it shows the default. after reboot it shows my edits minus the zone2 channel names.

kovu94 commented 6 years ago

Hi, first of all thanks for your great work. I'm playing around with openHAB for a few weeks now and I'm trying to integrate my AVR. It's a Denon AVR3310. I can control basic functions via telnet command, for web control it doesn't seem to work (but I don't see an error message). The AVR has a web interface and I can control it on that. Is it possible to send specific commands like switch to NET/USB and play FAVORITE 1 station or something? Because the channel command Errors I see in the logfile: 2018-01-05 15:03:01.274 [WARN ] [nmarantz.handler.DenonMarantzHandler] - Command for channel surroundProgram not supported. 2018-01-05 15:03:01.343 [WARN ] [nmarantz.handler.DenonMarantzHandler] - Unsupported command REFRESH for channel command

My items test file: Switch denon_power "Receiver" {channel="denondenon:avr:ea14d064:power"} Dimmer denon_volume "Volume" {channel="denondenon:avr:ea14d064:mainVolume"} Switch denon_mute "Mute" {channel="denondenon:avr:ea14d064:mute"} String denon_input "Input [%s]" {channel="denondenon:avr:ea14d064:input"} String denon_surround "Surround: [%s]" {channel="denondenon:avr:ea14d064:surroundProgram"} String denon_command {channel="denondenon:avr:ea14d064:command"}

Switch denon_muteZ3 "Mute" {channel="denondenon:avr:ea14d064:zone3Mute"} Switch denon_powerZ3 "Power" {channel="denondenon:avr:ea14d064:zone3Power"} Dimmer denon_volumeZ3 "Volume" {channel="denondenon:avr:ea14d064:zone3Volume"} String denon_inputZ3 "Input [%s]" {channel="denondenon:avr:ea14d064:zone3Input"}

and my sitemap test file: sitemap denon label="Receicver Wohnzimmer" { Text label="Zone Wohnzimmer" icon="sofa" { Default item=denon_mute visibility=[denon_power==ON] Setpoint item=denon_volume label="Volume [%.1f]" minValue=0 maxValue=50 step=0.5 visibility=[denon_power==ON] Selection item=denon_input mappings=["NET/USB"=Internetradio,"SAT/CBL"="Sat-Receiver"] visibility=[denon_power==ON] Default item=denon_surround visibility=[denon_power==ON] } Text label="Zone Küche" icon="kitchen" { Default item=denon_powerZ3 visibility=[denon_power==ON] Default item=denon_muteZ3 visibility=[denon_power==ON] Setpoint item=denon_volumeZ3 label="Volume [%.1f]" minValue=0 maxValue=50 step=0.5 visibility=[denon_power==ON] Selection item=denon_inputZ3 mappings=["NET/USB"=Internetradio,"SAT/CBL"="Sat-Receiver"] visibility=[denon_power==ON] } }

If I can help you with testing feel free to ask. :)

jwveldhuis commented 6 years ago

@nick1802 ahh, well if you change the files you break the warranty ;) Maybe we can add discovery of the input names later. I was checking out the Yamaha Binding, and there a very nice implementation is made to dynamically add the options for the specific AVR. Most likely this won't work for telnet-only AVRs.

@kovu94 this should be possible. You need to look into implementing a .rules file and use denon_command.sendCommand("..")

Check the documentation as linked in the README.md - Control Protocol Documentation to learn what to send.

Probably something like this (with denonAction being a item without channel as virtual switch):

rule "play favorite 1"
when Item denonAction received command

   ...
  denon_command.sendCommand("SIFVP") // or 'SIUSB' or 'ZMFAVORITE1'
end
kiggaaa commented 6 years ago

Thank you for your work! The binding works perfectly for me with Denon X3000. I use it to change volume, switch inputs etc. with Alexa.

If someone is interested: first I used the myopenhab.org service to connect to Alexa, but this service seemed to be a little bit unstable. Now I use the Hue Emulation Addon, and this - until now - does a good job!

ghost commented 6 years ago

I'll gladly join in for testing. The 1.0 binding stopped working for me after the OH 2.2 update. Will be testing with a Denon AVR X3000.

amut41 commented 6 years ago

The binding works fine with my brand new AVR-X1400H (through Telnet as it does not provide HTTP) with one exception: After a while (somewhere between hours and days) the Thing goes offline for no obvious reason. I have found two ways to get it back working:

  1. Manually switch AVR on.
  2. Switch from Telnet to HTTP and back.

Apparently there is some glitch in the telnet connection which makes it appear as busy/offline.

jwveldhuis commented 6 years ago

@amut41 okay.. it should try to reconnect every minute. Is there anything in the log?

amut41 commented 6 years ago

@jwveldhuis No, nothing in INFO mode. PaperUI indicates the Thing's status as Offline, the message beneath tells that the Telnet connection appears to be busy and one should consider switching to HTTP (which is unfortunately not being supported by X1400H). I have just switched to DEBUG logging, maybe somethings shows up there. I'll keep you posted.

kovu94 commented 6 years ago

I've a similar behavior here with my 3310 but unfortunately I'm not able to test a lot until the 25st of January. Holidays are calling. :-)

kovu94


From: amut41 notifications@github.com Sent: Friday, January 12, 2018 17:59 To: openhab/openhab2-addons Cc: kovu94; Mention Subject: Re: [openhab/openhab2-addons] [WIP] Denon/Marantz 2.0 Binding (#2204)

@jwveldhuishttps://github.com/jwveldhuis No, nothing in INFO mode. PaperUI indicates the Thing's status as Offline, the message beneath tells that the Telnet connection appears to be busy and one should consider switching to HTTP (which is unfortunately not being supported by X1400H). I have just switched to DEBUG logging, maybe somethings shows up there. I'll keep you posted.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/openhab/openhab2-addons/issues/2204#issuecomment-357285052, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AE50oluqTAApPpM2BX7R0udxWBNv059qks5tJ4ebgaJpZM4NHOVM.

amut41 commented 6 years ago

I experienced the behavior again but even DEBUG logging does not show any log entry at all. After switching on the receiver manually the receiver responds correctly and openhab.log looks fine:

Received Command: PW, value: ON Recieved state ON for channelID power Received Command: ZM, value: ON Recieved state ON for channelID mainZonePower Received Command: SS, value: ALSSET ON Received Command: SS, value: ALSDSP ON Received Command: SS, value: ALSVAL 000 Received Command: PS, value: DELAY 000 Received Command: SS, value: INFAISSIG 02 Received Command: SS, value: INFAISFSV 48K Received Command: PW, value: ON Received Command: MV, value: 40 Recieved state 40 for channelID mainVolume Received Command: SI, value: MPLAY Recieved state MPLAY for channelID input Received Command: CV, value: FL 50 Received Command: CV, value: FR 50 Received Command: CV, value: END Received Command: SS, value: VCTZMAPON LAS Received Command: MS, value: STEREO Recieved state STEREO for channelID surroundProgram Received Command: SD, value: AUTO Received Command: DC, value: AUTO Received Command: PS, value: MULTEQ:OFF Received Command: PS, value: DYNEQ OFF Received Command: PS, value: DYNVOL OFF Received Command: PS, value: DRC OFF Received Command: PS, value: LFE 00 Received Command: PS, value: BAS 50 Received Command: SV, value: OFF Received Command: PS, value: TRE 50 Received Command: PS, value: TONE CTRL OFF Received Command: MV, value: MAX 98 Received Command: SS, value: INFAISSIG 02 Received Command: SS, value: INFAISFSV 48K Received Command: SS, value: VCTZMAPON LAS Received Command: SI, value: NET Recieved state NET for channelID input Received Command: CV, value: FL 50 Received Command: CV, value: FR 50 Received Command: CV, value: END Received Command: SD, value: AUTO Received Command: DC, value: AUTO Received Command: PS, value: MULTEQ:OFF Received Command: PS, value: DYNEQ OFF Received Command: PS, value: DYNVOL OFF Received Command: MV, value: MAX 98 Received Command: SV, value: OFF Received Command: PW, value: STANDBY Recieved state OFF for channelID power Received Command: ZM, value: OFF Recieved state OFF for channelID mainZonePower

However, one thing I found out is that the receiver goes on- and offline during the day (network binding) and appears to be online for not even two minutes in an hour:

2018-01-12 11:18:20.893 [vent.ItemStateChangedEvent] - Network_Denon_AVR_X1400H changed from OFF to ON 2018-01-12 11:20:14.605 [vent.ItemStateChangedEvent] - Network_Denon_AVR_X1400H changed from ON to OFF 2018-01-12 12:18:06.681 [vent.ItemStateChangedEvent] - Network_Denon_AVR_X1400H changed from OFF to ON 2018-01-12 12:19:56.982 [vent.ItemStateChangedEvent] - Network_Denon_AVR_X1400H changed from ON to OFF 2018-01-12 13:18:16.485 [vent.ItemStateChangedEvent] - Network_Denon_AVR_X1400H changed from OFF to ON 2018-01-12 13:20:06.726 [vent.ItemStateChangedEvent] - Network_Denon_AVR_X1400H changed from ON to OFF

AFAIK the network binding uses ping to test whether a device is on- or offline. However, while network binding shows "offline" the Thing is still online in PaperUI and HABmin and can also be switched on and off.

tloers commented 6 years ago

Nice - thank for your efforts! As I didn't read it so far, I thaught it might be interesting that it works with my Denon X1300W. At least it is found and I can switch on and off. Rest is to be tested.

grzegorz914 commented 6 years ago

Hi, if I use Http communication on port 8080(Denon AVR-X6300H) after some time in openHAB.log I see:

`- 'denonmarantz:avr:xxxxxxxx' changed from OFFLINE (COMMUNICATION_ERROR): IO error while connecting to AVR: Server returned HTTP response code: 403 for URL: http://192.168.1.6:8080/goform/formMainZone_MainZoneXml.xml to OFFLINE (COMMUNICATION_ERROR): IO error while connecting to AVR: Server returned HTTP response code: 403 for URL: http://192.168.1.6:8080/goform/formMainZone_MainZoneXmlStatus.x

jwveldhuis commented 6 years ago

@grzegorz914 ok, that is because some of the HTTP calls are not supported by the ....H Models. Did you try telnet?

@amut41 is the receiver connected with a network cable or wireless? Maybe the wireless connection is unstable?

grzegorz914 commented 6 years ago

Yes, telnet connection work OK

michelevol commented 6 years ago

Hi, binding org.openhab.binding.denonmarantz-2.2.0-SNAPSHOT works perfectly with my DENON AVR1300W. Now I would like to add the option of changing Tuner channel, using TPANUP or TPANDOWNor TPANMEM.

Can I do it using current binding ?
Can I simply extend its configuration, or there is a need to recompile the binding ?

Thanks Michele

jwveldhuis commented 6 years ago

@michelevol should be possible with a rule like described here: https://github.com/openhab/openhab2-addons/issues/2204#issuecomment-356294251

tloers commented 6 years ago

Well - I had the chance to test ab bit. I am very thankful for this binding. Everything works out fine so far. (as I already mentioned - I use it with a Denon AVR X1300W)

However - there is still one question - will I be able to switch surround mode with the binding, or is it simply not supported by the X1300W? The official app can do it. But when I want to write some rules on it for e.g. cinema scenario, I would like to be able to set the surround mode via openhab.

other than that ... GREAT! thank you!

jwveldhuis commented 6 years ago

@tloers that’s definitely possible. You need to use the command channel and look up the right command in the protocol documentation, eg ‘MSSTEREO’

amut41 commented 6 years ago

@jwveldhuis On your question re the connection: My receiver is connected by wire, unstable connection is extremely unlikely. However, I haven't seen this "falling to offline behavior" for a while now so I guess we can consider it resolved (maybe by superior forces?) for the moment. Once it occurs again I'll post here.

amadeus74 commented 6 years ago

@jwveldhuis. I want to create a rule to power on the Denon AVR2400H following a condition. It's possible without the command channel? Thanks.

ghost commented 6 years ago

You can just use DENON_Power.sendCommand(ON) from a rule (where "DENON_Power" is the item for the main power switch). That's quite easy, if the receiver is "ONLINE" from OpenHAB perspective.

jwveldhuis commented 6 years ago

@amadeus74 I was typing and then saw @ohaak already gave the right info ;)

reyem commented 6 years ago

nice, that a 2.0 binding is in work. I have a x2400h model. This seems to be just partially supported. I have following issues so far:

after OH ( version 2.3.0 Build #1201) start, when the binding is initialized, I get an exception

java.lang.NoClassDefFoundError: org/eclipse/smarthome/core/thing/type/TypeResolver
    at org.openhab.binding.denonmarantz.handler.DenonMarantzHandler.addZoneChannels(DenonMarantzHandler.java:153) ~[?:?]
    at org.openhab.binding.denonmarantz.handler.DenonMarantzHandler.initialize(DenonMarantzHandler.java:128) ~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[?:?]
    at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [114:org.eclipse.smarthome.core:0.10.0.201801231340]
    at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [114:org.eclipse.smarthome.core:0.10.0.201801231340]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
    at java.lang.Thread.run(Thread.java:745) [?:?]
Caused by: java.lang.ClassNotFoundException: org.eclipse.smarthome.core.thing.type.TypeResolver cannot be found by org.openhab.binding.denonmarantz_2.3.0.201801011232
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:410) ~[?:?]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372) ~[?:?]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364) ~[?:?]
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161) ~[?:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:?]
    ... 12 more

Having "telnet" configured the thing comes still online. I couldn't test yet if the channels work, but looks promising. Power ON/OFF actually worked. However, I would like "http" for the connection. But if I switch the configuration to http I get exceptions. First I got a 403 response. The reason was the port. I had to configure 8080 which made the thing come online for a second, but than failed with an other communication error. In the log I have a similar exception as above and paper UI shows me ( I guess this is the similar issue @grzegorz914 reported already):

IO error while connecting to AVR: Server returned HTTP response code: 403 for URL: http://192.168.1.212:8080/goform/formMainZone_MainZoneXmlStatus.xml setting log level to DEBIG shows me following entry:

2018-01-30 16:10:50.008 [DEBUG] [rantz.internal.DenonMarantzConnector] - IO error while retrieving document: {}
java.io.IOException: Server returned HTTP response code: 403 for URL: http://192.168.1.212:8080/goform/formMainZone_MainZoneXmlStatus.xml
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840) [?:?]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441) [?:?]
    at org.openhab.binding.denonmarantz.internal.DenonMarantzConnector.doHttpRequest(DenonMarantzConnector.java:760) [52:org.openhab.binding.denonmarantz:2.3.0.201801011232]
    at org.openhab.binding.denonmarantz.internal.DenonMarantzConnector.getDocument(DenonMarantzConnector.java:692) [52:org.openhab.binding.denonmarantz:2.3.0.201801011232]
    at org.openhab.binding.denonmarantz.internal.DenonMarantzConnector.updateMainZone(DenonMarantzConnector.java:591) [52:org.openhab.binding.denonmarantz:2.3.0.201801011232]
    at org.openhab.binding.denonmarantz.internal.DenonMarantzConnector.refreshHttpProperties(DenonMarantzConnector.java:676) [52:org.openhab.binding.denonmarantz:2.3.0.201801011232]
    at org.openhab.binding.denonmarantz.internal.DenonMarantzConnector.access$0(DenonMarantzConnector.java:672) [52:org.openhab.binding.denonmarantz:2.3.0.201801011232]
    at org.openhab.binding.denonmarantz.internal.DenonMarantzConnector$1.run(DenonMarantzConnector.java:162) [52:org.openhab.binding.denonmarantz:2.3.0.201801011232]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
    at java.lang.Thread.run(Thread.java:745) [?:?]

Any hints on how to get this working via http?

Some observations using the browser

I get a result by calling following URL with the browser

http://192.168.1.212:8080/goform/Deviceinfo.xml

but the following URL returns 403

http://192.168.1.212:8080/goform/MainZoneXmlStatus.xml

In the answer to @grzegorz914 you mention some urls do not work with the H models. However, does this mean they will not be supported via http, or is this just to be done later?

jwveldhuis commented 6 years ago

@reyem that Exception at the start I don't know what that is about.. I need to check..

And as you have found, the H model does not have the same HTTP API as all the other models have. Hence, HTTP is not supported at all currently for H models. And I don't intent to add support for those myself. Maybe someone can add that later, the binding is currently being reviewed.

Is there a specific reason not to use telnet? I have updated the Discovery so it configured Telnet by default for H models. Telnet is more responsive to status changes compared to HTTP.

reyem commented 6 years ago

OK thank you. Telnet should work for now.

Is there a specific reason not to use telnet?

Well I haven't tested it enough yet. But as the telnet connections seems to stay open, I fear stability issues in cases like power off the denon the hard way ( switch off at the socket ) and such things. But let's see how good the binding handles this cases ;-)

Maybe someone can add that later, the binding is currently being reviewed.

Maybe I will find some time to sniff the traffic of the denon 2016 App, which can control the receiver. I doubt this goes via telnet and rather uses http as well. Just FYI, from the URLs listed here:

http://blue-pc.net/2013/12/28/denon-av-reciever-ueber-http-steuern/

In the "Status" section, all URLs ending with "*Lite.xml" and the "Deviceinfo.xml" worked. But that does probably not help much at the moment.

just for reference if somebody follows up on this. Here the "same" issues is discussed with a possible solution proposal: https://github.com/scarface-4711/denonavr/issues/32

jwveldhuis commented 6 years ago

@reyem the TypeResolver error is caused by a recent change in 2.3.0 SNAPSHOT release (#4787), I will need some time to address that. Maybe needless to say that for "production" deployments of OpenHAB it's better to stick to the latest stable release (2.2.0) as things can break on the current development version.

mishakim commented 6 years ago

I have the binding up and running with a Denon avr3313ci, and it works except for one problem: if the receiver is turned off by CEC (i.e., TV turned off, which causes the receiver to turn off), OpenHAB doesn't detect this, and continues to show that it is on. There is nothing in the logs (but I don't have debug turned on). Before I start detailed debugging, I want to confirm -- should the binding see when the receiver is manually turned off, or is this a known limitation? I'm using HTTP, as I also use the iOS app.