npm.io
1.6.1 • Published 2d ago

iobroker.fakeroku

Licence
MIT
Version
1.6.1
Deps
2
Size
332 kB
Vulns
0
Weekly
0
Stars
9

ioBroker.fakeroku

Release: npm version stable Installations npm downloads

Build: Test and Release Node TypeScript License Sentry

Support: Ko-fi PayPal

Emulates one or more Roku devices on your LAN so that ECP/SSDP remotes — a Logitech Harmony Hub or a Sofabaton X1/X2 — can trigger events in ioBroker. It is the input counterpart to the Logitech Harmony adapter: a button on the remote becomes a datapoint in ioBroker.

Unlike the classic fake-Roku, this build answers the full Roku control surface including /query/device-info with a current Roku version, so it works beyond a classic Harmony hub.

The official Roku mobile app is not supported. It drives Rokus over Roku's proprietary, undocumented ECP-2 WebSocket channel, which this emulator does not implement. Use a Harmony hub or a Sofabaton — those speak the classic ECP this adapter serves.

Features

  • Emulates one or more Roku devices on the LAN — the Roku control protocol (ECP) over HTTP plus SSDP discovery on port 1900.
  • Full Roku control surface including /query/device-info with a current Roku version, beyond what a classic Harmony hub needs.
  • Clean data model per device: a command datapoint plus fixed keys.<Key> states, all created up front.
  • Several emulated Rokus from a single instance; discovery bound to the chosen network interface; command handling restricted to the LAN and capped at 25 commands per second per emulated Roku, so a misbehaving device cannot flood ioBroker.

Sentry / Error reporting

This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers. Reporting only happens if you have enabled error reporting in the ioBroker diagnostics (System settings → Diagnostics and error reporting). Only an anonymous installation ID is transmitted — no name, e-mail address or IP address.

For details and how to disable it, see the Sentry plugin documentation. Error reporting requires js-controller 3.0 or newer.

Requirements

  • Node.js >= 22
  • js-controller >= 7.2.2
  • admin >= 8.0.11

The adapter CANNOT be installed via GitHub: The adapter must be installed via the ioBroker repository (stable or latest).

Ports

  • TCP 8060 (listening, one per emulated Roku, configurable) — the Roku control protocol (ECP): the remote sends its key presses here and reads the actual port from the discovery announcement.
  • UDP 1900 (multicast, listening and outgoing) — SSDP discovery, so a Harmony hub or Sofabaton finds the emulated Rokus; fixed by the UPnP standard.

Configuration

  • Network interface — the network card the emulated Rokus bind to and advertise on. Leave it on "all interfaces" and the adapter runs out of the box — it detects the routable IP automatically. Pick a specific address only on a host with several network cards.
  • Emulated Roku devices — managed as cards: + Add opens a dialog with a name, an ECP port (8060 the real Roku port; a free one is pre-selected, and the dialog refuses a name or port already in use) and a type. You can emulate several Rokus from one instance — each needs its own port.
  • TypePlayer (default) exposes the 16 standard navigation and playback keys; TV additionally exposes volume, power, channel and input keys. Choose TV only if you want those extra keys as ioBroker triggers.

To add the emulated Roku to a Harmony hub, add a "Roku" device in the Harmony app and point it at the ioBroker host.

State Tree

At instance level:

Datapoint Type Meaning
info.connection boolean, read-only true only while every configured Roku is actually listening. If one of them cannot start — usually because its port is already taken — the instance stays disconnected and the log names the device and the port.

For every emulated Roku (fakeroku.0.<name>):

Datapoint Type Meaning
.command string, read-only The last command as plain text (Home, Lit_a, launch:12, search:news). One datapoint for everything — no object-per-character sprawl.
.commandType string, read-only keypress / keydown / keyup / launch / install / input / search.
.keys.<Key> boolean, read-only One state per remote key the device type exposes — a Player has the 16 navigation/playback keys, a TV adds Volume*, Power, Channel*, HDMI/AV inputs — all created up front. A keypress pulses it true for a moment; keydown/keyup hold it.

Free keyboard input (Lit_x) and app launches show up in .command only — they do not get their own objects.

Note: the Roku remote sends the same Play command for play and pause, so play and pause cannot be told apart here — that is a protocol limitation, not an adapter one.

In a script or Blockly rule, react to a key — e.g. when fakeroku.0.<name>.keys.Play becomes true — or watch .command for the last button as text.

Changelog

1.6.1 (2026-09-07)
  • (krobipd) Changed: installing straight from GitHub is no longer offered — the adapter is built before publishing, so it is installed from the ioBroker repository instead.
