Having recently installed OpenHAB2 and the DenonMarantz binding, I was surprised to be able to successfully control my Denon CEOL RCD-N7 - it’s a Networked music system rather than an AVR. From within Paper UI I can control the main settings, eg Power, Volume, Mute, Input (just some of them).
This just worked with no config changes by me… then I decided to try to get Alexa to control it.
I added the config below to a new .items file:
Group Stereo "Stereo" {alexa="Endpoint.Speaker"}
Dimmer Volume "Volume [%.1f]" (Stereo) {alexa="Speaker.volume",channel="denonmarantz:avr:b0b662a3:mainZone#volume"}
Switch Mute "Mute" (Stereo) {alexa="Speaker.muted", channel="denonmarantz:avr:b0b662a3:mainZone#mute"}
Switch Power "Power" (Stereo) {alexa="PowerController.powerState",channel="denonmarantz:avr:b0b662a3:general#power"}
String Input "Input" (Stereo) {alexa="InputController.input" [supportedInputs="TUNER,CD,SERVER"], channel="denonmarantz:avr:b0b662a3:mainZone#input"}
Alexa reacts to commands for Power/Mute/Input as expected. But Volume isn’t working right.
If I say command “Set Stereo volume to 8”, I can see in the log file:
2019-12-30 19:03:52.668 [ome.event.ItemCommandEvent] - Item 'Volume' received command 8
2019-12-30 19:03:52.674 [nt.ItemStatePredictedEvent] - Volume predicted to become 8
2019-12-30 19:03:52.729 [vent.ItemStateChangedEvent] - Volume changed from 3.0 to 8
2019-12-30 19:03:52.859 [vent.ItemStateChangedEvent] - Volume changed from 8 to 80.0
2019-12-30 19:03:52.862 [vent.ItemStateChangedEvent] - denonmarantz_avr_b0b662a3_mainZone_volume changed from 3.0 to 80.0
2019-12-30 19:03:52.867 [vent.ItemStateChangedEvent] - Volume changed from 80.0 to 0.0
And the display on the device itself shows the volume shoot up to maximum of 80!
I reset the volume on the device to something reasonable and the OpenHAB log then says:
2019-12-30 19:05:05.906 [ERROR] [ector.http.DenonMarantzHttpConnector] - Error while polling Http: "Value must be between 0 and 100". Stacktrace:
org.eclipse.smarthome.core.library.types.PercentType.validateValue(PercentType.java:57)
org.eclipse.smarthome.core.library.types.PercentType.<init>(PercentType.java:52)
org.eclipse.smarthome.core.library.types.DecimalType.as(DecimalType.java:152)
org.eclipse.smarthome.core.internal.items.ItemStateConverterImpl.convertToAcceptedState(ItemStateConverterImpl.java:64)
org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.sendUpdate(ProfileCallbackImpl.java:134)
org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onStateUpdateFromHandler(SystemDefaultProfile.java:53)
org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$9(CommunicationManager.java:467)
org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$11(CommunicationManager.java:487)
java.lang.Iterable.forEach(Iterable.java:75)
org.eclipse.smarthome.core.thing.internal.CommunicationManager.handleCallFromHandler(CommunicationManager.java:483)
org.eclipse.smarthome.core.thing.internal.CommunicationManager.stateUpdated(CommunicationManager.java:465)
org.eclipse.smarthome.core.thing.internal.ThingManagerImpl$1.stateUpdated(ThingManagerImpl.java:168)
org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateState(BaseThingHandler.java:245)
org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateState(BaseThingHandler.java:264)
org.openhab.binding.denonmarantz.internal.handler.DenonMarantzHandler.stateChanged(DenonMarantzHandler.java:408)
org.openhab.binding.denonmarantz.internal.DenonMarantzState.setMainVolume(DenonMarantzState.java:149)
org.openhab.binding.denonmarantz.internal.connector.http.DenonMarantzHttpConnector.updateMainZone(DenonMarantzHttpConnector.java:212)
org.openhab.binding.denonmarantz.internal.connector.http.DenonMarantzHttpConnector.refreshHttpProperties(DenonMarantzHttpConnector.java:292)
org.openhab.binding.denonmarantz.internal.connector.http.DenonMarantzHttpConnector.lambda$0(DenonMarantzHttpConnector.java:128)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
==> /var/log/openhab2/events.log <==
2019-12-30 19:05:05.937 [vent.ItemStateChangedEvent] - Volume changed from 0.0 to 8.0
2019-12-30 19:05:05.943 [vent.ItemStateChangedEvent] - denonmarantz_avr_b0b662a3_mainZone_volume changed from 80.0 to 8.0
So OpenHAB can see the correct values, and the control slider in the PaperUI reflects this, but there’s something in the way Alexa deals with the volume that shoots it right up to max each time.
I’ve tried using volume number instead of a dimmer, DB instead of %, no joy though. As the control can work through the Paper UI, there must be a solution but this newbie hasn’t got a clue!
Can anyone help?
Thanks!!