npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

homebridge-bravia-enhanced

v1.4.7

Published

Enhanced Homebridge plugin for Sony Bravia TVs — channel selector UI, per-TV debug, full-scan cache, app title matching and more

Readme

homebridge-bravia-enhanced

npm downloads license homebridge verified PayPal

Enhanced fork of homebridge-bravia by Normen Hansen.
Maintained by diegoweb100

HomeBridge plugin for Sony Bravia TVs (AndroidTV based ones and possibly others).


What's new in this fork

  • Web-based Channel Selector UI — browse, search and save your favourite channels directly from the browser, no config file editing required
  • Full-scan cache — all channels are always visible in the UI even when HomeKit shows only a subset
  • User selection persistence — your channel selection survives Homebridge restarts
  • HomeKit 98-input limit — automatically enforced (100 services − TV − Speaker = 98 max inputs), configurable via maxInputSources
  • Improved app title matching — fuzzy normalisation prevents duplicates and handles +/plus variants
  • New pairing page — clean PIN entry UI with live pairing status
  • HDMI input status polling — auto-detects connected/disconnected HDMI inputs with automatic API version fallback (v1.1 → v1.0)
  • Verbose structured logging — easier troubleshooting with prefixed log lines
  • Volume accessory — optional Lightbulb accessory to control TV volume and mute directly from HomeKit
  • Full API version auto-detection (v1.3.0+) — at boot the plugin probes every Sony endpoint via getVersions + getMethodTypes and uses the actual versions supported by your specific TV for every API call. This fixes pairing on newer Bravia XR models (e.g. K-55XR8M2) where actRegister v1.0 is no longer accepted.
  • Web server always active (v1.3.0+) — the web server is required for pairing and is now started unconditionally. The enableChannelSelector flag now only controls whether the Channel Selector UI page is exposed.
  • Comprehensive debug output (v1.4.0+) — set debug: true per TV in the config and the plugin will produce a complete, self-contained diagnostic dump on startup: environment hints (Docker / Synology / RPi auto-detection), sanitised config, storage paths with file sizes, full capabilities table, every HTTP request/response with body and latency, detailed pairing trace, WOL trace, and global handlers for uncaught exceptions. Sensitive values (PSK, PIN, cookies, MAC) are masked.

Supported functions

  • Turning TV on/off
  • Setting volume / mute
  • Selecting inputs / channels
  • Starting apps
  • Trigger automation when turning the TV on/off
  • iOS 12.2 remote support
  • Secure connection to TV without PSK

This plugin requires iOS 12.2+.


Installation

npm install -g homebridge-bravia-enhanced

Or clone this repo and run npm install locally.

Setup steps

  1. Configure the plugin in config.json or via the Homebridge UI (see below)
  2. Turn on the TV
  3. Set Remote start to ON: TV Settings → Network → Remote Start (optional but recommended)
  4. Restart Homebridge
  5. The TV will display a PIN
  6. Enter the PIN at http://homebridge.local:8999 (replace with your Homebridge server address/IP)
  7. Your TV will appear in HomeKit once all channels have been scanned

Channel Selector UI

After pairing, open http://homebridge.local:8999 (or the configured serverPort) to access the Channel Selector. You can:

  • Browse all channels, HDMI inputs and apps
  • Use the search box or type filter to find channels
  • Click channels to select/deselect them
  • Use Select All, Clear All, HD Channels Only or Top 20 shortcuts
  • Click Save Selection to push the selection to HomeKit immediately

Re-pairing / Force re-pairing

If the TV stops responding or you want to manually reset the pairing, open the pairing page:

http://homebridge.local:8980/pair?tv=TV55

If already paired, a 🗑️ Delete cookie & force re-pairing button will appear. Click it to delete the stored session cookie and trigger a new PIN request on the TV.

External accessory mode

If you use externalaccessory: true, after Homebridge restart:

  1. In HomeKit, press +Add Device
  2. Select I have no code, then enter the Homebridge setup code to add the TV

config.json example

"platforms": [
  {
    "platform": "BraviaPlatform",
    "tvs": [
      {
        "name": "TV",
        "ip": "192.168.1.10",
        "soundoutput": "speaker",
        "tvsource": "tv:dvbs",
        "applications": [{"title": "Netflix"}],
        "sources": ["extInput:hdmi"],
        "maxInputSources": 50
      }
    ]
  }
]

Options

Required

| Option | Description | |---|---| | tvs | Array of Sony TV configurations | | name | Name of the TV as shown in HomeKit | | ip | IP address or hostname of the TV |

Optional (per TV entry)

| Option | Default | Description | |---|---|---| | sources | ["extInput:hdmi", "extInput:component", "extInput:scart", "extInput:cec", "extInput:widi"] | Input sources to show in HomeKit | | tvsource | — | TV tuner source: tv:dvbt, tv:dvbc or tv:dvbs | | applications | — | Array of {title} objects to include apps in the input list | | soundoutput | speaker | speaker or headphone | | port | 80 | HTTP port of the TV | | serverPort | 8999 | Port for the PIN entry / channel selector web server | | channelSelectorPort | same as serverPort | Override port for the channel selector UI | | enableChannelSelector | true | Controls only the Channel Selector UI page. The web server (needed for pairing) is always active, regardless of this option. | | maxInputSources | 98 | Max inputs to register in HomeKit (hard cap: 98) | | externalaccessory | false | Publish TV as external accessory (needed for multiple TVs in Remote app) | | hideDisconnectedInputs | false | Automatically hide HDMI inputs that are physically disconnected | | mac | — | MAC address for Wake-on-LAN (only set if needed) | | woladdress | 255.255.255.255 | Subnet broadcast address for WOL | | updaterate | 5000 | Interval (ms) for TV power status polling | | channelupdaterate | 30000 | Interval (ms) for channel/input list refresh | | volumeAccessory | false | Publish a separate Lightbulb accessory to control volume (brightness) and mute (on/off) from HomeKit | | debug | false | Enable verbose debug logging for this TV |


Usage

ON/OFF

Control your TV through Siri or the Home app.

Inputs, Channels and Applications

All channels, inputs and apps appear in the HomeKit input selector. Use the Channel Selector web UI to curate the list.

TV Remote

The plugin registers a TV remote in HomeKit — use basic function keys and set volume via the Apple Remote app. Your phone's volume buttons control TV volume.

TV Speaker

The TV speaker is also exposed as a HomeKit accessory (not shown in the Home app, but visible in some third-party apps).


Development

git clone https://github.com/diegoweb100/homebridge-bravia-enhanced.git
cd homebridge-bravia-enhanced
npm install
mkdir .homebridge
# add config.json to .homebridge
npm run test

Support

If you find this plugin useful, consider buying me a coffee ☕

PayPal


Reporting issues

If something does not work as expected, please open an issue on GitHub and enable debug: true in the plugin config for the affected TV, then attach the Homebridge log starting from the plugin's "ENVIRONMENT" banner. The debug output is designed to be self-contained: it includes the plugin version, the Node/OS environment, the (sanitised) config, the full TV capabilities table, every HTTP exchange and the pairing handshake. With that information it is usually possible to diagnose the issue without further round trips.

Sensitive values (PSK, PIN, cookies, MAC address) are automatically masked in debug output, so the log can be shared safely.


Credits

Based on homebridge-bravia by Normen Hansen, which was itself inspired by "lombi"'s original Sony Bravia plugin.

Enhanced and maintained by diegoweb100.