Giter Club home page Giter Club logo

pimatic-denon-avr's Introduction

pimatic-denon-avr

Npm Version Build Status Dependency Status

Pimatic plugin to monitor & control a Denon AV Receiver over a network connection.

Icon

Status of Implementation

Since the first release the following features have been implemented:

  • support for power switching, mute, volume control, input selection, and status display
  • support for zone control (up to three zones depending on receiver model)
  • auto-discovery for pimatic 0.9
  • HTTP transport as an alternative to using telnet for recent AVR models
  • action to select input source, devices for power switching, volume mute, volume control are "switch" or "dimmer" devices types and support the respective action operations

Additional features can be added easily and I am happy to do this on demand.

Notable Changes

Since version 0.9.1 changing the master volume automatically switched on the AVR. Unfortunately, it turned out that this causes an disruption of video processing with some receivers. Therefore, as of version v0.9.4 changing the master volume will no longer switch the AVR.

Since version 0.9.7 the minimum interval time for updates has been lowered to 2 seconds. Note, however, shorter update cycles may result in higher load an memory consumption on the pimatic host. It may also degrade the performance of AVR's control system which provides the web & mobile applications access.

Contributions

Contributions to the project are welcome. You can simply fork the project and create a pull request with your contribution to start with. If you like this plugin, please consider ★ starring the project on github.

Plugin Configuration

Note, the control protocol is set to TELNET by default. The telnet control is limited to one control application connection at a time, as the AVR only accepts a single transport connection. Use the HTTP control protocol instead if you have a '11, '12, '13, or X series AVR or a newer model released since 2014.

{
      "plugin": "denon-avr",
      "host": "avr.fritz.box",
}

The plugin has the following configuration properties:

Property Default Type Description
host - String Hostname or IP address of the AVR
port 23 or 80 Number AVR control port - only required for testing
protocol "TELNET" Enum The protocol to be used, one of "HTTP" or "TELNET"
debug false Boolean Debug mode. Writes debug messages to the pimatic log, if set to true

Device Configuration

The following devices can be used. Each device will query the AVR for the status updates at regular time intervals. The default is 60 seconds. Note, the AVR will only accept a single connection to the control port. Shorter intervals may keep the connection open forever and may block other applications, e.g. remote control applications for the smart phone. If another application occupies the control port forever the status cannot be updated and commands will result in 'timeout' errors.

You may realize some strange behaviour like switches or sliders flipping back to their previous position. This is due to the behaviour of the AVR control system. When the AVR is in STANDBY it does not allow changing settings like volume, mute, input and will reply with its currently status parameters.

If the power on command is sent to the AVR, it will take up to 2 seconds for the AVR control system to transition to the power on state and to accept changing settings. Thus, subsequent commands will be deferred by 2 seconds. You may realize this, for example, if you change the volume immediately after switching power on, it will take 2 seconds for the volume attribute to update. In rare cases, if the power on procedure takes longer, the slider may flip back to its previous position.

DenonAvrPresenceSensor

The Presence Sensor presents the power status of the receiver and provides information about the master volume and selected input source.

{
      "id": "avr-1",
      "name": "AVR Status",
      "class": "DenonAvrPresenceSensor"
}

The device has the following configuration properties:

Property Default Type Description
interval 60 Number The time interval in seconds (minimum 2) at which the presence state of the AVR will be read
volumeDecibel false Boolean If true, the volume is presented in dB, otherwise relative level between 00 and 99 is displayed

The following predicates and actions are supported:

  • {device} is present|absent

DenonAvrPowerSwitch

The Power Switch can be used to switch the AVR on or off (standby) mode. Depending on your AVR configuration you may not be able to switch it on again. See the AVR manual for details.

{
      "id": "avr-2",
      "name": "AVR Power",
      "class": "DenonAvrPowerSwitch"
}

The device has the following configuration properties:

Property Default Type Description
interval 60 Number The time interval in seconds (minimum 2) at which the power state of the AVR will be read

The following predicates and actions are supported:

  • {device} is turned on|off
  • switch {device} on|off
  • toggle {device}

