pseitz / yamaha-nodejs Goto Github PK
View Code? Open in Web Editor NEWA node module to control your yamaha receiver
License: MIT License
A node module to control your yamaha receiver
License: MIT License
There is a certain feature I wanted to make a PR for, but the feature only works over HTTP, and not with the XML interface.
Can you see a problem with this? Are you trying to support devices that don't support the JSON API?
Hi,
I use homebridge https://github.com/nfarina/homebridge to control my Nest thermostat and also have the homebridge-yamaha https://github.com/neonightmare/homebridge-yamaha plugin working.
The problem is that the homebridge-yamaha plugin only supports basic commands (on/off and source on zone1) but I need it to support multi-zone, volume and source and it needs to work with homekit.
I'm not sure what I can do to help (i'm not a developer) but I think the options are:
I would like to know if there are other options and to understand the best (and easiest) way to progress this.
Any help or advice greatly appreciated.
Fatal TypeError: Cannot set property 'getVolume' of null
at enrichBasicStatus (D:\Coding\YamahaContoller\src\simpleCommands.js:359:27)
at D:\Coding\YamahaContoller\src\simpleCommands.js:350:16
at tryCatcher (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:729:18)
at Promise._fulfill (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:673:18)
at Promise._resolveCallback (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:489:14)
at Promise._settlePromiseFromHandler (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:559:17)
at Promise._settlePromise (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._fulfillPromises (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:704:14)
at Promise._settlePromises (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:730:18)
at Promise._fulfill (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:673:18)
at Promise._resolveCallback (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:466:57)
at Promise._settlePromiseFromHandler (D:\Coding\YamahaContoller\node_modules\bluebird\js\release\promise.js:559:17)
Hi guys,
I found your Project while searching for a possibility to Control The Yamaha Music cast System in combination with my Smart Home implementation.
Very nice coding and excellent work!
I recently found the Official API on a Forum and like to Share it with You since You probably might be interested in it.
It also includes the necessary Http calls for linking devices together which might be very useful in this project as well:
Basic API: https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/9/931ea88e30cf0f05fcdee79816eb4d3f12dd4d70.pdf
Advanced API (eg linking devices): https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/f/f788d96dc1d4c3caaadd4eb1d87457c0b253d7f2.pdf
The logic below is flawed. isPutCommand always evaluates to true and the delay is always present even on GET.
var isPutCommand = xml.indexOf("cmd="PUT"" >= 0);
var delay = isPutCommand ? this.responseDelay * 1000 : 0;
Hitting an error based on some weird network condition, but I'm not sure how to catch this since it's asynchronous:
/usr/local/lib/node_modules/homebridge-yamaha/node_modules/yamaha-nodejs/node_modules/deferred/_ext.js:75
throw this.value;
^
Error: socket hang up
at createHangUpError (_http_client.js:215:15)
at Socket.socketOnEnd (_http_client.js:300:23)
at Socket.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)
You can see the downstream code here; it's possible that it's not defining an error callback in some case and that could be the problem...do you know if this should be properly caught if an error callback is always provided? Or is this something that needs to be (or can't easily be) caught at the yamaha-nodejs level?
I am using a RX-V577, which has a Zone B within the Main Zone. Would it be possible to control the Zone B power and volume using this module? (Zone B doesn't have it's own source, but allows for separate volume and power control)
I cloned to my local machine. Just try to run the test.js by typing
node test.js
Got the following errors:
simpleCommands.js:14
return this.getOrDiscoverIP().then(ip => {
^^
SyntaxError: Unexpected token =>
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/Users/andysio/workspace/test/yamaha.js:1:84)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
Now, I have tried to install from npm npm install yamaha-nodejs
. Run the test and it worked fine. What's the difference with the files comparing to one in npm?
@PSeitz I got a couple of bug reports and found that the version of the package on NPM doesn't match GitHub. I think you need to publish in NPM.
Github has this on line 346 basicStatus.getZone = function() {
And NPM has this on 346 basicStatus.isOff = function() {
I think a NPM push is needed
Hi PSeitz,
thank you for creating this piece of code. I'm trying to use it for creating a driver for my NEEO remote.
Can you please add some commands for extracting info about the playback?
The Request for this would be:
<YAMAHA_AV cmd="GET"><SERVER><Play_Info>GetParam</Play_Info></SERVER></YAMAHA_AV>
Response is then for example:
<YAMAHA_AV rsp="GET" RC="0"><SERVER><Play_Info><Feature_Availability>Ready</Feature_Availability><Playback_Info>Play</Playback_Info><Play_Mode><Repeat>One</Repeat><Shuffle>Off</Shuffle></Play_Mode><Time><Elapsed>1:26</Elapsed></Time><Meta_Info><Artist>A.A. Milne read by Alan Bennett</Artist><Album>Winnie the Pooh</Album><Song>Eeyore, The Old Grey Donkey...</Song></Meta_Info><Album_ART><URL>/YamahaRemoteControl/AlbumART/AlbumART6475.jpg</URL><ID>64752</ID><Format>JPEG</Format></Album_ART></Play_Info></SERVER></YAMAHA_AV>
I would love to integrate the Album_ART into my project so i need the ID or URL of the Album_Art that is played back.
Can you please help to extract this information? I have a very basic knowledge of coding so help would be really appreciated.
I've just read your note on Discovery. I think it can be done using the Simple Service Discovery Protocol (SSDP) used as part of UPnP. I'll do a proof-of-concept implementation and will eventualy get back to you.
Great little application which I have been able to get running with my alexa and my yamaha receiver. Note that there is an error in the package installation of OpenSSL which I was able to work around. I'm relatively new to python so I'm not sure if there is a way to update the installers to prevent it from occurring.
When you install yams the OpenSSL package that gets installed will fail with an error about an undefined environment variable.
The work around is to go into the python directory \Lib\site-packages and delete the OpenSSL and pyOpenSSL directories. You then need to use pip to reinstall the pyOpenSSL package. This resolved the issue on my machine.
There is a second issue I had with Alexandra running on my windows PC. It will attempt to parse the site certificate path from amazon and puke because the path after the server name doesn't match /echo.api/. In util.py _get_certificate() I needed to change the following line to remove the startswith statement. I printed out the path and it was correct but apparently startswith doesn't parse the path correctly. Might be a windows path issue.
# Sanity check location so we don't get some random person's cert.
if url.scheme != 'https' or \
host not in ['s3.amazonaws.com', 's3.amazonaws.com:443'] or \
**not path.startswith('/echo.api/'):** <- this fails
log.error('invalid cert location %s - host %s - path %s', cert_url, host, path)
return
Otherwise I'm digging it and was able to get everything running without too much pain for a python noob.
Hi, I succeed to create my own web app using your api. It's my first nodejs application.
I have one problem: from time to time my wireless network break, and in this case
Yamaha.prototype.SendXMLToReceiver method throw and timeout error, that cause my nodejs app to crash. I tried a lot of method to avoid app exit, without success.
Can you you help me?
Thx.
Hi ๐
I'm working on homebridge-yamaha-home plugin.
I've added scenes as inputs there.
That plugin fully depends on yamaha-nodejs.
But I have found that there is no method to obtain scene information (at least scene name).
I have found some TCP commands in YNCA protocol, for example @main:SCENENAME=?
What I'm trying to do is to convert it into xml request, and add new method to yamaha-nodejs functionality which can obtain information about scene.
But I'm not sure that I'm doing it in the right way.
May I ask for a bit of advice here? Thanks!
Not sure if anyone is updating this but this plugin seems tailored to one zone as most do, but I would like it to work will more than one I am happy to do a pull request.
Yamaha amps can go upto 4 zones as far as I know. I would like the word "Main Zone" replaced everywhere with a zone variable.
If that zone is not filled out it goes to "Main Zone" otherwise it goes to "Zone 2" 3 etc.
It makes it much more usable.
In the simpleCommands.js there is a function sendRCode which in theory allows me to send codes to the receiver which are then processed as if the corresponding button on the remote was pressed. There are various formats presented in the comments and I already figured out which one is the right for my receiver. But how do I figure out the codes now? I tried 7C80 (which is presented as an example in the comments to simulate the power button) but the receiver responded with an error. I then tested 5EA1CE30 which is what I recorded with lirc a while ago for the button HDMI6 (still have all the codes for lirc in a file) and the receiver no longer responded with an error, but it also didn't do nothing at all. The response looked ok though (RC="0"). So the format lirc is using seems to be correct, but still those codes are not 100% correct.
This is the command I send to the receiver as a test which should simulate a press of the HDMI6 button:
<YAMAHA_AV cmd="PUT"><System><Misc><Remote_Signal><Receive><Code>5EA1CE30</Code></Receive></Remote_Signal></Misc></System></YAMAHA_AV>
The response is:
<YAMAHA_AV rsp="PUT" RC="0"><System><Misc><Remote_Signal><Receive></Receive></Remote_Signal></Misc></System></YAMAHA_AV>
I already searched google for a reference sheet for my receiver since the "RX AX10 VX71 Series Function Tree.xls" explicitly states that these codes are provided seperately from that file.
There are some header infos in the lirc remote file, maybe I need to add some of this as well? I attached the lirc remote file so you can have a look at it:
Yamaha.txt
Edit: The Receiver is a Yamaha RX-V477
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.