Giter VIP home page Giter VIP logo

pimatic-yamaha-avr's Introduction

pimatic-yamaha-avr

Npm Version Build Status Dependency Status

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

Status of Implementation

The following features are provided:

  • support for power switching, volume mute, volume control, input selection, and status display (main zone, only)
  • auto-discovery of devices for pimatic 0.9
  • 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.

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.

Credits

Many thanks to @ccvh and @seelenbrokat for their support in testing stuff at the early stages of development!

Plugin Configuration

{
      "plugin": "yamaha-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 80 Number AVR control port. Only required for testing purposes
debug false Boolean Debug mode. Writes debug messages to the pimatic log, if set to true

Device Configuration

The following devices can be used. As of pimatic 0.9 you can use the auto-discovery of the frontend to add devices easily.

For each device the time interval used to obtain status updates from the AVR can be specified. The default is 30 seconds, the minimum value accepted is 10 seconds. It should be noted that updates are acquired by an centralized update handler. Thus the device with the smallest values set defines the time interval for the update handler. If no devices exist, e.g. devices have been removed at runtime, the update handler is stopped.

YamahaAvrPresenceSensor

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": "YamahaAvrPresenceSensor"
}

The device has the following configuration properties:

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

The following predicates and actions are supported:

  • {device} is present|absent

YamahaAvrPowerSwitch

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. See the AVR manual for details.

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

The device has the following configuration properties:

Property Default Type Description
interval 30 Number The time interval in seconds (minimum 10) 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}

YamahaAvrMuteSwitch

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

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

The device has the following configuration properties:

Property Default Type Description
interval 30 Number The time interval in seconds (minimum 10) 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}

YamahaAvrMasterVolume

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": "YamahaAvrMasterVolume"
}

The device has the following configuration properties:

Property Default Type Description
interval 30 Number The time interval in seconds (minimum 10) at which the power state of the AVR will be read
volumeDecibel 16.5 Number The maximum volume which can be set using the volume control
volumeDbMin -80.5 Number The minimal volume in dB of the receiver (check the AVR manual to get the right setting)
volumeDbMax 16.5 Number The maximum volume in dB of the receiver (check the AVR manual to get the right setting)

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

YamahaAvrInputSelector

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

{
      "id": "avr-5",
      "name": "AVR Input Selector",
      "class": "YamahaAvrInputSelector"
      "buttons": [
           {
             "id": "TUNER"
           }
           {
             "id": "AUDIO1"
           }
      ]
}

The device has the following configuration properties:

Property Default Type Description
interval 20 Number The time interval in seconds (minimum 10) at which the power 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 action is provided to switch the input source as part of rules

  • avr input <device> to "<id>", for example: avr input yamaha-avr to "tv"

YamahaAvrSceneSelector (Experimental)

Similar to the input selector, the YamahaAvrSceneSelector can be used switch the the input by selecting a scene if the AVR supports that feature. Allowed values for scene selection depend on the AVR model.

{
      "id": "avr-5",
      "name": "AVR Scene Selector",
      "class": "YamahaAvrSceneSelector"
      "buttons": [
           {
             "id": "TV"
           }
      ]
}

The device has the following configuration properties:

Property Default Type Description
interval 20 Number The time interval in seconds (minimum 10) at which the power state of the AVR will be read
buttons see example Array The buttons to display for selection. See device configuration schema for details

History

See Release History.

License

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

AGPL-3.0

pimatic-yamaha-avr's People

Contributors

greenkeeper[bot] avatar m1rk0 avatar mwittig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pimatic-yamaha-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 🌴

flooding log if host is unreachable

If the AVR isnt powered, the log file of pimatic 0.9 is flooded with an error. This shouldn't be, I think. Absent means off, and that should be stated.
Error:
error [pimatic-yamaha-avr]: [Plugin] Error: { [Error: connect EHOSTUNREACH 192.xxx.xxx.xxx:80]
code: 'EHOSTUNREACH',
errno: 'EHOSTUNREACH',
syscall: 'connect',
address: '192.xxx.xxx.xxx',
port: 80,
__trace: 'Error: From connect\n at Socket.connect (/home/pi/pimatic-app/node_modules/pimatic/startup.coffee:55:29)\n at Agent.exports.connect.exports.createConnection (net.js:69:26)\n at Agent.createSocket (_http_agent.js:180:16)\n at Agent.addRequest (_http_agent.js:149:23)\n at new ClientRequest (_http_client.js:142:16)\n at Object.exports.request (http.js:31:10)\n at new Request (/home/pi/pimatic-app/node_modules/pimatic-yamaha-avr/node_modules/restler-promise/node_modules/restler-base/lib/restler.js:75:24)\n at request (/home/pi/pimatic-app/node_modules/pimatic-yamaha-avr/node_modules/restler-promise/node_modules/restler-base/lib/restler.js:327:17)\n at Object.post (/home/pi/pimatic-app/node_modules/pimatic-yamaha-avr/node_modules/restler-promise/node_modules/restler-base/lib/restler.js:342:10)\n at /home/pi/pimatic-app/node_modules/pimatic-yamaha-avr/node_modules/restler-promise/lib/restler-promise.js:28:38\n at Promise._execute (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/debuggability.js:272:9)\n at Promise._resolveFromExecutor (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:475:18)\n at new Promise (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:77:14)\n at Object.post (/home/pi/pimatic-app/node_modules/pimatic-yamaha-avr/node_modules/restler-promise/lib/restler-promise.js:27:20)\n at /home/pi/pimatic-app/node_modules/pimatic-yamaha-avr/yamaha-avr.coffee:97:14\n at Promise._execute (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/debuggability.js:272:9)\n at Promise._resolveFromExecutor (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:475:18)\n at new Promise (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:77:14)\n at YamahaAvrPlugin.sendRequest (/home/pi/pimatic-app/node_modules/pimatic-yamaha-avr/yamaha-avr.coffee:95:18)\n at YamahaAvrPlugin._requestStatusUpdates (/home/pi/pimatic-app/node_modules/pimatic-yamaha-avr/yamaha-avr.coffee:73:10)\n at [object Object]._onTimeout (/home/pi/pimatic-app/node_modules/pimatic-yamaha-avr/node_modules/pimatic-plugin-commons/lib/index.js:218:27)\n at Timer.listOnTimeout (timers.js:92:15)' }

[Bug] Non whitespace before first tag.

Freshly installed pimatic with yamaha avr. Detected device by discovery function, when clicking any device following pop-up appears:

Oops...
Error: Failed to parse XML body: Non-whitespace before first tag.
Line: 0
Column: 1
Char: U

Thanks a lot for your work!

Szene Switch button

Thanks for this plugin!
It works great. Could you add a scene switch?

Or does it depend on the AVR model that I have?

Error at startup

Hey,

i get the following message once after every startup of pimatic:
error [pimatic]: Could not initialize the plugin "yamaha-avr": Cannot find module './actions/yamaha-avr-input-select-action'

The plugin itself works without any issues.

Provide Spotify/Net Radio Player Controls & Current station/Song Playing Display

Great plugin! Was looking for something like this for a long time..

Is it possible to add anything of the following functions:

  • When input NET RADIO is selected: Play a specific music station
  • When input SPOTIFY is selected, control music with play/pause and previous/next
  • When input SPOTIFY is selected, see current song info

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.