DenonAvrZoneSwitch

The Zone Switch can be used to switch a zone of the AVR on or off if multiple zones are supported and setup for the receiver. See the AVR manual for details.

{
      "id": "avr-2",
      "name": "AVR Zone 2",
      "class": "DenonAvrZoneSwitch"
      "zone": "ZONE2"
}

The device has the following configuration properties:

Property Default Type Description
zone "MAIN" Enum The zone to be switched on and off, one of "MAIN", "ZONE2", or "ZONE3"
interval 60 Number The time interval in seconds (minimum 2) at which the zone switch state of the AVR will be read

The following predicates and actions are supported:

  • {device} is turned on|off
  • switch {device} on|off
  • toggle {device}

DenonAvrMuteSwitch

Screenshot

The Mute Switch can be used to mute or un-mute the master volume.

{
      "id": "avr-3",
      "name": "AVR Mute",
      "class": "DenonAvrMuteSwitch"
}

The device has the following configuration properties:

Property Default Type Description
zone "MAIN" Enum The zone to be muted, one of "MAIN", "ZONE2", or "ZONE3"
interval 60 Number The time interval in seconds (minimum 2) at which the mute state of the AVR will be read

The following predicates and actions are supported:

  • {device} is turned on|off
  • switch {device} on|off
  • toggle {device}

DenonAvrMasterVolume

Screenshot

The Master Volume can be used to change the absolute master volume. This device can only be used with AVRs which support absolute volume control on a scale from 0-98. As some AVRs already stop at a lower maximum volume the maxAbsoluteVolume property is provided (see properties table below).

{
      "id": "avr-4",
      "name": "AVR Master Volume",
      "class": "DenonAvrMasterVolume"
}

The device has the following configuration properties:

Property Default Type Description
interval 60 Number The time interval in seconds (minimum 2) at which the volume state of the AVR will be read
volumeDecibel false Boolean If true, the volume is presented in dB, otherwise the absolute level between 00 and 99 is displayed
volumeLimit 0 Number If greater than 0, enforce a volume limiter for the maximum volume level
maxAbsoluteVolume 99 Number Maximum absolute volume which can be set. Some receivers already stop at a lower value than 99

The following predicates and actions are supported:

  • dimlevel of {device} {Comparison Operator} {Value}, where {Value} is the percentage of volume 0-100
  • dim {device} to {Value}, where {Value} is the percentage of volume 0-100

DenonAvrZoneVolume

The Zone Volume can be used to change the zone volume.

{
      "id": "avr-4",
      "name": "AVR Zone Volume",
      "class": "DenonAvrZoneVolume"
}

The device has the following configuration properties:

Property Default Type Description
zone "MAIN" Enum The zone for which volume shall be controlled, one of "MAIN", "ZONE2", or "ZONE3". If set to MAIN it is equivalent to master volume
interval 60 Number The time interval in seconds (minimum 2) at which the zone volume state of the AVR will be read
volumeDecibel false Boolean If true, the volume is presented in dB, otherwise the absolute level between 00 and 99 is displayed
volumeLimit 0 Number If greater than 0, enforce a volume limiter for the maximum volume level
maxAbsoluteVolume 99 Number Maximum absolute volume which can be set. Some receivers already stop at a lower value than 99

The following predicates and actions are supported:

  • dimlevel of {device} {Comparison Operator} {Value}, where {Value} is the percentage of volume 0-100
  • dim {device} to {Value}, where {Value} is percentage of volume 0-100

DenonAvrInputSelector

The DenonAvrInputSelector can be used to select the input source. Allowed values for input selection depend on the AVR model.

{
      "id": "avr-5",
      "name": "AVR Inout Selector",
      "class": "DenonAvrInputSelector"
      "buttons": [
           {
             "id": "TUNER"
           }
           {
             "id": "DVD"
           }
           {
             "id": "TV"
           }
           {
             "id": "MPLAY"
           }
      ]
}

The device has the following configuration properties:

