Martvvliet/homebridge-denon-heos

Error loading plugin

Closed this issue · 14 comments

This is with homebridge 0.4.53

Load hombridge-denon-heos.DenonAVR
[4/25/2020, 12:14:46 PM] TypeError: Cannot read property 'debugTrace' of null
at new denonClient (/usr/local/lib/node_modules/homebridge-denon-heos/index.js:74:20)
at Server._loadDynamicPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:358:30)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:92:8)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:59:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:1156:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47

Can you post your config ?

There's no (relevant) config at all. This is just having installed the plugin - i.e. installed it using homebridge config UI X. But not put anything in the config. The above error breaks homebridge so it errors on startup, reboots, errors, reboots,...

Let me try to put a sensible config in.

Indeed with a sensible config, DenonAVR loads fine, and seems to work fine too. So the above error isn't critical, but obviously annoying for anyone who installs the plugin without yet having a viable config. My working config below:

{
"platform": "DenonAVR",
"pollInterval": 3,
"devices": [
{
"name": "Denon Receiver",
"ip": "192.168.1.93",
"switchInfoMenu": true,
"port": 8080,
"inputs": [
{
"inputID": "MPLAY",
"name": "Apple TV",
"defaultVolume": 32
},
{
"inputID": "CD",
"name": "CD"
},
{
"inputID": "TV",
"name": "TV or Blu-ray"
},
{
"inputID": "NET",
"name": "Music"
}
]
}
],
"volumeControl": [
{
"name": "Receiver Volume",
"ip": "192.168.1.93",
"volumeLimit": 80,
"port": 8080
}
]
}

Ok thanks. Will make sure that it won’t break homebridge when installed. Thank for input :)

Thank you. Really enjoying using the plugin now. I'd love to have multi-zone control to quickly turn on/off a zone and select a particular input for that zone.

I'm also, fyi, making good use of a separate switch:

    {
        "accessory": "HTTP-SWITCH",
        "name": "GlassBoxMusic",
        "switchType": "stateful",
        "debug": false,
        "onUrl": "https://192.168.1.93:10443/ajax/speakers/set_config?type=2&data=%3CAmpAssign%3E%3CAssignMode%3E2%3C%2FAssignMode%3E%3C%2FAmpAssign%3E&_=1587642388217",
        "offUrl": "https://192.168.1.93:10443/ajax/speakers/set_config?type=2&data=%3CAmpAssign%3E%3CAssignMode%3E1%3C%2FAssignMode%3E%3C%2FAmpAssign%3E&_=1587642388217",
        "statusUrl": "https://192.168.1.93:10443/ajax/speakers/get_config?type=2",
        "statusPattern": ".*<AssignMode>2</AssignMode>.*"
    }

This allows me to switch the amp-assign settings from 9.1ch (for me 7.1.2 surround speaker setup, but then I have no channels left to operate my second zone), to 7.1ch + zone2 (when I can nicely plan music in zone 2 or in both zones). The above switch toggles that back and forth for me.

@vincent0794 Issue is fixed in version 2.4.1.

I will add multizone support in a following release. You're not the first wanting this :)
Is that URL for your Denon receiver? I don't recognise the port number?

Yes, that's the URL for my Denon X3600H web interface - it seems to reroute http 8080 to https on the above 10443 port, so I ended up using that above (the particular calls ascertained from snooping on my web browser on my desktop computer). Can't recall right now whether the http/8080 works for the above not.

https://192.168.1.93:10443/goform/formMainZone_MainZoneXmlStatusLite.xml

gives me:

The resource '/goform/formMainZone_MainZoneXmlStatusLite.xml' was not found.

as opposed to:

https://192.168.1.93:10443/ajax/speakers/get_config?type=2

which gives me:

<?xml version="1.0" encoding="utf-8"?>
<AmpAssign><AmpType>5</AmpType><AssignMode>2</AssignMode><SpeakerFor display="3"><Value>2</Value></SpeakerFor><FloorLayout display="3"><Value>2</Value><List><Value>2</Value><Value>1</Value></List></FloorLayout><HeightSpeaker display="3"><Value>5</Value><List><Value>1</Value><Value>5</Value><Value>2</Value></List></HeightSpeaker><ThreeTiersHeightLayout display="1"/><CustomSettings display="1"/><HeightLayout display="3"><Value>4</Value><List><Value>2</Value><Value>3</Value><Value>4</Value><Value>5</Value><Value>6</Value></List></HeightLayout><Preout display="1"/><TopSurrOut display="1"/></AmpAssign>

and

http://192.168.1.93:8080/goform/formMainZone_MainZoneXmlStatusLite.xml

gives me (macOS safari):

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<item>
<Power>
<value>OFF</value>
</Power>
<InputFuncSelect>
<value>MPLAY</value>
</InputFuncSelect>
<VolumeDisplay>
<value>Absolute</value>
</VolumeDisplay>
<MasterVolume>
<value>-42.0</value>
</MasterVolume>
<Mute>
<value>off</value>
</Mute>
</item>

hmm, sadly the https interface doesn't work with my x1400h. So can't do any testing with that. Do you know all commands with the https interface?
Al issues about the reloading should be fixed in the latest version.

I basically got the above by snooping in Safari using the Develop menu while exploring the web UI. I've attached the full set of scripts that Safari exposes that way.

Archive.zip

It's basically everything that my Denon shows in the on-screen-display on my TV in the "Setup" menu. Interestingly that seems to contain most things, but not everything. For example the UI lets me rename the 1-4 quickselect functions, but it does not let me actually set those functions to do anything. Those functions must be set by using the handheld remote control.

This is great thank you. Will check if I can integrate some of these commands. As far as I know, my X1400h doesn't have support for this or any Developer menu, so can't test it with my setup. Will come back on this.

Hi @vincent0794, I added support for the second zone in version 2.6.0. It is not with control over the amp-settings, but if you have the amp set to zone2 support, you should be able to control zone 2 with this update. You can do it as tv, switch and volume bulb.