1.6.0 (2026-09-07)
  • (krobipd) Fixed: saving a device in the admin could change its identity on the network, so a paired Harmony or Sofabaton lost it.
  • (krobipd) Fixed: with the device list open twice, editing or deleting a card could hit a different emulated Roku than the one clicked.
  • (krobipd) Fixed: releasing a key was dropped while the adapter shed a flood of commands, so the key could stay pressed for half a minute.
  • (krobipd) Fixed: an ECP port still held after a restart left that device dead until you restarted the instance; it is retried every minute now.
  • (krobipd) Fixed: stopping the instance now takes the emulated Rokus out of the remote's list instead of leaving them there for up to an hour.
  • (krobipd) Fixed: an emulated Roku whose server died is no longer offered for discovery.
  • (krobipd) Fixed: a configured port no server can bind falls back to 8060 instead of leaving the device unstarted.
  • (krobipd) Changed: the device dialog refuses a reserved or colliding name right away instead of reporting it after saving.
  • (krobipd) Changed: the adapter can now run in compact mode, sharing one process with other adapters instead of claiming its own.
  • (krobipd) Changed: more than one instance may run on the same machine again; only the ports have to differ.
1.5.0 (2026-09-03)
  • (krobipd) Fixed: deleting the last emulated Roku left all of its datapoints behind for good. They are now removed whenever the configuration says a device is gone.
  • (krobipd) Fixed: on a host running Docker the adapter could announce itself under a container address no remote can reach. A real network address is preferred now.
  • (krobipd) Fixed: an emulated Roku whose server died while running left the instance showing "connected". It now reports the failure and names the device.
1.4.0 (2026-09-03)
  • (krobipd) Fixed: renaming an emulated Roku could change its identity on the network, so a paired Harmony or Sofabaton lost the device and had to be set up again.
  • (krobipd) Fixed: a remote key that was pressed when the adapter stopped stayed on for good. All key datapoints are now released at start-up, so the next press works again.
  • (krobipd) Fixed: a device named "info" entered by hand into the configuration replaced the instance's own status channel. The name is refused now and leftovers are removed.
  • (krobipd) Changed: every datapoint now carries a translated name and, where useful, a short description — in all eleven languages, in existing installations as well.
  • (krobipd) Improved: a remote with a globally routable IPv6 address is accepted when it sits in the same network as the ioBroker host, not just on the reserved IPv6 ranges.
  • (krobipd) New: user documentation in English and German, shown in the ioBroker documentation portal.
1.3.0 (2026-09-01)
  • (krobipd) Fixed: a malformed keyboard keypress from a remote (a bad %-escape in the URL) could crash the adapter.
  • (krobipd) Fixed: remotes on an IPv6-only local network were refused; link-local and unique-local IPv6 addresses now count as LAN.
  • (krobipd) Fixed: the adapter icon in the admin is now the same one shown on GitHub.
  • (krobipd) Changed: requires admin >= 8.0.11.
  • (krobipd) Improved: discovery answers only searches from your own network, and the device dialog in the admin keeps working after the device list was edited by hand.
  • (krobipd) Improved: the emulated Roku reports Roku OS 15.0 (was 14.1), and the command-type datapoint lists its possible values so the admin shows them as labels.
  • (krobipd) New: a misbehaving device on your network can no longer flood ioBroker — more than 25 commands per second per emulated Roku are dropped and reported in the log.

Older changelogs can be found there

History

fakeroku has a long lineage on ioBroker, and this version continues it — for existing users it is simply a new version of the same adapter:

  • Pmant created fakeroku in 2017 and built the original Roku emulation: SSDP discovery, the ECP surface and multi-device support.
  • Apollon77 kept the test and build tooling current over the following years.
  • The ioBroker Community Adapters team — notably mcm1957 and foxriver76 — maintained and modernized the adapter from 2023 to 2026, releasing versions up to 0.5.1.
  • From 0.6.0 on, krobi rewrote the adapter from the ground up in TypeScript and added the full ECP surface including device-info.

Support

Support Development

This adapter is free and open source. If you find it useful, consider buying me a coffee:

Ko-fi PayPal

License

The MIT License (MIT)

Copyright (c) 2017-2023 Pmant patrickmo@gmx.de
Copyright (c) 2023-2026 iobroker-community-adapters iobroker-community-adapters@gmx.de
Copyright (c) 2026 krobi krobi@power-dreams.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Developed with assistance from Claude.ai

Keywords