lucasvdh / com.yamaha.receiver

Yamaha receiver app for Homey
GNU General Public License v3.0
2 stars 5 forks source link

[FEAT] Add support for RX-V3900 #16

Open juw2 opened 4 years ago

juw2 commented 4 years ago

Describe the bug

When trying to add my Yamaha RX-V3900 using the beta from the app store, and add the IP address I get {"message":"Cannot read property 'toString' of undefined"}.

Expected Behavior

Receiver to be added to homey

Actual Behavior

Errors out with abow error

Steps to Reproduce the Problem

  1. Include Yamaha RX-V3900
juw2 commented 4 years ago

Hi. Tried version 1.0.2 now and when including the receiver I now get: {"message":"Non-whitespace before first tag.\nLine:0\nColumn: 1\nChar: E"}

juw2 commented 4 years ago

Yamaha RX-V3900 error v1.0.2.txt Not sure if it will help but added the error shown from Node.js command line window.

juw2 commented 4 years ago

Also, autodiscovery doesn't work as you can see in the text file. I have to add the IP manually.

lucasvdh commented 4 years ago

Hi @juw2 the Non-whitespace before first tag error was an issue with the app not handling an error response correctly and has been resolved in version 1.1.x. The message should've been something like "Could not fetch receiver name".

The underlying issue is probably not resolved yet. I will investigate the issue somewhere next week and will ask any question I have for you here.

lucasvdh commented 4 years ago

Could you maybe check if you get a response from http://192.168.1.74:8080/MediaRenderer/desc.xml

If so, could you save the response and share it here?

juw2 commented 4 years ago

Hi Lucas ant thanks for your effort.

Port 8080 doesn’t work but 80 do. Response from http://192.168.1.74:80/MediaRenderer/desc.xml

1 0 urn:schemas-upnp-org:device:MediaRenderer:1 RX-V3900 YAMAHA CORPORATION http://www.global.yamaha.com/ Network Receiver RX-V3900 3900 http://www.global.yamaha.com/products/av/index.html 0C76E4D3 uuid:26237000-9894-11db-9976-00a0de4c72d6 image/png 48 48 24 /Icons/48x48.png urn:schemas-upnp-org:service:RenderingControl:1 urn:upnp-org:serviceId:RenderingControl /RenderingControl/desc.xml /RenderingControl/ctrl /RenderingControl/event urn:schemas-upnp-org:service:ConnectionManager:1 urn:upnp-org:serviceId:ConnectionManager /ConnectionManager/desc.xml /ConnectionManager/ctrl /ConnectionManager/event urn:yamaha-com:service:YamahaRemoteControl:2 urn:yamaha-com:serviceId:YamahaRemoteControl /YamahaRemoteControl/desc.xml /YamahaRemoteControl/ctrl /YamahaRemoteControl/event http://192.168.1.74/

With version 1.1.1 I get a long error when trying to include it. {"message":"Request failed with status code 400","name":"Error","stack":"Error: Request failed with status code 400\n at createError (/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/node_modules/axios/lib/adapters/http.js:237:11)\n at IncomingMessage.emit (events.js:323:22)\n at IncomingMessage.EventEmitter.emit (domain.js:482:12)\n at endReadableNT (_stream_readable.js:1204:12)\n at processTicksAndRejections (internal/process/task_queues.js:84:21)","config":{"url":"http://192.168.1.74:80/YamahaRemoteControl/ctrl","method":"post","data":"<YAMAHA_AV cmd=\"GET\">GetParam","headers":{"Accept":"application/json, text/plain, /","Content-Type":"application/x-www-form-urlencoded","User-Agent":"axios/0.19.0","Content-Length":119},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1}}

When googling on my issue, I found this: https://community.openhab.org/t/yamahareceiver-zone-discovery-not-working-with-rx-v3900/38350 I know it’s another system but they talk about differences with RX-V3900.

Could that be why it’s not working?

Br Jonas

lucasvdh commented 4 years ago

Thanks for all the info @juw2 this is very helpful.

At least now I know why your device doesn't show up in auto discovery. The auto discovery of the Yamaha AV Receiver looks for <modelDescription>AV Receiver</modelDescription> and your device is apparenly Network Receiver (<modelDescription>Network Receiver</modelDescription>).

Also, according to the YamahaRemoteControl documentation for AV Receivers the /MediaRenderer/desc.xml should contain a <yamaha:X_device> root element which I do not see in this case. So it might be that this is a different version of the YamahaRemoteControl api. The thread on community.openhab.org seems to be saying the same.

I will look into what changes are required to support this model. Just to be sure, can you please share the content of the /YamahaRemoteControl/desc.xml here? http://192.168.1.74/YamahaRemoteControl/desc.xml

To manage expectations: I'm currently working on fixing some core issues regarding multiple zone support in MusicCast devices. I will start on this issue after I've completed those.

I'll post any progress I make, or when there's a new version for you to test, here.

juw2 commented 4 years ago

The answer is to http://192.168.1.74/YamahaRemoteControl/desc.xml is:

1 0

Br Jonas

lucasvdh commented 4 years ago

For my own reference: https://github.com/openhab/openhab-addons/pull/3264

juw2 commented 4 years ago

Hi Lucas. See my marking below. When googeling, it seems like that section only exists on network receivers that has MusicCast built in. Mine doesn’t. Could that be the case? In that case maybe there should be another way of discovering a receiver.

Br Jonas

Skickades från E-posthttps://go.microsoft.com/fwlink/?LinkId=550986 för Windows 10

Från: Lucas van der Havemailto:notifications@github.com Skickat: den 18 juni 2020 16:28 Till: lucasvdh/com.yamaha.receivermailto:com.yamaha.receiver@noreply.github.com Kopia: juw2mailto:juw2@hotmail.com; Mentionmailto:mention@noreply.github.com Ämne: Re: [lucasvdh/com.yamaha.receiver] Yamaha RX-V3900 returning bad request 400 (#16)

Thanks for all the info @juw2https://github.com/juw2 this is very helpful.

At least now I know why your device doesn't show up in auto discovery. The auto discovery of the Yamaha AV Receiver looks for AV Receiver and your device is apparenly Network Receiver (Network Receiver).

Also, according to the YamahaRemoteControl documentation for AV Receivers the /MediaRenderer/desc.xml should contain a root element which I do not see in this case. So it might be that this is a different version of the YamahaRemoteControl api. The thread on community.openhab.org seems to be saying the same.

I will look into what changes are required to support this model. Just to be sure, can you please share the content of the /YamahaRemoteControl/desc.xml here? http://192.168.1.74/YamahaRemoteControl/desc.xml

To manage expectations: I'm currently working on fixing some core issues regarding multiple zone support in MusicCast devices. I will start on this issue after I've completed those.

I'll post any progress I make, or when there's a new version for you to test, here.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/lucasvdh/com.yamaha.receiver/issues/16#issuecomment-646055032, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AH3NHEVZYZLRW46EPWGJJUDRXIQBBANCNFSM4N6IPNBQ.