alexmohr / media_player.sony

Custom component for Home Assistant to control Sony devices
Apache License 2.0
15 stars 8 forks source link

Pair BDP-S6700 with Home Assistant #31

Closed Gaijin66-git closed 3 years ago

Gaijin66-git commented 3 years ago

Hello anyone,

I installed the sonyapilib and put the contents of the mediaplayer.sony in custom_components. I added the following in configuration.yaml: ` media_player:

I run Home Assistant on Hass OS 6 on Raspberry Pi 4 with 4 GB. Core version is 2021.6.5. I see nothing about this in my logs. Does someone have the answer? Thanks in advance.

alexmohr commented 3 years ago

It's always hard to debug these issues without the access to a device. Please take a look in the home assistant log and post anything related to this component here. As the component offers configuration it seems to be loaded correctly at least.

Maybe the authentication is different for your device. You could try to install the android app Packet Trace and use it to capture the traffic between the Sony TV and SideView app for the registration process.

Gaijin66-git commented 3 years ago

Wich packet trace app would you recommend?

Unfortunately, the Sony TV and Sideview app was no longer available from April.

alexmohr commented 3 years ago

I used https://play.google.com/store/apps/details?id=app.greyshirts.sslcapture in the past. The Sony app can be found here https://play.google.com/store/apps/details?id=com.sony.tvsideview.phone

But please take a look at the logs first

Gaijin66-git commented 3 years ago

Thank you for the recomendations. But the Sony TV and Sideview is not available in the Netherlands. I can't find anything in the logs. But i will try with the packet tracer and songpal app and the Home assistant app. I will report back.

Gaijin66-git commented 3 years ago

I tried the packet tracer you recommended and music center app from sony. This is what i managed to capture: UNSUBSCRIBE http://192.168.0.117:52323/upnp/event/AVTransport HTTP/1.1 Connection: close Content-Length: 0 HOST: 192.168.0.117 SID: uuid:63acc0f0-d1d4-11eb-8000-800000000000 User-Agent: UPnP/1.0 DLNADOC/1.50 X-AV-Client-Info: av=5.0; cn="Sony Corporation"; mn="Music Center"; mv="6.1.1" X-AV-Physical-Unit-Info: pa="Music Center"

HTTP/1.1 200 OK Connection: close Date: Sun, 20 Jun 2021 14:37:17 GMT Server: Linux/3.10 UPnP/1.0 Sony-BDP/2.0 X-AV-Server-Info.sony.com: av=5.0; cn="Sony Corporation"; mn="BDP-S6700"; mv="2.0"; X-AV-Physical-Unit-Info.sony.com: pa="BDP-S6700";

But the packet tracer uses vpn and then i cannot connect to my BD player from music center

Gaijin66-git commented 3 years ago

Meanwhile i used another app for my player: MyAV. This one works for my player. And i got a lot more data in my sniffer. This data is rather overwhelming, so i ask you what data do you need?

alexmohr commented 3 years ago

I need the traffic between the app and your device for the registration process. The trace should contain all data including addresses, headers and urls. Please export the data in pcap format so I can import it into wireshark. This makes it a lot easier to understand the traffic.

The registration process is currently implemented in the following manner:

Gaijin66-git commented 3 years ago

The reason i did not report for a week is that i did several tests with th MyAV app and capturing. None of the packets showed me a line with register. I began capturing when i register an IR remote in MyAV. I found out that the player uses standard ports 50202, 52323 and 50001 for respectively app_port, dmr_port and ircc_port. I attached some files, so maybe this could help a little bit further.

alexmohr commented 3 years ago

bdp-s6700 app.zip: GET /appslist HTTP/1.1 bdp-s6700 50000.zip: Not a valid pcap file: shows up empty in wireshark Bluray speler capture.zip: unsubscribe from a upnp event which describes the playback status bdp-s6700 port 80.zip: display of an image in webp format.

None of these captures shows the registration process. Can you re-add your device in the app you are using while capture is running to make sure you are sniffing the complete traffic?

I'm really sorry but I can't help you without a trace of the registration process.

Gaijin66-git commented 3 years ago

Thanks for the quick reply. As I mentioned before I started capturing before I added the device. I tried two methods: manually added the device with the ip-address of the player and scanning for devices. Both found and connect with the player. In between I resetted the MyAV app. The only thing i got are discoveries and ircc commands. In al off these captures there is no register command. I cannot use the MyAV app any longer, because the trial period expired. I now use the official Music Center. Normally it connects with the player and I can control it. But when I start capturing it does not connect. VPN got in the way. Then I see commands with SSL and no data. Do I have to install a certificate and if so, how do I do that? Thanks for your reply in advance.

alexmohr commented 3 years ago

I've never encountered a device which encrypts the communication. As your device was released after 2013 it might be possible that it is supported much better by the official integration https://www.home-assistant.io/integrations/braviatv/.

Have you tried that already?

Gaijin66-git commented 3 years ago

No. I didn't. I will try that. Besides your integration I only used the SongPal integration.

Thank you. I will report later to let you know if it works.

Gaijin66-git commented 3 years ago

Unforunately the Bravia TV does not work. When installing it asks for an ip-address and then a pin. The player does not show a pincode. Trying '0000' has no effect.

Gaijin66-git commented 3 years ago

I think i will leave it for now. I don't think we find a solution. I still want to thank you for the effort and help.