
neeo_driver_sony_bravia does not start
https://github.com/trouty00/neeo_driver_sony_bravia
After installing the driver and changing the settings I cant start the driver.
$ node index.js
/home/nelus/node_modules/neeo_driver_sony_bravia/index.js:135
brain:,
^
I have tried multiple settings in index.js
-
Yeah tried that.
I looks like it is going a little bit further:
$ sudo node index.js
NEEO SDK Example "simpleCustomDevice" adapter
---------------------------------------------
/home/nelus/node_modules/neeo_driver_sony_bravia/node_modules/neeo-sdk/lib/device/devicetype/index.js:17
throw new Error('INVALID_DEVICETYPE');
^
Error: INVALID_DEVICETYPE
-
Fäbu (or anyone else that is able to assist please),
I appreciate this thread is quite old, but I would really appreciate some help please.
Using this driver: https://github.com/trouty00/neeo_driver_sony_bravia and following the instructions in the thread above, I've managed to get this driver working successfully for my Sony Bravia (KDL60W850B) except for one issue. The PowerOn command does not turn the TV on when the TV is in standby mode.
I know this is because the TV can't receive IRCC-IP commands when it is in standby mode because it's HTTP server is not running.
According to https://pro-bravia.sony.net/develop/integrate/ip-control/ I need to send a WoL magic packet several times to enable IRCC-IP when the TV is in standby mode.
Could you tell me what code I need to put and where - so that I can get this driver to send the WoL magic packet when the PowerOn button is pressed please?
Thank you kindly for your time & assistance.
Regards,
AndrewHere is the code I'm using for this driver;
package.json
{ "name": "neeo_driver_sony_bravia", "version": "0.0.4", "description": "This app brings NEEO and Sony Bravia Android TV's together", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "neeo", "bravia", "androidtv" ], "author": "Stuart Trout", "license": "ISC", "repository": { "type": "git", "url": "git+https://github.com/trouty00/neeo_driver_sony_bravia.git" }, "bugs": { "url": "https://github.com/trouty00/neeo_driver_sony_bravia/issues" }, "homepage": "https://github.com/trouty00/neeo_driver_sony_bravia#readme", "dependencies": { "neeo-sdk": "^0.51.13", "sony-bravia-tv-remote": "^2.0.0" }, "engines": { "node": ">=6.0.0" }, "neeoSdkOptions": { "brainHost": "192.168.1.121" } }
index.js
'use strict'; const neeoapi = require('neeo-sdk'); const controller = require('./controller'); console.log('NEEO SDK Example "simpleCustomDevice" adapter'); console.log('---------------------------------------------'); const braviatv = neeoapi.buildDevice('Bravia TV') .setManufacturer('Sony') .addAdditionalSearchToken('foo') .setType('TV') .addButton({ name: 'POWER ON', label: 'Power On' }, controller.button) .addButton({ name: 'POWER OFF', label: 'Power Off' }, controller.button) .addButton({ name: 'CURSOR LEFT', label: 'Left' }, controller.button) .addButton({ name: 'CURSOR RIGHT', label: 'Right' }, controller.button) .addButton({ name: 'CURSOR UP', label: 'Up'} , controller.button) .addButton({ name: 'CURSOR DOWN', label: 'Down' }, controller.button) .addButton({ name: 'INPUT HDMI 1', label: 'HDMI 1' }, controller.button) .addButton({ name: 'INPUT HDMI 2', label: 'HDMI 2' }, controller.button) .addButton({ name: 'INPUT HDMI 3', label: 'HDMI 3' }, controller.button) .addButton({ name: 'INPUT HDMI 4', label: 'HDMI 4' }, controller.button) .addButton({ name: 'HOME', label: 'Home' }, controller.button) .addButton({ name: 'MUTE TOGGLE', label: 'Mute' }, controller.button) .addButton({ name: 'VOLUME UP', label: 'Volume Up' }, controller.button) .addButton({ name: 'VOLUME DOWN', label: 'Volume Down' }, controller.button) .addButton({ name: 'BACK', label: 'Back' }, controller.button) .addButton({ name: 'STOP', label: 'Stop' }, controller.button) .addButton({ name: 'CURSOR ENTER', label: 'Enter' }, controller.button) .addButton({ name: 'PLAY', label: 'Play' }, controller.button) .addButton({ name: 'PAUSE', label: 'Pause' }, controller.button) .addButton({ name: 'RECORD', label: 'Rec' }, controller.button) .addButton({ name: 'SKIP BACKWARD', label: 'Skip Backward' }, controller.button) .addButton({ name: 'SKIP FORWARD', label: 'Skip Forward' }, controller.button) .addButton({ name: 'FORWARD', label: 'Forward' }, controller.button) .addButton({ name: 'REVERSE', label: 'Reverse' }, controller.button) //.addButton({ name: 'PREVIOUS', label: 'Previous' }, controller.button) .addButton({ name: 'MENU', label: 'Menu' }, controller.button) .addButton({ name: 'CHANNEL UP', label: 'Channel Up' }, controller.button) .addButton({ name: 'CHANNEL DOWN', label: 'Channel Down' }, controller.button) .addButton({ name: 'FUNCTION RED', label: 'Red' }, controller.button) .addButton({ name: 'FUNCTION GREEN', label: 'Green' }, controller.button) .addButton({ name: 'FUNCTION YELLOW', label: 'Yellow' }, controller.button) .addButton({ name: 'FUNCTION BLUE', label: 'Blue' }, controller.button) .addButton({ name: 'DIGIT 0', label: '0' }, controller.button) .addButton({ name: 'DIGIT 1', label: '2' }, controller.button) .addButton({ name: 'DIGIT 2', label: '3' }, controller.button) .addButton({ name: 'DIGIT 3', label: '4' }, controller.button) .addButton({ name: 'DIGIT 4', label: '5' }, controller.button) .addButton({ name: 'DIGIT 5', label: '5' }, controller.button) .addButton({ name: 'DIGIT 6', label: '6' }, controller.button) .addButton({ name: 'DIGIT 7', label: '7' }, controller.button) .addButton({ name: 'DIGIT 8', label: '8' }, controller.button) .addButton({ name: 'DIGIT 9', label: '9' }, controller.button) .addButton({ name: 'INPUT TV', label: 'TV' }, controller.button) .addButton({ name: 'RADIO', label: 'RADIO' }, controller.button) .addButton({ name: 'GUIDE', label: 'Guide' }, controller.button) .addButton({ name: 'INPUT', label: 'Input' }, controller.button) .addButton({ name: 'NETFLIX', label: 'Netflix' }, controller.button) .addButtonHander(controller.braviaButtonPressed); function startSdkExample(brain) { console.log('- Start server'); neeoapi.startServer({ brain, port: 6336, name: 'simple-adapter-one', devices: [braviatv] //if you have more than one device they are defined as per below //devices: [braviatv, braviatv2] }) .then(() => { console.log('# READY! use the NEEO app to search for "Sony Bravia".'); }) .catch((error) => { //if there was any error, print message out to console console.error('ERROR!', error.message); process.exit(1); }); } const brainIp = process.env.BRAINIP; if (brainIp) { console.log('- use NEEO Brain IP from env variable', brainIp); startSdkExample(brainIp); } else { console.log('- discover one NEEO Brain...'); neeoapi.discoverOneBrain() .then((brain) => { console.log('- Brain discovered:', brain.name); startSdkExample(brain); }); }
controller.js
//TV PLUGIN 'use strict'; /* * Device Controller * Events on that device from the Brain will be forwarded here for handling. * NOTE: there are no multiple devices support for this example, so only the button name is passed */ // As ES6 Import // import BraviaRemoteControl from 'sony-bravia-tv-remote'; // Connect to a local sony tv at 192.168.1.118:80 with the auth key of 1111 const BraviaRemoteControl = require('sony-bravia-tv-remote'); const braviaIP = '192.168.1.118'; const braviaPort = 80; const braviaCode = '1111'; const remote = new BraviaRemoteControl(braviaIP, braviaPort, braviaCode); function tvbuttonMappings() { return [ {neeo: 'POWER OFF', bravia: 'PowerOff'}, {neeo: 'CURSOR LEFT', bravia: 'Left'}, {neeo: 'POWER ON', bravia: 'PowerOn'}, {neeo: 'CURSOR RIGHT', bravia: 'Right'}, {neeo: 'CURSOR DOWN', bravia: 'Down'}, {neeo: 'CURSOR UP', bravia: 'Up'}, {neeo: 'INPUT HDMI 1', bravia: 'Hdmi1'}, {neeo: 'INPUT HDMI 2', bravia: 'Hdmi2'}, {neeo: 'INPUT HDMI 3', bravia: 'Hdmi3'}, {neeo: 'INPUT HDMI 4', bravia: 'Hdmi4'}, {neeo: 'HOME', bravia: 'Home'}, {neeo: 'MUTE TOGGLE', bravia: 'Mute'}, {neeo: 'VOLUME UP', bravia: 'VolumeUp'}, {neeo: 'VOLUME DOWN', bravia: 'VolumeDown'}, {neeo: 'BACK', bravia: 'Return'}, {neeo: 'STOP', bravia: 'Stop'}, {neeo: 'CURSOR ENTER', bravia: 'Enter'}, {neeo: 'PLAY', bravia: 'Play'}, {neeo: 'PAUSE', bravia: 'Pause'}, {neeo: 'RECORD', bravia: 'Rec'}, {neeo: 'SKIP BACKWARD', bravia: 'Previous'}, {neeo: 'SKIP FORWARD', bravia: 'Next'}, {neeo: 'FORWARD', bravia: 'Forward'}, {neeo: 'REVERSE', bravia: 'Rewind'}, {neeo: 'MENU', bravia: 'Home'}, {neeo: 'CHANNEL UP', bravia: 'ChannelUp'}, {neeo: 'CHANNEL DOWN', bravia: 'ChannelDown'}, {neeo: 'FUNCTION RED', bravia: 'Red'}, {neeo: 'FUNCTION GREEN', bravia: 'Green'}, {neeo: 'FUNCTION YELLOW', bravia: 'Yellow'}, {neeo: 'CHANNEL BLUE', bravia: 'Blue'}, {neeo: 'INPUT TV', bravia: 'Tv'}, {neeo: 'DIGIT 1', bravia: 'Num1'}, {neeo: 'DIGIT 2', bravia: 'Num2'}, {neeo: 'DIGIT 3', bravia: 'Num3'}, {neeo: 'DIGIT 4', bravia: 'Num4'}, {neeo: 'DIGIT 5', bravia: 'Num5'}, {neeo: 'DIGIT 6', bravia: 'Num6'}, {neeo: 'DIGIT 7', bravia: 'Num7'}, {neeo: 'DIGIT 8', bravia: 'Num8'}, {neeo: 'DIGIT 9', bravia: 'Num9'}, {neeo: 'DIGIT 0', bravia: 'Num0'}, {neeo: 'INPUT TV', bravia: 'Tv'}, {neeo: 'RADIO', bravia: 'Tv_Radio'}, {neeo: 'GUIDE', bravia: 'GGuide'}, {neeo: 'INPUT', bravia: 'Input'}, {neeo: 'NETFLIX', bravia: 'Netflix'}, // Add the rest. ]; } module.exports.braviaButtonPressed = function braviaButtonPressed(name, deviceid) { const keyMap = tvbuttonMappings().find((key) => key.neeo === name); remote.sendAction(keyMap.bravia); console.log('Key, NEEO:'+keyMap.neeo+' Bravia:'+keyMap.bravia); }
-
Instructions attached for getting IP Control to work with my Sony Bravia (KDL60W850B) and adding WOL capability to the driver so that the PowerOn command will actually turn on the TV from standby.
NB: Updated instructions with a final step that includes running the driver from within a Docker container.