Property Default Type Description
zone "MAIN" Enum The zone to select input for, one of "MAIN", "ZONE2", or "ZONE3"
interval 60 Number The time interval in seconds (minimum 2) at which the selector state of the AVR will be read
buttons see example Array The buttons to display for selection. See device configuration schema for details

The following predicates and actions are supported:

  • input of {device} {Comparison Operator} "{Value}", where {Value} is a string matching a valid input source
  • avr input {device to "{Value}", for example: avr input denon-avr to "tv"

History

See Release History.

License

Copyright (c) 2015-2018, Marcus Wittig and contributors. All rights reserved.

AGPL-3.0

pimatic-denon-avr's People

Contributors

greenkeeper[bot] avatar greenkeeperio-bot avatar mwittig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

p4co86 sentzu01

pimatic-denon-avr's Issues

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Interval step change

Hello Marcus,
is it possible to change the minimum interval to maybe 1 second or 2 seconds? actually i need a smaller step size.

Thanks in Advance

Video signal is interrupted by changing volume

If i change the volume by the slider of the device DenonAvrMasterVolume i get a annoing behavior of the plugin, the video signal is swiched off so that the screen is getting black and on again while displaying MAIN ZONE on. Is that a bug or perhaps a behavior which could be enhanced/fixed?

I'm using the PlugIn with the Protocol TELNET on Port 23 and a Denon AVR-X3100W as hardware.

Plugin not starting after latest update

13:49:05.163 [pimatic] info: Loading plugin: "pimatic-denon-avr" (0.9.8)
coffee-cache: compiling coffee-script file "denon-avr.coffee"...Done
coffee-cache: compiling coffee-script file "telnet-app-protocol.coffee"...Done
coffee-cache: compiling coffee-script file "http-app-protocol.coffee"...Done
13:49:07.283 [pimatic] error: Cannot find module './_assignValue'
13:49:07.318 [pimatic] debug: Error: Cannot find module './_assignValue'
13:49:07.318 [pimatic] debug:>    at Function.Module._resolveFilename (module.js:325:15)
13:49:07.318 [pimatic] debug:>    at Function.Module._load (module.js:276:25)
13:49:07.318 [pimatic] debug:>    at Module.require (module.js:353:17)
13:49:07.318 [pimatic] debug:>    at require (internal/module.js:12:17)
13:49:07.318 [pimatic] debug:>    at Object.<anonymous> (/home/pi/pimatic-beta/node_modules/pimatic-denon-avr/node_modules/xml2js/node_modules/xmlbuilder/node_modules/lodash/assign.js:1:19)
13:49:07.318 [pimatic] debug:>    at Module._compile (module.js:409:26)
13:49:07.318 [pimatic] debug:>    at Object.Module._extensions..js (module.js:416:10)
13:49:07.318 [pimatic] debug:>    at Module.load (/home/pi/pimatic-beta/node_modules/pimatic-mobile-frontend/node_modules/nap/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
13:49:07.318 [pimatic] debug:>    at Function.Module._load (module.js:300:12)
13:49:07.318 [pimatic] debug:>    at Module.require (module.js:353:17)
13:49:07.318 [pimatic] debug:>    at require (internal/module.js:12:17)
13:49:07.318 [pimatic] debug:>    at Object.<anonymous> (/home/pi/pimatic-beta/node_modules/pimatic-denon-avr/node_modules/xml2js/node_modules/xmlbuilder/lib/index.js:5:12)
13:49:07.318 [pimatic] debug:>    at Object.<anonymous> (/home/pi/pimatic-beta/node_modules/pimatic-denon-avr/node_modules/xml2js/node_modules/xmlbuilder/lib/index.js:14:4)
13:49:07.318 [pimatic] debug:>    at Module._compile (module.js:409:26)
13:49:07.318 [pimatic] debug:>    at Object.Module._extensions..js (module.js:416:10)
13:49:07.318 [pimatic] debug:>    at Module.load (/home/pi/pimatic-beta/node_modules/pimatic-mobile-frontend/node_modules/nap/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
13:49:07.318 [pimatic] debug:>    at Function.Module._load (module.js:300:12)
13:49:07.318 [pimatic] debug:>    at Module.require (module.js:353:17)
13:49:07.318 [pimatic] debug:>    at require (internal/module.js:12:17)
13:49:07.318 [pimatic] debug:>    at Object.<anonymous> (/home/pi/pimatic-beta/node_modules/pimatic-denon-avr/node_modules/xml2js/lib/xml2js.js:13:13)
13:49:07.318 [pimatic] debug:>    at Object.<anonymous> (/home/pi/pimatic-beta/node_modules/pimatic-denon-avr/node_modules/xml2js/lib/xml2js.js:543:4)
13:49:07.318 [pimatic] debug:>    at Module._compile (module.js:409:26)
13:49:07.318 [pimatic] debug:>    at Object.Module._extensions..js (module.js:416:10)
13:49:07.318 [pimatic] debug:>    at Module.load (/home/pi/pimatic-beta/node_modules/pimatic-mobile-frontend/node_modules/nap/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
13:49:07.318 [pimatic] debug:>    at Function.Module._load (module.js:300:12)
13:49:07.318 [pimatic] debug:>    at Module.require (module.js:353:17)
13:49:07.318 [pimatic] debug:>    at require (internal/module.js:12:17)
13:49:07.318 [pimatic] debug:>    at module.exports (/home/pi/pimatic-beta/node_modules/pimatic-denon-avr/http-app-protocol.coffee:7:38)
13:49:07.318 [pimatic] debug:>    at module.exports (/home/pi/pimatic-beta/node_modules/pimatic-denon-avr/denon-avr.coffee:7:21)
13:49:07.318 [pimatic] debug:>    at PluginManager.loadPlugin (/home/pi/pimatic-beta/node_modules/pimatic/lib/plugins.coffee:83:16)
13:49:07.318 [pimatic] debug:>    at /home/pi/pimatic-beta/node_modules/pimatic/lib/plugins.coffee:485:25
13:49:07.318 [pimatic] debug:>    at tryCatcher (/home/pi/pimatic-beta/node_modules/pimatic/node_modules/bluebird/js/release/util.js:16:23)
13:49:07.318 [pimatic] debug:>    at Promise._settlePromiseFromHandler (/home/pi/pimatic-beta/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:512:31)
13:49:07.318 [pimatic] debug:>    at Promise._settlePromise (/home/pi/pimatic-beta/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:569:18)
13:49:07.318 [pimatic] debug:>    at Promise._settlePromiseCtx (/home/pi/pimatic-beta/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:606:10)
13:49:07.318 [pimatic] debug:>    at Async._drainQueue (/home/pi/pimatic-beta/node_modules/pimatic/node_modules/bluebird/js/release/async.js:138:12)
13:49:07.318 [pimatic] debug:>    at Async._drainQueues (/home/pi/pimatic-beta/node_modules/pimatic/node_modules/bluebird/js/release/async.js:143:10)
13:49:07.318 [pimatic] debug:>    at Immediate.Async.drainQueues [as _onImmediate] (/home/pi/pimatic-beta/node_modules/pimatic/node_modules/bluebird/js/release/async.js:17:14)
13:49:07.318 [pimatic] debug:>    at processImmediate [as _immediateCallback] (timers.js:383:17)

Volume not changed with slider as expected.

I have this for some time now but didn't find the time to report it yet.

Currently if I try to change the volume via the slider in the Pimatic web frontend the moment I let it go it jumps back to previous value or even decreases. Only after several tries I get it to increase a little bit.

Unhandled exception if AVR is offline and network control is off

If the Denon AVR is offline and you haven’t activated the option network control the following error occurs:

Unhandled rejection Error: Expected variable Denon-Volume-Status.volume to have a numeric value.
    at /home/pi/pimatic-app/node_modules/pimatic/lib/variables-ast-builder.coffee:111:17
    at tryCatcher (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:17:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
Unhandled rejection Error: unknown state=""!

Optimize device updates through a centralized update loop

Implement a centralized update loop is desirable where each device can subscribe to the update topics in question (e.g. query the volume level) and the update handler can provide optimized queries which result in less callouts to the receiver.

Add HTTP transport

Currently you can't use the plugin together with other apps as the "telnet/serial" communication only allows one client. Would be great if this can be changed. I know it is on the agenda but I wonder what the current status is.

An in-range update of grunt is breaking the build 🚨


☝️ Important announcement: Greenkeeper will be saying goodbye 👋 and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io


The devDependency grunt was updated from 1.0.4 to 1.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

grunt is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v1.1.0
  • Update to mkdirp ~1.0.3
  • Only support versions of Node >= 8
Commits

The new version differs by 8 commits.

  • d5cdac0 Merge pull request #1706 from gruntjs/tag-neew
  • 4674c59 v1.1.0
  • 6124409 Merge pull request #1705 from gruntjs/mkdirp-update
  • 0a66968 Fix up Buffer usage
  • 4bfa98e Support versions of node >= 8
  • f1898eb Update to mkdirp ~1.0.3
  • 75da17b HTTPS link to gruntjs.com (#1683)
  • 6795d31 Update js-yaml dependecy to ~3.13.1 (#1680)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

DenonAvrInputSelector can't be changed via rules?

Not sure if I'm doing anything wrong, but it seems like I can't select the DenonAvrInputSelector when creating a new rule. Master-volume, mute, and power are available in rules, but the input selector is not available. Is this a bug? Or is there a known workaround?

Use case: I use a dummy switch that's turned on/off via my amazon echo. Once it changes its state, I'd like to turn on the AV receiver (works) and 5 seconds later I'd like to switch the input to Bluetooth so I can connect my echo and play music.

Uncaught exception

Hi,

I received this error and it asked to report it. So here it is...

error [pimatic]: A uncaught exception occured: Error: read ETIMEDOUT
    at exports._errnoException (util.js:870:11)
    at TCP.onread (net.js:552:26)
From connect
    at Socket.connect (/home/pi/pimatic-app/node_modules/pimatic/startup.coffee:55:29)
    at Agent.exports.connect.exports.createConnection (net.js:69:26)
    at Agent.createSocket (_http_agent.js:175:16)
    at Agent.addRequest (_http_agent.js:144:23)
    at new ClientRequest (_http_client.js:142:16)
    at Object.exports.request (http.js:31:10)
    at new Request (/home/pi/pimatic-app/node_modules/pimatic-denon-avr/node_modules/restler-promise/node_modules/restler-base/lib/restler.js:75:24)
    at request (/home/pi/pimatic-app/node_modules/pimatic-denon-avr/node_modules/restler-promise/node_modules/restler-base/lib/restler.js:327:17)
    at Object.get (/home/pi/pimatic-app/node_modules/pimatic-denon-avr/node_modules/restler-promise/node_modules/restler-base/lib/restler.js:334:9)
    at /home/pi/pimatic-app/node_modules/pimatic-denon-avr/node_modules/restler-promise/lib/restler-promise.js:28:38
    at Promise._execute (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/debuggability.js:299:9)
    at Promise._resolveFromExecutor (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:481:18)
    at new Promise (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:77:14)
    at Object.get (/home/pi/pimatic-app/node_modules/pimatic-denon-avr/node_modules/restler-promise/lib/restler-promise.js:27:20)
    at HttpAppProtocol._requestUpdate (/home/pi/pimatic-app/node_modules/pimatic-denon-avr/http-app-protocol.coffee:59:19)
    at HttpAppProtocol._requestUpdate (/home/pi/pimatic-app/node_modules/pimatic-denon-avr/http-app-protocol.coffee:2:1)
    at null._onTimeout (/home/pi/pimatic-app/node_modules/pimatic-denon-avr/node_modules/pimatic-plugin-commons/lib/index.js:218:27)
    at Timer.listOnTimeout (timers.js:92:15)
 This is most probably a bug in pimatic or in a module, please report it!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.