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
Maintainers
Readme
homebridge-bravia-enhanced
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
+/plusvariants - 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+getMethodTypesand 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) whereactRegisterv1.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
enableChannelSelectorflag now only controls whether the Channel Selector UI page is exposed. - Comprehensive debug output (v1.4.0+) — set
debug: trueper 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-enhancedOr clone this repo and run npm install locally.
Setup steps
- Configure the plugin in
config.jsonor via the Homebridge UI (see below) - Turn on the TV
- Set Remote start to ON: TV Settings → Network → Remote Start (optional but recommended)
- Restart Homebridge
- The TV will display a PIN
- Enter the PIN at
http://homebridge.local:8999(replace with your Homebridge server address/IP) - 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=TV55If 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:
- In HomeKit, press + → Add Device
- 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 testSupport
If you find this plugin useful, consider buying me a coffee ☕
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.
