deviceid always "default" in button handler

Is there any way to get a device specific deviceid in the registered button handler?

.addButtonHandler((name, deviceid) => {
   console.log('[NEEO] ButtonPressed "%s" on %s', name, deviceid);
Even with multiple devices it's always "default". How can I provide or get a unique id? Or this a bug? I would like to use the same button handler for multiple devices because they call the same service, but I need to know which device triggered it.

Of course I could register individual handlers, but deviceid would be a very simple way handling it...

10replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Are you using device discovery? The deviceid refers to the id returned by your discovery function

    • No, just a simple neeoapi.startServer call with multiple devices. I don't see why I need a discovery function, but if that's the only way I'll give it a try...

    • Markus Zehnder From what I've done so far I don't think NEEO sends the device name through with the request unless you have device discovery :( Would be happy to be proven wrong however

    • Markus Zehnder Hi, had a look at your LIRC project and I second Jake Blatchford here.

      I think in stead of creating an array of neeodevice objects you should create one device in your index.js and use the .enableDiscovery to pass the list of remotes the LIRC is managing; When doing so, you will be responsible to provide the unique devideID which will then be populated as you expect it to be.

      This way, when adding a device in Neeo's App, you will get the list of available remotes and select the one you want to add.

      The driver acts as a gateway to LIRC which acts as a gateway to the devices it manages so should be only 1 instance ...

      Hope this helps.

  • Hi, how do you register / declare these multiple devices ?

  • Markus Zehnder  Did you solved this? If yes, how? Because I have the same problem. Do already provide the devices as an array.

  • Has this been solved? I'm running into a similar problem.


    I've built a Roku IP driver and I would like to target the driver to multiple roku's but the onbuttonpressed action only returns default for the deviceid.

    • Rodney Betts 

      Can you share your code? I would like to have a look at it.

    • Paul Spee yeah it's pretty much the same as the first comment. The deviceId variable in console.log is returning "default". If I could get something unique I would be golden. 

      onButtonPressed(name, deviceId) {
         * Since we added 4 button groups in index:
         * Volume, Numpad, Menu and Back, Controlpad
         * We need to handle all of the buttons these groups define here:
         * - DIGIT 0 though DIGIT 9
         * - CURSOR ENTER
         * - CURSOR UP
         * - CURSOR DOWN
         * - CURSOR LEFT
         * - CURSOR RIGHT
         * - MENU
         * - BACK
         * - VOLUME UP
         * - VOLUME DOWN
         * - optionally MUTE TOGGLE
         * See for more details
         * on button groups.
        console.log('first test: ' + deviceId);
        console.log(`[CONTROLLER] ${name} button pressed for device ${deviceId}`);




      Separately, is there anyway I can specify an ip address when setting up the device within the app? I keep seeing references to discovery but I would like to manually specify since I have several Roku's/Roku TV's.

Like1 Follow