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?
The binding is almost finished and I'll sent it in for review soon.
In the meantime you can install the binding manually:
/usr/share/openhab2/addonsHi jwveldhuis,
I've never did anything like developing a binding, but I have a Denon X4300H and a running OH 2 instance at home. Please contact me if You think Your binding is ready to be tested.
BR
GRORI
Count me in. I have a marantz SR5009
@orificer @neohusky will do, thanks for the offer! It will take some time before I have something working. Have a Marantz SR5008 myself.
If you need a tester - I have a denon 5200w that I'd love to automate but haven't had the time to write a binding for. Likewise feel free to bounce stuff off me if you need (I've done 4 bindings now)
The current 1.x binding should work fine with 2.0, what problems are you having? Some minor issues do not really justify a complete rewrite 😃 If you want to add auto discovery and conform to the 2.0 item/channel structure however creating a 2.0 binding sounds like a good plan. I would reuse all the parts off the current binding that handle communication with the receiver (telnet listener and creating/parsing the XML http-messages) and create a new Handler to communicate it all back/from OH2. Let me know if you have any questions, I'd be happy to test the new binding.
Hi @idserda! Well, the telnet connection didn't work at all for me in OH2 and lot's of others complained in the community about not getting it to work. Not sure what really causes those issues, but thought it would be good anyway to get it 2.0 ready and debug along the way.
Working on auto discovery now. My SR5008 responds to mDNS :smile: so I think it will not be that hard.
While I was digging more into the code today I can see your 1.x binding is structured really well, so the 'from scratch' comment is not so much applicable anymore. And the protocol is stable indeed, no need to do any rewrites there. I think 80-90% of the code can be ported with minor modifications (and of course will leave the authors credits :wink: )
Ok great stuff! Telnet works in 2.0 with a Denon AVR-X2000, maybe there are some subtle differences in the Marantz receivers (or something else is using the telnet connection, most receivers only support one concurrent connection).
Very cool that auto discovery is already working! Defining the things/channels probably takes a bit more time 😃
@idserda @tmrobert8 @orificer if you could do me a favor and collect input for auto discovery?
What is the output for the following command (Linux, preferably from the box running OpenHAB):
$ avahi-browse -kv _raop._tcp
(you might need to install the avahi-utils package)
I hope it is similar to mine, e.g. 'serial number'@{Marantz/Denon} {Model}
This is mine:
Server version: avahi 0.6.32-rc; Host name: openhab2.local
E Ifce Prot Name Type Domain
+ enp0s10 IPv4 0006781D58B1@Marantz SR5008 _raop._tcp local
Here you go, seems to match the format:
Server version: avahi 0.6.32-rc; Host name: fruitschaal.local
E Ifce Prot Name Type Domain
+ br0 IPv4 0005CD3AB07D@Denon AVR-X2000 _raop._tcp local
Looks identical:
Server version: avahi 0.6.31; Host name: Pi-Prod.local
E Ifce Prot Name Type Domain
+ eth0 IPv4 0005CD75215C@Denon AVR-X4300H _raop._tcp local
Thanks guys for the prompt response! This is great news, it means both the Denon and Marantz (when 'Airplay capable') can be discovered like this.
Status update:
-Discovery is working like a charm! I'm using the serial number to prevent duplicate results.
-Changed the telnet client loop to use a BufferedReader, to prevent chopped / incomplete commands from being processed
-Defined channels
-Lot's of testing around properly disconnecting / disposing the connection (updating the Thing is triggering a dispose->initialize on the Handler)
Still a lot of work remaining. Due to the different concepts in OH2 a lot of refactoring is needed.
E.g. dedicated ThingHandler vs Binding handling multiple instances.
Trying to find some way to represent the State of the AVR and trigger the Handler using a 'StateChangeListener', e.g. have an object with all fields with the properties of the AVR. When a property is updated (to a different value) it should trigger the Handler which then can send the appropriate 'sendUpdates'. Something like that was done in the old binding, but it's implementation is scattered over the different parts of the 1.x Binding. That's part of the puzzle that's fun to solve, but it will take some more time to come up with a proper implementation.
Also want to implement telnet as follows:
-if telnet is enabled, try to use it.
-if it fails, fall back to HTTP polling until telnet is available
With OH1 I was using a telnet multiplexer (simple python script), which I connected to the AVR. The multiplexer can handle multiple concurrent connections, so I had OH1 connected to the mulitplexer and could still use the dedicated remote control apps (requiring telnet) on my phones and tablets (also connected to the multiplexer).
I'm too busy these days to make good progress on this binding. It is a lot more work than I initially hoped it would be (also because I started to refactor more and more ;) ). I will still continue to work on it, though thought it was a good moment to push some the current work to my own fork ;)
https://github.com/jwveldhuis/openhab2-addons/tree/denon-marantz-binding
Commit containing the changes:
https://github.com/jwveldhuis/openhab2-addons/commit/99af48b9947071d4d9b0b226f591ad0490b6c4b9
It's definitely not ready yet to use 'in production', but if someone wants to test the 'what should work' list above or wants to provide early feedback, don't hesitate ;)
I do not have a lot of time at the moment, too. But I think I will be able to find the time to to a short test of the "what should work" list.
As this is the first binding where I want to test at an early state of the development: Is there a short summary what I need to do to get the needed jar file out of the two links posted by jwveldhuis?
Server version: avahi 0.6.31; Host name: openHABianPi.local
E Ifce Prot Name Type Domain
Hello guys,
I really want to add the binding to my openHAB2 installation. The problem is, I have no idea how...Could you give me a hint how to do it?
I installed openHAB2 on ubuntu. My /usr/share/addons folder contains two files (openhab-addons-2.1.0.kar and openhab-addons-legacy-2.1.0.kar).
I cloned the repository already but I have no clue how I can add the new denon/marantz binding so that I can see/use it in PaperUI or HABmin.
I would really appreciate your help, thanks.
@stotz89 the binding is still needs some work to use it in 'production'.
I believe the jar files for bindings under development are generated once a pull request is done against the master repository, hopefully will have time next month to pick up work on this binding.
If you want to try out the current version you need to run OpenHAB using the Eclipse IDE: http://www.eclipse.org/smarthome/documentation/development/ide.html and switch the repository to my fork.
@jwveldhuis Did you find time to continue working on the binding?
@JannikJung not yet, will try to find out how to publish the current version for testing.
I made a small change to the 1.x binding, it now sends commands over the telnet connection too. Before, it would always use the http interface to issue commands, but not all receivers supported this. You might want to use this in the 2.x binding too. PR is here: https://github.com/openhab/openhab1-addons/pull/5342
@idserda thanks, will also get rid of the Apache TelnetClient as you mentioned to be problematic.
Just submitted initial PR for the new binding, hope it will generate the required jar files to enable testing by others (because it's not perfect yet).
Discovery, Telnet and HTTP control should work, as well as sending a custom command through the 'command' Channel.
jar file of DenonMarantz 2.0 binding (BETA, work in progress!)
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.denonmarantz/2.2.0-SNAPSHOT/org.openhab.binding.denonmarantz-2.2.0-SNAPSHOT.jar
Put this jar file in /usr/share/openhab2/addons and go to the Inbox in Paper UI
You all are very welcome to test this binding and let me know any issues or suggestions.
@orificer @stotz89 @neohusky @tmrobert8 @jacksteraz @JannikJung @idserda
The binding is ready to be tested (finally found time and motivation to continue, sorry for the wait)
Some remarks:
@jwveldhuis
Thanks a lot for your effort.
I just had a quick look at it. I downloaded it and added it to my add-on-folder. Discovery of my Marantz NR1604 worked perfectly. Both zones were recognized. (Btw my openHAB runs on openHAB 2.1.0 - release build - )
I also linked all channels to an item. Worked also fine. I only tested some commands like switching on/off, volume +/-, mute on/off, mainzone on/off. Everything worked as expected.
As soon as I have some more time to test, I will report. But for the first build looks quiet promising.
Thanks!
@jwveldhuis
Great work on the binding.
I have installed the binding on openHAB 2.2.0 and I'm using Denon AVR-X2200W. All the configuration that I'm doing is via PaperUI.
Discovery of the Thing works great. Linking of the Channels for Main Zone and Zone2 (AVR-X2200W has got only 2 zones) are working as expected and Controls are working fine. I have tested all switches (Power, Main Volume, Input source) and String fields (Now playing - artist, track, album, Surround program) and they are working fine.
Works very well with my Denon X3200W with auto detection through PaperUI. Do you have any notes on how to set up a .things file appropriately? Thanks for all the hard work!
@pabloNZ what do you mean with a .things file? Do you mean a .items file?
I don't use Paper UI to link items to things, I exclusively use text based files (as I was used to with OpenHAB 1.x and had bad experience with having a mixed approach)
This is my current list of items (you can copy the channels in Paper UI -> Things -> "Your Receiver").
Note some Channels are only shown when clicking Show More, especially the _:command_ channel)
marantz.items
Switch marantz_power "Receiver" <switch> {channel="denonmarantz:avr:0006781d58b1:power"}
Dimmer marantz_volume "Volume" <soundvolume> {channel="denonmarantz:avr:0006781d58b1:mainVolume"}
Switch marantz_mute "Mute" <mute> {channel="denonmarantz:avr:0006781d58b1:mute"}
Switch marantz_z2power "Zone 2" {channel="denonmarantz:avr:0006781d58b1:zone2Power"}
String marantz_input "Input [%s]" {channel="denonmarantz:avr:0006781d58b1:input" }
String marantz_surround "Surround: [%s]" <surround> {channel="denonmarantz:avr:0006781d58b1:surroundProgram"}
String marantz_command {channel="denonmarantz:avr:0006781d58b1:command"}
and this is the relevant part of my sitemap (still trying how to best present the receiver)
default.sitemap
...
Group item=marantz_input label="Receiver" icon="receiver" {
Default item=marantz_power
Default item=marantz_mute visibility=[marantz_power==ON]
Setpoint item=marantz_volume label="Volume [%.1f]" minValue=0 maxValue=40 step=0.5 visibility=[marantz_power==ON]
Selection item=marantz_input mappings=[TV=TV,MPLAY=Kodi] visibility=[marantz_power==ON]
Default item=marantz_surround visibility=[marantz_power==ON]
}
...
in a .rules file you can send commands (See reference documents linked at the old binding wiki)
Example to switch to MULTI CH STEREO:
sendCommand(marantz_command,"MSMCH STEREO")
or
marantz_command.sendCommand("MSMCH STEREO")
@jwveldhuis With some of my other OH2 bindings you can set up .things files for them so that you don't have to use PaperUI to discover anything.
Your example items are helpful though, thanks for sharing.
@pabloNZ ahh ok, didn't know about the .things files. Hence I did not do any testing with that. Maybe will do and then add it to the documentation.
So far only got positive feedback and the binding in my own 'production' OpenHAB is also working like expected.
Next step is to further work on the pull request to get it approved and merged into OpenHAB 2.2.
Great work on the binding! There does seem to be an issue with auto discovery on my set up, the receiver does not show up in the inbox. This is in the logs:
2017-12-04 20:45:50.274 [DEBUG] [ery.DenonMarantzDiscoveryParticipant] - AVR found: 0005CD3AB07D@Denon AVR-X2000._raop._tcp.local.
2017-12-04 20:45:50.275 [DEBUG] [ery.DenonMarantzDiscoveryParticipant] - This seems like a supported Denon/Marantz AVR!
2017-12-04 20:45:50.275 [DEBUG] [ery.DenonMarantzDiscoveryParticipant] - Could not determine IP address for the Denon/Marantz AVR
This is the output of avahi-browse, where there is an IP-address:
$ avahi-browse -kvr _raop._tcp
= br0 IPv4 0005CD3AB07D@Denon AVR-X2000 _raop._tcp local
hostname = [Denon-AVR-X2000.local]
address = [192.168.1.70]
port = [1032]
txt = ["fv=s9610.1000.0" "am=AVRX2000" "vs=141.9" "vn=65537" "tp=UDP" "ss=16" "sr=44100" "sv=false" "pw=false" "md=0,1,2" "ft=0x44F8A00" "et=0,4" "da=true" "cn=0,1" "ch=2" "txtvers=1"]
Any idea what's going on? I can try to debug it in the IDE if I have some time later.
@idserda thank you for testing. I've updated the binding:
https://github.com/openhab/openhab2-addons/pull/2859/commits/56e4f5ed478a0189f02954144979e9d65bf5cc76
Changed the way the host is retrieved from the MDNS info (compared with some other bindings), hope it will work now and still works for the others (tested myself and I expect it will remain working).
Binding jar file is updated:
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.denonmarantz/2.2.0-SNAPSHOT/org.openhab.binding.denonmarantz-2.2.0-SNAPSHOT.jar
Thank you very much. It work great with Denon AVR-X1400H, but only in Telnet mode.
@nelmi thank you for your feedback.
If you browse to http://<IP of your Denon/ do you see a web interface?
Not sure whether this model supports an HTTP API, I expect it would.
@jwveldhuis no, the new models of Denon (AVR-X..00H) don't support web interface. When i open it in browser i receive
Error 403: Forbidden
Access Forbidden
If you are interested, here is a link to the Denon AVR IP Protocol: https://www.denon.de/de/product/homecinema/avreceiver/avrx5200w?docname=IP_Protocol_AVR-Xx100.pdf
@nelmi ok, yes it's the same protocol for telnet.
The fact that you get a HTTP 403 means it is offering some services over HTTP.
Quickly checked the manual, could only find something about /Settings to setup the network settings for the AVR.
There is a new Denon iOS/Android app for 2017 models, maybe they've changed the HTTP API.
Well at least it still works with telnet :)
@jwveldhuis I was running an older snapshot version of the OH2 runtime, after upgrading to the latest snapshot auto discovery was working fine 😃
I tried the JAR you posted a couple of days ago, unfortunately it didn't detect my AVR.
Here's what avahi-browse -kvr _raop._tcp sees:
Server version: avahi 0.6.31; Host name: homebox.local
E Ifce Prot Name Type Domain
+ wlan0 IPv4 0005CDA10537@mediabox _raop._tcp local
= wlan0 IPv4 0005CDA10537@mediabox _raop._tcp local
hostname = [mediabox.local]
address = [192.168.0.24]
port = [1025]
txt = ["vs=190.9.p6" "vn=65537" "tp=UDP" "sf=0x4" "am=AVRX2300W" "md=0,1,2" "fv=p6.1400.0" "ft=0x444F8A00" "et=0,4" "da=true" "cn=0,1"]
: Cache exhausted
: All for now
This is on openHABian with the current 2.2 Snapshot.
Doing a Scan with your binding in the Inbox also doesn't find anything. =(
@jwveldhuis ,
thanks for this binding in testing!!
same as jangrewe it would not auto detect my avr.
but i am able to manually add and at time of typing this it is working and in the next 24hrs i will test most of the functions you have setup.
below you can see i have 4 denon avr's
i like the idea of it collecting input names from the xml as i have all inputs on my avrs disabled if nothing is used in them and also renamed the ones i do use.
Server version: avahi 0.6.32; Host name: openHABianPi.local
E Ifce Prot Name Type Domain
+ eth0 IPv4 0005CDA43706@Master / Gym _raop._tcp local
+ eth0 IPv4 0005CDA413DC@Living / gym _raop._tcp local
+ eth0 IPv4 0005CD41F858@Bed2 / Outside _raop._tcp local
+ eth0 IPv4 0005CD5A6004@Media room _raop._tcp local
= eth0 IPv4 0005CDA43706@Master / Gym _raop._tcp local
hostname = [Master-Gym.local]
address = [192.168.0.11]
port = [1024]
txt = ["vs=190.9.p6" "vn=65537" "tp=UDP" "sf=0x4" "am=AVRX3300W" "md=0,1,2" "fv=p6.1400.0" "ft=0x444F8A00" "et=0,4" "da=true" "cn=0,1"]
= eth0 IPv4 0005CDA413DC@Living / gym _raop._tcp local
hostname = [Living-gym.local]
address = [192.168.0.18]
port = [1028]
txt = ["vs=190.9.p6" "vn=65537" "tp=UDP" "sf=0x4" "am=AVRX3300W" "md=0,1,2" "fv=p6.1400.0" "ft=0x444F8A00" "et=0,4" "da=true" "cn=0,1"]
= eth0 IPv4 0005CD41F858@Bed2 / Outside _raop._tcp local
hostname = [Bed2-Outside.local]
address = [192.168.0.19]
port = [1024]
txt = ["vs=190.9.p6" "vn=65537" "tp=UDP" "sf=0x4" "am=AVRX3100W" "md=0,1,2" "fv=p6.1201.0" "ft=0x444F8A00" "et=0,4" "da=true" "cn=0,1"]
= eth0 IPv4 0005CD5A6004@Media room _raop._tcp local
hostname = [Media-room.local]
address = [192.168.0.10]
port = [1024]
txt = ["vs=190.9.p6" "vn=65537" "tp=UDP" "sf=0x4" "am=AVRX2200W" "md=0,1,2" "fv=p6.1300.0" "ft=0x444F8A00" "et=0,4" "da=true" "cn=0,1"]
: All for now
: Cache exhausted
again..
thanks for the binding! trying to add the 1.11.0 version wasn't working for me.
also im using openhabian 1.4v (2.2.0 of openhab2) released 2 days ago
@jangrewe @nick1802 thank you for testing and reporting this.
So, apparantly these models do not publish the vendor name (Denon or Marantz).
I built in detection based on this pattern: 'serial number'@(Marantz|Denon) (Model) that's why it didn't discover yours.
Any suggestions to discover your models? What would be the pattern to recognize these AVRs?
And do none of these support the (unofficial) HTTP API (e.g. browse to http://ip-of-avr and see a simplistic interface to control the AVR)?
@jwveldhuis
the 3 models at i have all have browser interface.
maybe cause i have named my avr's it resets the @(Marantz|Denon) (Model) part of the name?
looking though the denon site in there avr part all but one start with avrx**# *=number, #=2437 and all have 4 number except for the ones ending with BT only have 3.
@nick1802 ok, you can modify the name.. Good to know..
Found it in the manual of my SR5008 Marantz too:
The Friendly Name is the name of this unit displayed on the network. You can change the Friendly Name according to your preferences
Will see what I can do, maybe using that am=.. string is a better choice then, but then will need to build patterns for both Marantz and Denon in order to prevent false positives. Then we might need to update a list for each new model, not something I like..
Alternatively I could check out UPnP discovery. My Marantz is responding to UPnP as well and it has a clear field 'Manufacturer: Marantz' and a 'Friendly Name'.
@nick1802 regarding fetching the input names from the XML. That would make the binding a lot more complex. As the input names are not fixed, they can be changed at any time. Hence that should be handled accordingly. Also, not all AVRs support HTTP.
@jwveldhuis I'm not able to test the binding at the moment because we are renovating our home and that's why my hole setup is offline at the moment.
Just an idea: the string between "IPv4 " and "@" is the mac address of the device. I've searched several databases and i think all mac addresses from denon will start with "0005CD" and all addresses from Marantz will start with "000678".
@orificer good catch!
Updated the jar (it is 2.3.0-SNAPSHOT now):
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
Improvements to Discovery:
@nick1802 @jangrewe can you test with this new binding, is discovery now working as expected?
hey @jwveldhuis ,
both the 3300 where found but 3100 & 2200 where not.
Thanks @jwveldhuis, my X2300W was discovered and shows all channels! <3
FYI, i was able to configure it statically with this in a .things file:
Thing denonmarantz:avr:0005cda10537 "Mediabox" @ "Wohnzimmer" [host="192.168.0.24"]
@nick1802 any idea why 3100 & 2200 are not discovered? From the output you shared from avahi I can't see any difference. Can you share relevant debug log?
@jangrewe thanks, good to know! Will add that syntax to the documentation later.
@jwveldhuis
i rebooted the raspberry and all 4 had been discovered.
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
How can I insert this to the binding?
@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
@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?
@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.
@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.
@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.
@nick1802 just updated the binding (thanks for all your feedback):
@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!!!
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?
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.
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
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?
@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.
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 👍
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 ;)
@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.
Hi @jwveldhuis ,
Thank you for your work!
Some HTTP GET requests are available on port 8080 not 80. For example:
http://
or
http://
http://
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
@jwveldhuis
all the zone 2 labels are missing from the paper ui
@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?
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).
hey @jwveldhuis ,
just reinstalled the binding. still no go on the zone 2 labels
@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>
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.
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"
Dimmer denon_volume "Volume"
Switch denon_mute "Mute"
String denon_input "Input [%s]" {channel="denondenon:avr:ea14d064:input"}
String denon_surround "Surround: [%s]"
String denon_command {channel="denondenon:avr:ea14d064:command"}
Switch denon_muteZ3 "Mute"
Switch denon_powerZ3 "Power" {channel="denondenon:avr:ea14d064:zone3Power"}
Dimmer denon_volumeZ3 "Volume"
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. :)
@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
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!
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.
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:
Apparently there is some glitch in the telnet connection which makes it appear as busy/offline.
@amut41 okay.. it should try to reconnect every minute. Is there anything in the log?
@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.
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.
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.
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.
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
@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?
Yes,
telnet connection work OK
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
Can I do it using current binding ?
Can I simply extend its configuration, or there is a need to recompile the binding ?
Thanks
Michele
@michelevol should be possible with a rule like described here: https://github.com/openhab/openhab2-addons/issues/2204#issuecomment-356294251
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!
@tloers that’s definitely possible. You need to use the command channel and look up the right command in the protocol documentation, eg ‘MSSTEREO’
@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.
@jwveldhuis.
I want to create a rule to power on the Denon AVR2400H following a condition.
It's possible without the command channel?
Thanks.
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.
@amadeus74 I was typing and then saw @ohaak already gave the right info ;)
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?
@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.
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
@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.
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.
@mishakim yes the binding should see that, but only if you have configured the receiver to remain on standby while turned off. There is a setting called 'IP Control' which should be set to 'Always on'.
Otherwise, the binding cannot connect to the receiver and hence can't determine its state.
Thanks - I do have IP control set to Always on, so I'll do some testing and figure out what's not working.
Update to all BETA users
Just pushed a new updated binding after processing review comments.
Most important change that might affect you: I have changed the unit for the polling interval from milliseconds to seconds. The default is 5 seconds (smaller is not allowed). Whenever you update to the latest jar, you might need to update the old value of 5000 to 5.
@reyem the TypeResolver error should be gone now
Made some changes that should improve the stability. Detection of zone count is now done during the discovery. When updating the zone count in the configuration the zones are added/removed accordingly.
I'm finding that my problem is not just power - no changes made directly to the receiver, by any means other than openHAB, results in an update. If I change things through openHAB, that works, but if I change them by hand, by IR, or by Denon iOS app, that is not reflected in the state of Items. The only channels I'm trying are power, source, and volume. I did update to the new version today, that didn't seem to change anything.
@mishakim HTTP or telnet? Did you update polling interval to 5? If you enable DEBUG or TRACE logging, what do you see?
HTTP, poling interval is indeed 5. Nothing shows up on logs with either DEBUG or TRACE - I see outbound commands from openHAB, but nothing when I change it manually.
@mishakim you need to enable DEBUG for org.openhab.binding.denonmarantz, you will definitely see additional logging if http mode is active, otherwise your logging isn’t setup correctly.
I wasn't clear - there are things in the log, but only for actions through openHAB. Nothing done manually causes any logging. Here's all it shows:
2018-02-05 13:54:36.395 [DEBUG] [ector.http.DenonMarantzHttpConnector] - Sending command 'PWON'
2018-02-05 13:54:59.063 [DEBUG] [ector.http.DenonMarantzHttpConnector] - Sending command 'SIMPLAY'
2018-02-05 13:55:22.461 [DEBUG] [ector.http.DenonMarantzHttpConnector] - Sending command 'SISAT/CBL'
2018-02-05 13:56:18.847 [DEBUG] [ector.http.DenonMarantzHttpConnector] - Sending command 'SIMPLAY'
2018-02-05 13:56:18.848 [TRACE] [ector.http.DenonMarantzHttpConnector] - Calling url http://10.0.1.6:80/goform/formiPhoneAppDirect.xml?SIMPLAY
2018-02-05 13:56:53.650 [DEBUG] [ector.http.DenonMarantzHttpConnector] - Sending command 'PWSTANDBY'
2018-02-05 13:56:53.651 [TRACE] [ector.http.DenonMarantzHttpConnector] - Calling url http://10.0.1.6:80/goform/formiPhoneAppDirect.xml?PWSTANDBY
2018-02-05 13:57:04.623 [DEBUG] [ector.http.DenonMarantzHttpConnector] - Sending command 'PWON'
2018-02-05 13:57:04.624 [TRACE] [ector.http.DenonMarantzHttpConnector] - Calling url http://10.0.1.6:80/goform/formiPhoneAppDirect.xml?PWON
All of those entries result from doing things in openHab. I was also turning it on and off and changing inputs manually and none of those were logged. I added TRACE at 13:56
@mishakim you should see things like this (TRACE should give more detail)
2018-02-05 20:55:23.617 [INFO ] [.c.h.DenonMarantzHttpConnector:118 ] - HTTP polling started.
2018-02-05 20:55:28.620 [TRACE] [.c.h.DenonMarantzHttpConnector:294 ] - Refreshing Denon status
2018-02-05 20:55:28.621 [TRACE] [.c.h.DenonMarantzHttpConnector:202 ] - Refreshing URL: http://192.168.178.14:80/goform/formMainZone_MainZoneXml.xml
2018-02-05 20:55:28.907 [TRACE] [.c.h.DenonMarantzHttpConnector:306 ] - result of getDocument for uri 'http://192.168.178.14:80/goform/formMainZone_MainZoneXml.xml':
<?xml version="1.0" encoding="utf-8" ?>
<item>
<FriendlyName><value>Woonkamer</value></FriendlyName>
<Power><value>ON</value></Power>
<ZonePower><value>ON</value></ZonePower>
...
2018-02-05 20:55:29.466 [TRACE] [.c.h.DenonMarantzHttpConnector:306 ] - result of getDocument for uri 'http://192.168.178.14:80/goform/formZone2_Zone2XmlStatusLite.xml':
<?xml version="1.0" encoding="utf-8" ?>
<item>
...
</item>
Definitely not getting anything like that. If I manually enter the status URL in a browser, it gets valid results, so it seems like the binding is not polling
@mishakim you did enable TRACE? Strange indeed.. every exception that may occured should have resulted in any debug log entry..
Yep - I have trace entries for outbound commands, like this: 2018-02-05 13:56:53.651 [TRACE] [ector.http.DenonMarantzHttpConnector] - Calling url http://10.0.1.6:80/goform/formiPhoneAppDirect.xml?PWSTANDBY, but no attempts to refresh
Ok, well I just discovered some exceptions might go unnoticed.. The polling is done in a separate Thread using a ScheduledExecutorService. I don't check for the result while it seems that is required, let me check this, will get back to you.
Background: https://stackoverflow.com/a/24902026/2486310
So thank you for reporting this, definitely a bug I need to address!
ah - good to know I'm not crazy!
@mishakim try with this jar, I included error reporting for the polling: https://www.dropbox.com/s/14mnyjkcfzuw2vl/org.openhab.binding.denonmarantz-2.3.0-SNAPSHOT.jar?dl=0 If this helps to find the issue I'll add it to the binding.
It ran, and Trace showed a few updates, one for each zone, it looked like, then threw this error:
2018-02-05 16:02:28.945 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at 'things/denonmarantz:avr:0005cd2f3f4a/config'
java.lang.IllegalArgumentException: Value must be between 0 and 100
all the details are here
The binding hasn't logged anything since except in response to my actions.
@mishakim interesting, thanks. BTW, this error is not logged by the code I added. It would have looked like this:
2018-02-05 21:38:33.007 [ERROR] [.c.h.DenonMarantzHttpConnector:130 ] - Error while polling Http: "Error Message" Stacktrace:
....
Still, this piece of log you shared is exactly what I need. So it seems the value for Zone3 Volume is not in the 0 to 100 range, that is causing an error.
For me http://<AVR-IP>/goform/formZone3_Zone3XmlStatusLite.xml (well for zone 2, I don't have 3 zones) it looks like this:
<item>
..
<VolumeDisplay>
<value>Absolute</value>
</VolumeDisplay>
<MasterVolume>
<value>-58</value>
</MasterVolume>
..
</item>
i.e. the volume starts is offset with 80 (0 = -80 dB).
I guess for your model it displays the relative volume. In the code the 80 offset is substracted, which leads to the issue you have.
What is the value for (Nevermind that, it is only showing the preference as configured in Setup -> Volume, it is not affecting the volume, at least not for my Marantz SR5008)<VolumeDisplay> in your case?
What is the value for <MasterVolume> for you?
Zone3 looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<item>
<Power><value>OFF</value></Power>
<InputFuncSelect><value>HDRADIO</value></InputFuncSelect>
<VolumeDisplay><value>Relative</value></VolumeDisplay>
<MasterVolume><value>-34</value></MasterVolume>
<Mute><value>off</value></Mute>
</item>
Right before the latest version of that error, it logged this:
2018-02-05 16:43:55.534 [DEBUG] [nmarantz.handler.DenonMarantzHandler] - Received state OFF for channelID zone3Power
2018-02-05 16:43:55.535 [DEBUG] [nmarantz.handler.DenonMarantzHandler] - Received state 46 for channelID zone3Volume
2018-02-05 16:43:55.536 [DEBUG] [nmarantz.handler.DenonMarantzHandler] - Received state -34 for channelID zone3VolumeDB
so it seems like it is correctly getting both decimal and dB volume numbers, but the dB isn't being handled right somewhere?
PS, I'm not sure why I'm not getting line breaks inside my code tags here
@mishakim Please do the following:
-remove the Thing
-enable TRACE log for the binding (not sure it will add anything useful up to this point)
-re-add the Thing
-share the full log from the moment you added the Thing until the error occurs
Still a bit clueless under what circumstances this error occurs.
And, what is your Item definition? Did you perhaps assign a Dimmer type Item to the Zone3VolumeDB channel? (That would be wrong, Dimmer is for the non-dB channels, Number is for the dB channels)
Ok, I can reproduce your issue.
It is caused when you assign a Dimmer item to the Number channel (which is not possible in the Paper UI, but possible when using the .items files).
E.g.
Dimmer test "test" {channel="denonmarantz:avr:0006781d58b1:zone2VolumeDB"}
This breaks the binding..
Will check what to do about this, but for sure it's a configuration issue on your end.. ;)
Yep, Zone3VolumeDB was a dimmer, I fixed that now. My various items were created in PaperUI, most were created from the Thing page by creating items within the channels. I also used Habmin for some setup, I don't recall if that's where I crated the zone 3 db volume dimmer.
I fixed the zone 3 item before removing and reading the Thing, then realized I'd broken logging completely in my attempt to create a separate file for denon. I fixed logging and restarted, and all seems to be working -- updates seem to be posting (I'll check power as soon as the kid's show is over ...)
re-read your note about PaperUI, I think I must have created the volume dimmer in HabMin, when I hadn't figured out the "show more" to see the volume channels in Paper UI. It let me get away with it, and silently broke.
Well, that was 4 hours well spent 😛
@mishakim thanks for your input on this, it helps to make this better!
At the others: sorry for the spam in this thread, next time will search for an other place to do 1-on-1 issue resolution.. ;)
Hi,
I have this warning every time restart Openhab:
(AVR-X6300H with Telnet connection)
2018-02-08 08:18:37.739 [WARN ] [nmarantz.handler.DenonMarantzHandler] - Command for channel surroundProgram not supported.
it is normal? or something wrong.
P.S. - I use manually created items.
I've just checked it at my setup and can see some additional messages at every restart of openhab (AVR-X3400H with telnet connection):
openhab.log:2018-02-08 08:28:59.176 [WARN ] [nmarantz.handler.DenonMarantzHandler] - Command for channel album not supported.
openhab.log:2018-02-08 08:28:59.175 [WARN ] [nmarantz.handler.DenonMarantzHandler] - Command for channel artist not supported.
openhab.log:2018-02-08 08:28:59.177 [WARN ] [nmarantz.handler.DenonMarantzHandler] - Command for channel track not supported.
openhab.log:2018-02-08 08:28:59.179 [WARN ] [nmarantz.handler.DenonMarantzHandler] - Unsupported command REFRESH for channel command
openhab.log:2018-02-08 08:28:59.173 [WARN ] [nmarantz.handler.DenonMarantzHandler] - Command for channel surroundProgram not supported.
@grzegorz914 @orificer that's normal:
artist. So probably persistence is used to set the Item to the last-known state at restart of OpenHAB. The binding can't push those back to the AVR (at least not Artist / Track / Album).Will see where I can change the WARN to DEBUG to avoid confusion.
Hello,
OK understod,
other thongs if I change to HTTP mode then get this error (OFFLINE-COMMUNICATION ERROR):
2018-02-08 11:42:52.423 [hingStatusInfoChangedEvent] - 'denonmarantz:avr:xxxxxxxxx' changed from ONLINE 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_MainZoneXml.xml
@grzegorz914 jep.. that's what you get with HTTP on a Heos model. Once the binding is accepted we can think about adding HTTP support for those. Need to find out what are the common HTTP / xml pages which can be used by all models. It's too much work now to cover that.
I'm aware of https://github.com/scarface-4711/denonavr/blob/master/denonavr/denonavr.py, there the approach is different.
Will it be possible to change more detailed setups like the dialog/subwoofer level adjust?
@IceBrainzz for now you can use the command Channel to set anything that the protocol allows. Reading those properties is not supported currently. You could use the Http Binding to fetch these if you really want to.
There are hundreds of settings, only the most common are implemented.
@jwveldhuis
As far as I know the HTTP interface is “disabled” for all Heos-based models (for example the X3400, which I have). When I try to open the IP of the AVR in a browser it gives me a 403 Forbidden,
But for now the already implemented features are working like a charm, thank you for that.
@IceBrainzz I meant the HTTP Binding, not the Http mode, to pull specific info from the receiver into openhab. It won’t be easy, but it’s possible.
On your model there is something possible on port 8080.
I have an older Denon with only the serial interface. I have managed to setup an ESP8266 as a serial to Wifi gateway, and the Binding connects to the gateway as a charm. Awesome!
@pabloNZ asked for the .things sample back in november. In case he didn't figure it out, mine is here:
Thing denonmarantz:avr:avr3805-livingroom "Denon: AVR3805" @ "Denon" [ host="192.168.1.92", telnetEnabled=true ]
If you need to set other/more parameters, find the names in the xml file in the code, where the parameters is defined.
Change avr3805-livingroom to match your own name, and use that in the .items file.
Remeber to change the host to something apropriate.
I'm pleased to announce the DenonMarantz binding got merged into the next 2.3.0 version of OpenHAB! Thanks all for giving feedback!
Important: during review I had to change the names of the channels, this will impact everyone upgrading to the new binding. The channels make use of so-called 'channel groups' now. This leads to different names, e.g. general#power instead of power and zone2#volume instead of zone2Volume.
Please have a close look at the updated README.md file here: https://github.com/openhab/openhab2-addons/blob/master/addons/binding/org.openhab.binding.denonmarantz/README.md
I'm closing this issue now, as it was related to the binding under development.
Any chance of making the receiver display brightness (the DIM command) available as a channel, rather than just as a command?
If it were a channel, it would be easy to add to HABpanel ... but as a command I can't even conceive how to begin!
@davidgurr no not planning to implement that. Note that a command is one-way only, so you should be able to send the brightness but can't request the current state of the brightness. Lookup the command to send in the Protocol documentation.
Probably it's one of these:
DIM BRI
DIM DIM
DIM DAR
DIM OFF
My Marantz SR5008 doesn't support this so can't test this myself.
General remark: this issue has been closed. Please raise a new issue or open a topic in the Community instead of commenting on this one.
Yep, got the DIM commands working fine on my NR1506. From the command documentation, it looks like "DIM ?" should return the status, but I guess you don't have plans to support that either ... no biggy. Great work on the binding anyway!
Hi could anyone help me?
I've OH2 and installed at first the version from OH MArket (I think a modulation from OH1)
That version founds my Marantz NR1504 but by adding to things I've got the error 409 - Conflict.
I've googled and found this binding. I uninstalled the first version. I add the *jar file into the addons Folder from the second post.
after restart it found my Marantz NR1504 but the same problem.
After clicking "Add to things" I get the error 409 - Conflict and there's no marantz thing.
How could I use it now? :-\
Thanks!
edit: I found an error into log:
2018-10-06 20:31:52.668 [WARN ] [g.discovery.internal.PersistentInbox] - Cannot create thing. No binding found that supports creating a thing of type denonmarantz:avr.
but I've got added the binding and it is under "Configuration - Bindings"
Or is that the old one?
Most helpful comment
@jwveldhuis
i rebooted the raspberry and all 4 had been discovered.