-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Info for invokes #3
Comments
This was the same issue I had when writing this module and there just seems to be a lack of documentation from Sony about this. However, the TV's actually have an API that returns all the available methods, versions, parameters and return values. You can invoke this information yourself, by calling for example I found that most of the parameters and return values are fairly self explanatory but unfortunately there are some that I don't really have a clue what they mean. There are a bunch of other "service protocols" available, that can be accessed as accessControl I should update the README to include this information as to be fair it isn't obvious if you've not got much experience with the Bravia API. I hope this helps. Wayne |
Thanks, Yes, I've been listing the protocols and the geMethodTypes like system: Ok, so for the actual method parameters is just a best guess :) |
Yeah sadly, if you manage to find some documentation then please come back and let me know :) |
You're both on the right tracks - the documentation is there in the getMethodTypes queries. If you look at the setAudioVolume method definition in the audio.getMethodTypes() response:
The volume needs to be given as a string and not as an integer. Int is what the setAudioVolume query would return (it returns a How does the getSpeakerSettings method work then? Checking the getMethodTypes, a target string is needed:
First I tried speaker and headphone as the target but those return an "Illegal Argument" error. By trial and error I figured out that querying it with an empty object
I wish there was an actual documentation for this stuff but I guess Github comments will have to do 😄 |
Awesome, thank you for experimenting and fixing the documentation. Maybe, we can start a wiki on this and try and complete as much documentation on the API as we can, thoughts? P.S. I don't have access to a Bravia TV as originally wrote this library for a friend, can get the odd access but won't make this very easy for me to do on my own but with you guys contributions I think it's certainly possible! |
Just wanted to let you know, the help file on NPM still says volume: 50 instead of '50'. One question: When I try to getMethodTypes(), I end up with this instead of actual types. [ { version: '1.0', I'm still fairly new to node js, any direction you can give me to get the actual list would be great. |
I'm just testing another update to the code so once this is done I'll push the latest changes to NPM. You'll need to use |
I don't know if having a sony subwoofer and soundbar hooked up changes anything but this is what I've figured out. Everything works for me except changing the volume. I have everything else voice controlled by an amazon echo. I can change volume level to 'speaker' and when I get the value, it is where I set it. The TV does not actually change volume on hdmi1 but I did notice that it IS changing the volume on the home screen. |
I was hoping that the setSpeakerSettings would be corresponding to the operation pressing: |
Confirmed. After turning off the sound bar, changing the sound works perfectly. I just need to figure out how to change the connected audio which we normally control with the normal tv remote. |
What does the following return as @ilessiivi wrote above: bravia.audio.invoke("getSpeakerSettings", "1.0", {}).then(function(info) {
console.log("speaker settings", info);
}).catch(function(err) {
console.error("speaker settings err", err);
}); |
This: |
You've probably already tried it but just interested to know that if you invoke the |
I think somewhere in the TV settings there is a option to connect a subwoofer to the headphones jack ... |
Maybe some target parameter gets the Audio System levels... |
The whole issue for me is HDMI-CEC. Is it possible to send a command that talks to the Sony HDMI/ARC? |
Hi, It was myself and Wayne that started investigating this some months ago, we are currently testing again, unfortunately I am unable to fully test the audio setup you guys have as I am currently using a sound bar connected via Optical so no ARC. I think the best way to try and move this on will be to install the TV & Video sidesview app (official Sony app) on an IOS or Android device and try changing the volume and see if that adjusts it, if it does we can look into packet capturing. Also worth checking the home theatre control settings, I have no idea what options there are as It obviously doesn't detect arc but this may have some useful settings |
I'm using a Yamaha 5.1(Without ARC) system through optical cable too. For normal Tv usage I don't turn on the Yamaha amplifier, but when I see movies, I turn the Amp on, switch to HDM1... and I have to set the speakers settings to Audio system... and when I'm done I have to put it back to the TV speakers (YAWWN). |
@muldy Me and James are playing around with his TV as we speak to see if we can help crack it for you. Interestingly enough calling the API method: |
@muldy It seems that changing the speaker mode between TV and Audio System is most likely possible using the { "settings": [
{ ... } // <-- Unknown what goes in this "GeneralSettings" object.
] } We've tried a bunch of these but everything gives back an illegal argument error and surprise, surprise not once ounce of documentation anywhere available on it... |
@AmigaZoid What happens if you invoke: bravia.audio.invoke("getVolumeInformation", "1.0", {}).then(function(info) {
console.log(info);
}).catch(function(err) {
console.error(err);
}); I'm interested to know whether you have more than just speaker and headphone as targets. |
I have emailed Sony support to see if they will give us API documentation, will update when I have one. |
Please let me know if you figure it out. I'm in the process of a OS reinstall so will try the command above once I have Node reinstalled. |
@AmigaZoid I most certainly will do that will be really useful for me. When you have completed your project, would this be something you would be willing to share as I know my friend (who I originally wrote this module for) is looking to do exactly the same as you and he isn't a programmer and I don't have much time to help him. Also, when you have reinstalled your OS and have some time let us know what results you get back from the I have now created a new issue for what all of us here are really after. You can find it here. |
[ { target: 'speaker', Same info I had before for getspeakersettings As for the alexa setup, sure I can share. It's really minimal code for the way I am achieving it. I have a normal Alexa app and lambda that is going through AWS.Iot. So I have a subscribe/publish setup through iot that simply post a word like TVPower or VolumeUP to the Node server. I simply use an if or a switch to send the bravia code through your script to the TV. I'm doing the same thing for Kodi except I'm sending a JSON with http to the kodi webserver. Planning on adding zwave lights also if I can get it running. |
Project 2 is lightening for us but Wayne will also use them so easier to test. Would be interested to know if u are running Kodi natively on theTv (I currently am) of using an external device. |
Yes, running kodi on the TV without an external box. |
Good to know, Sony's response was basically that they don't provide technical spec to end users which was what we expected, doesn't hurt to ask just great you stumbled on that documentation which should help a lot, just about to look now. |
Hi! I'm working on a Kodi plugin to do various things with my Bravia TV and have been having trouble finding proper documentation as well. Would it be possible for someone to share that doc with me as well? It'd be much appreciated :) |
This might help: |
I'll give it a look, thanks! Was anyone ever able to get the status of the
TV when it's playing Amazon Video or Netflix? It's the next step I'm trying
to complete haha
…On Mon, Aug 14, 2017, 9:52 AM Michael Schwartz ***@***.***> wrote:
This might help:
https://github.com/RoboDomo/bravia-microservice
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABe3cV-xRv4LXNk9ECqTo3IjHOnDiHPCks5sYFEUgaJpZM4NiYhA>
.
|
There is no way to get status that I've found. There is some documentation of the low level protocol to be found online, some even within github repositories. |
I have been searching for docs on the api as well. and I happened across your conversation here so I thought I might share with you. Tho I have written this for python I believe I have the most complete means of controlling a Bravia TV written to date. so you are more then welcome to have a gander. There are a few stumbling blocks I am trying to work through. one of them being the SSDP discovery so at the current moment the IP has to be entered. But here is the link to my repo for it |
Hi all! I found this issue while researching a very similar API for my Sony AV Receiver (the STR-DN1080). I'm looking into how I can call the "setSoundSettings" method, but I fail to find out what's expected of GeneralSettings[]. Anyway, the link @AmigaZoid posted looked intriguing, but as we are now in the future the link now 404s - as I guess we could expect.. Does anyone have a copy of the contents? |
@olemartinorg Please find a download to the documentation from that link here: https://ufile.io/9nj97 Hope this helps. |
Woah, that's a nice find! That got me a good step forward, but I'm still getting error number 15 "unsupported operation" for some calls. Meh, I guess the API doesn't support everything it says it does. Thank you very much for that documentation, though! |
Hmmm if anyone has the newer 4K Android TV and a sound bar Sony now has native Alexa support (unfortunately) I don’t, but they could try out the intergartion see if that works and potentially sniff the packets to see what’s occurinf (assuming Sony actually have it working). We originally found a fair bit out about the TV using this method but with the slideshow app rather than Alexa before we stumbled upon the documentation. |
@JamesScammell It's funny you mention that-- I have been trying to find a way to increase or decrease the volume on my Sony XBR65X900E via an HTTP request; but I keep getting a '401 - Invalid Request' response. I did just try using Wireshark and another app to sniff the packets going from my Echo to the TV (using the Sony Bravia skill) but I haven't been able to grab any yet. Any suggestions for how to do this properly? I can get some commands to work using the http://[IP]/sony/audio route (e.g. - {"method": "setAudioVolume", "params": [{"target": "speaker", "volume": "90"}], "id": 1, "version": "1.0"}). However, it seems the only semi-documented way of increasing or decreasing volume is to use the IRCC route. I have mainly focused building and sending requests via Postman. I would list them here, but it occurs to me that if I can just get a packet from my Echo then I'll have everything I need :) I'll post here if I am able to find anything. |
@jtasse are u using the TV with a Sound bar that uses cec (bravia link)? that's where people seem to have experienced issues, mine has no control integration with the TV and connects via optical which has obviously prevented me testing that side. I find the most reliable way with Wireshark was to use a cabled network connection and plug my laptop into the same switch, you should also enable port mirroring on the switch or router you are using and mirror the port your TV is plugged into to the port your laptop\pc is plugged into (both devices should be connected to the same router or switch) without doing this you may or may not receive anything useful, if you are not familiar with Wireshark the output can be pretty over whelming so feel free to save to pcap and share, I can then have a look. |
@JamesScammell did you mean Bravia sync? My sound bar (a Sony HT-XT1) actually works pretty well with my TV--turning the TV off will power off the sound bar; and changing the volume on the TV remote will pass through to the sound bar. And thanks for the Wireshark tips. However I've been doing some digging and a couple sources would seem to suggest that requests from an Echo are encrypted via TLS. I was able to capture a request that I sent to my TV from Postman, but unfortunately I don't think I'm going to be able to grab an unecrypted request from an Echo--unless you know of another way to intercept :) A shame, really--but at least I know there does exist a request that will change the volume (even if I don't know the exact syntax yet). |
Great sound base, I have seen them on demo. I hadn’t even considered they would be using ssl, I’d be more suprised to learn they were not to be honest just didn’t occur to me until now... Just found the following online it’s not something I have previously stubled on, it’s pretty late here in the uk so haven’t had a proper look it may not be relivent as it does not specify its for Bravia TVs but might be worth some investigation given that it specifically refers to the set volume method. |
@JamesScammell: OK so I finally got it. Although I couldn't use the API you suggested (my device is not supported), it got me thinking that maybe there was an API or implementation I missed somewhere. I came across this Bravia project on GitHub and decided to give it a try. I was definitely surprised when I configured the sample app, ran it, and saw the volume change almost immediately. I captured the packet for posterity. It turns out the 'Cookie' header is really the key. Without that the TV will not execute the request. HEADERS BODY
With this I can finally implement a workaround to increase/decrease volume the desired amount (since the sound bar integration causes issues with the Alexa skill I mentioned). Anyway, thanks again for your suggestions! |
You know, I had actually cloned that repository and tried to get it set up, but couldn't get it working. What's the advantage of that approach? In my case, I'm just looking to create an AWS Lambda script so that I can send these commands to my TV via my Echo. |
MQTT is a more standardized way to integrate disparate kinds of devices. Nest Thermostat and TV, for example. I linked to the code so you could examine it to see what you need to do for your purposes. It's quite robust and does every function I think is available via API. I found a manual online somewhere :) |
Thanks for the feedback guys, have u found that Mqtt creates irritating delays, granted in a lot of use cases you wouldn’t notice or care but in the instance of your tv extra delay would defiantly annoy me although this is an assumption it does not stating so. |
There can be some lag. I defeat that, to a large degree, by only subscribing to specific things and by caching the last known states in localStorage. For some of my displays, I'm subscribing to quite a few topics - weather, pool temp (and devices status), TV status, smartthings devices/states, etc. On those screens, the messages from MQTT come in a stream, single file style. The real lag is all the cloud stuff. Nest thermostat data, smart things, and so on. That network traffic is internet speed, not LAN speed :) As far as sending (to command the TV to do whatever), it's quite instant. Your MQTT message goes out immediately and is handled immediately by the microservice. The state of the buttons might lag, though. If you hit volume up 10 times, the volume goes up 10 times within a second or whatever. The benefit is I can MQTT to do things like macros (turn off light, set thermostat to 72, turn on TV with one button tap). I can use mitt command line in cron jobs to do things, too. I've gone a lot further than that, though. I check the weather data for sunrise/sunset and turn on the garden lights at sunset and off at sunrise. My house has a craft room next to the den where I keep a few server type machines. I put a temperature sensor in there and when the temperature gets too warm, the ceiling fan turns on low. The fan gradually goes from low -> medium -> high as the temp goes up in the room (I live in the desert, so it can get really hot outside). |
Haha, so you basically built a SolarWinds style interactive dashboard for your home? :) I'm not quite at that level yet, but MQTT does sound pretty cool! |
Really interesting to see how everyone is using the library, any feedback or suggestions on it at this stage? Also, @mschwartz are you opening sourcing the code, something like that would be fantastic in my house also! |
It's all open source. Hack at will, PRs welcome. A repo for each micro service and the main one for the web client. Have a look at macro-microservice to see how trivial it is to mix and match the various home automation features (like nest, smart things, and TV in one macro). MQTT. |
Hey @AmigaZoid : can you share any more details regarding your setup for "subscribing" to commands originating from an Echo and sending them to your TV? Although I got the commands to work on my local network, I hit the same wall as a lot of other folks (i.e. - *it doesn't seem to be possible to send requests on my local network directly from an Echo). I have been trying to get an AWS MQTT sample up and running on my Raspberry Pi, but I'm a Linux newb so any references would be great. *Side Note: I still don't understand how the Sony's Android TV Alexa skill can achieve this--is there something special that allows Sony to interact with the user's local network? |
Did anyone managed it to get information about the current opened app? |
Hi! (this is not a issue)
I'm doing a express webapp to use the bravia module provided by you, I'm wondering how you know the syntax for the method calls:
bravia.audio.invoke('setAudioVolume', '1.0', { target: 'speaker', volume: 50 });
Particularly the { target: 'speaker', volume: 50 } part.
Is there any source for this information?
I'm particularly interested in the syntax for the audio getSpeakerSettings method.
I'm planning to publish my app on github when I clean up the code.
Thanks in advance.
The text was updated successfully, but these errors were encountered: