@hyjk2000/homebridge-bravia 0.0.0-stage → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -2
- package/config.schema.json +131 -0
- package/dist/LICENSE +21 -0
- package/dist/index.js +992 -0
- package/dist/index.js.map +1 -0
- package/package.json +81 -3
package/README.md
CHANGED
|
@@ -1,3 +1,94 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Sony BRAVIA for Homebridge
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Expose Sony BRAVIA televisions in Apple Home through `@hyjk2000/homebridge-bravia`. Supports power, volume, mute, input selection, application launching, and remote-control keys through the TV's local Sony APIs.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node.js 24 or later and Homebridge 1.8.0 or later, within the package's declared peer dependency range.
|
|
8
|
+
- A Sony BRAVIA TV with Sony JSON-RPC and IRCC IP control support. Available inputs, applications, and commands depend on the model and firmware; not every BRAVIA model is supported.
|
|
9
|
+
- LAN connectivity from Homebridge to the TV. Enable IP/remote control and network standby (sometimes called Remote Start) in the TV settings. A DHCP reservation is recommended.
|
|
10
|
+
|
|
11
|
+
## Installation and setup
|
|
12
|
+
|
|
13
|
+
1. Search for `@hyjk2000/homebridge-bravia` in the Homebridge UI Plugins tab and install it. Alternatively, install it in your Homebridge environment with `npm install -g @hyjk2000/homebridge-bravia`.
|
|
14
|
+
2. Open the plugin settings and add each TV with a unique name and its IP address or hostname. Enter only the address, not a URL or port; use the separate `port` setting if needed.
|
|
15
|
+
3. Turn the TV on, save the settings, and restart Homebridge or the plugin's child bridge.
|
|
16
|
+
4. Authenticate using one of the methods below.
|
|
17
|
+
5. In Apple Home, choose **Add Accessory → More Options**, select each TV, and enter the pairing code for the Homebridge instance or child bridge running the plugin. TVs are published as separate external accessories by default; pairing Homebridge alone does not add them.
|
|
18
|
+
|
|
19
|
+
### TV authentication
|
|
20
|
+
|
|
21
|
+
**Pre-shared key:** Enable pre-shared-key authentication in the TV's IP control settings, choose a key, and enter the same value in the plugin's `psk` field.
|
|
22
|
+
|
|
23
|
+
**PIN pairing:** Leave `psk` blank. After restarting, open the full local URL printed in the Homebridge logs and enter the PIN displayed on the TV into that page. No terminal input is required. Saved sessions and valid pre-shared keys skip this step.
|
|
24
|
+
|
|
25
|
+
The temporary PIN page listens on an automatically selected free port on the Homebridge host and closes after pairing. Your browser must be able to reach that host and port. If the logged hostname cannot be resolved, replace only the hostname with the Homebridge host's LAN IP, keeping the port and full path. In Docker, host networking lets the browser reach the dynamically allocated pairing port.
|
|
26
|
+
|
|
27
|
+
Use PIN pairing only on a trusted LAN. Do not expose the PIN server to the internet or share its capability URL. TV control and the pairing page use local HTTP, not HTTPS.
|
|
28
|
+
|
|
29
|
+
## Configuration
|
|
30
|
+
|
|
31
|
+
The Homebridge UI provides a settings form. For manual configuration, add this entry to the `platforms` array in Homebridge's `config.json`:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"platform": "BraviaPlatform",
|
|
36
|
+
"name": "BraviaPlatform",
|
|
37
|
+
"tvs": [
|
|
38
|
+
{
|
|
39
|
+
"name": "Living Room TV",
|
|
40
|
+
"ip": "192.168.1.50"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Each `tvs` entry supports these options. All intervals and delays are in milliseconds.
|
|
47
|
+
|
|
48
|
+
| Option | Default | Description |
|
|
49
|
+
| ------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
50
|
+
| `name` | Required | Unique TV display name. |
|
|
51
|
+
| `ip` | Required | Unique TV IP address or hostname, without scheme, port, credentials, or path. |
|
|
52
|
+
| `port` | `80` | TV HTTP port, from 1 to 65535. |
|
|
53
|
+
| `psk` | Unset | TV pre-shared key; omit or leave blank for PIN authentication. |
|
|
54
|
+
| `mac` | Unset | MAC address with colon- or hyphen-separated octets; enables Wake-on-LAN. |
|
|
55
|
+
| `woladdress` | `255.255.255.255` | Wake-on-LAN destination; use a reachable subnet broadcast address if necessary. |
|
|
56
|
+
| `soundoutput` | `speaker` | Sony audio output target for volume control. |
|
|
57
|
+
| `updaterate` | `5000` | Positive status polling interval. |
|
|
58
|
+
| `channelupdaterate` | `30000` | Input/application refresh interval; `0` disables periodic refresh. |
|
|
59
|
+
| `starttimeout` | `5000` | Positive delay for the TV to wake before sending commands. |
|
|
60
|
+
| `sources` | See below | Source categories to expose, as objects such as `{ "source": "extInput:hdmi" }`. |
|
|
61
|
+
| `tvsource` | Unset | Additional Sony source category to discover, including when `sources` is empty. |
|
|
62
|
+
| `applications` | None | App title filters, as objects such as `{ "title": "YouTube" }`; matching is case-sensitive substring matching. |
|
|
63
|
+
| `externalaccessory` | `true` | Publish each TV separately. Set `false` to publish through the bridge instead. |
|
|
64
|
+
| `debug` | `false` | Log TV command and refresh errors at info level; otherwise these use Homebridge debug logging. |
|
|
65
|
+
|
|
66
|
+
When `sources` is omitted, the plugin scans `extInput:hdmi`, `extInput:component`, `extInput:scart`, `extInput:cec`, and `extInput:widi`. Set `sources: []` to disable those categories. Set `applications: []` or omit it to expose no apps. At most 95 inputs and applications are exposed per TV.
|
|
67
|
+
|
|
68
|
+
Input identifiers, HomeKit input names, and visibility are preserved across rescans. Accessory identity uses the configured MAC when present, otherwise the host address. Keep these identity fields stable; adding or changing a MAC, or changing the host without a configured MAC, changes accessory identity.
|
|
69
|
+
|
|
70
|
+
## Troubleshooting
|
|
71
|
+
|
|
72
|
+
- **No PIN or pairing page:** Turn the TV on, check its IP control/authentication settings, and restart the plugin. Use the full URL from the latest logs; its path changes when the plugin restarts. Check firewall and container port access.
|
|
73
|
+
- **TV will not wake:** Enable network standby/Remote Start. Configure `mac` for Wake-on-LAN and check that `woladdress` reaches the TV's network. Increase `starttimeout` if commands arrive before the TV is ready.
|
|
74
|
+
- **TV missing from Apple Home:** Add each external TV separately using the Homebridge or child bridge pairing code. Check that mDNS discovery works between your Apple device and Homebridge.
|
|
75
|
+
- **Missing inputs or apps:** Turn the TV on and check `sources`, `tvsource`, and application title filters. Unsupported Sony source categories are skipped. Discovery depends on the model and firmware.
|
|
76
|
+
- **Connection failures:** Check the TV address, HTTP port, credentials, and LAN reachability. Cached services are restored when the TV is offline; initialization is retried while Homebridge is running.
|
|
77
|
+
|
|
78
|
+
When reporting an issue, include the plugin, Homebridge, and Node.js versions, TV model/firmware, sanitized configuration, and relevant logs. Remove pre-shared keys, cookies, PINs, and pairing URLs before sharing.
|
|
79
|
+
|
|
80
|
+
## Storage
|
|
81
|
+
|
|
82
|
+
Sessions and external-accessory state are stored under `<Homebridge storage>/plugin-persist/hyjk2000-homebridge-bravia/<uuid>.json`, outside the plugin installation. Treat these files and Homebridge backups as credentials. Pre-shared keys remain in your Homebridge configuration.
|
|
83
|
+
|
|
84
|
+
## Development and publishing
|
|
85
|
+
|
|
86
|
+
From the repository root, use Node.js 24 and the pinned pnpm version. Run `pnpm install`, then `pnpm build` before plugin tests. Use `pnpm --filter @hyjk2000/homebridge-bravia test` for plugin tests and `pnpm --filter @hyjk2000/homebridge-bravia dev` to watch and rebuild the plugin.
|
|
87
|
+
|
|
88
|
+
Releases are generated by semantic-release on `master`. The release workflow derives repository, README, and issue URLs from the GitHub repository; local package metadata intentionally does not guess these URLs before an origin is configured.
|
|
89
|
+
|
|
90
|
+
Authoring references: [official plugin template](https://github.com/homebridge/homebridge-plugin-template) and [Homebridge verification requirements](https://github.com/homebridge/plugins/wiki/Verified-Plugins#current-requirements). This plugin is not claimed to be Homebridge Verified. Its Node.js 24 minimum excludes Node.js 22, which is currently required by the verification program.
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pluginAlias": "BraviaPlatform",
|
|
3
|
+
"pluginType": "platform",
|
|
4
|
+
"singular": true,
|
|
5
|
+
"headerDisplay": "Turn the TV on and enable IP/remote control and network standby. For PIN pairing, leave **Pre-shared key** blank, save, and restart Homebridge (or the plugin's child bridge). Click the URL printed in [Homebridge Logs](/logs), then enter the PIN displayed on the TV in that page. Saved sessions and valid pre-shared keys skip PIN pairing.\n\nAdd each TV separately in Apple Home using Homebridge's pairing code.",
|
|
6
|
+
"schema": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": {
|
|
10
|
+
"title": "Platform name",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"default": "BraviaPlatform"
|
|
13
|
+
},
|
|
14
|
+
"tvs": {
|
|
15
|
+
"title": "Televisions",
|
|
16
|
+
"type": "array",
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"required": ["name", "ip"],
|
|
20
|
+
"properties": {
|
|
21
|
+
"name": {
|
|
22
|
+
"title": "TV name",
|
|
23
|
+
"type": "string",
|
|
24
|
+
"minLength": 1,
|
|
25
|
+
"description": "Unique HomeKit display name."
|
|
26
|
+
},
|
|
27
|
+
"ip": {
|
|
28
|
+
"title": "IP address or hostname",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"minLength": 1,
|
|
31
|
+
"description": "TV address only, without http://, credentials, port, or path."
|
|
32
|
+
},
|
|
33
|
+
"port": {
|
|
34
|
+
"title": "TV HTTP port",
|
|
35
|
+
"default": 80,
|
|
36
|
+
"oneOf": [
|
|
37
|
+
{ "type": "integer", "minimum": 1, "maximum": 65535 },
|
|
38
|
+
{ "type": "string", "pattern": "^[0-9]+$" }
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"mac": {
|
|
42
|
+
"title": "MAC address",
|
|
43
|
+
"type": "string",
|
|
44
|
+
"pattern": "^(?:[0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$|^(?:[0-9a-fA-F]{2}-){5}[0-9a-fA-F]{2}$",
|
|
45
|
+
"description": "Required for Wake-on-LAN when network standby does not wake the TV."
|
|
46
|
+
},
|
|
47
|
+
"woladdress": {
|
|
48
|
+
"title": "Wake-on-LAN destination",
|
|
49
|
+
"type": "string",
|
|
50
|
+
"default": "255.255.255.255",
|
|
51
|
+
"description": "Broadcast IP address or hostname reachable from Homebridge."
|
|
52
|
+
},
|
|
53
|
+
"tvsource": {
|
|
54
|
+
"title": "Preferred TV source",
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "Optional additional Sony source category to discover."
|
|
57
|
+
},
|
|
58
|
+
"soundoutput": {
|
|
59
|
+
"title": "Audio output",
|
|
60
|
+
"type": "string",
|
|
61
|
+
"default": "speaker",
|
|
62
|
+
"description": "Sony audio output target used for volume control."
|
|
63
|
+
},
|
|
64
|
+
"updaterate": {
|
|
65
|
+
"title": "Status polling interval",
|
|
66
|
+
"type": "number",
|
|
67
|
+
"exclusiveMinimum": 0,
|
|
68
|
+
"default": 5000,
|
|
69
|
+
"description": "Milliseconds between status updates; must be positive."
|
|
70
|
+
},
|
|
71
|
+
"channelupdaterate": {
|
|
72
|
+
"title": "Channel refresh interval",
|
|
73
|
+
"type": "number",
|
|
74
|
+
"minimum": 0,
|
|
75
|
+
"default": 30000,
|
|
76
|
+
"description": "Milliseconds between channel list updates; 0 disables channel polling."
|
|
77
|
+
},
|
|
78
|
+
"starttimeout": {
|
|
79
|
+
"title": "Startup timeout",
|
|
80
|
+
"type": "number",
|
|
81
|
+
"exclusiveMinimum": 0,
|
|
82
|
+
"default": 5000,
|
|
83
|
+
"description": "Positive delay in milliseconds for the television to wake."
|
|
84
|
+
},
|
|
85
|
+
"psk": {
|
|
86
|
+
"title": "Pre-shared key",
|
|
87
|
+
"type": "string",
|
|
88
|
+
"format": "password",
|
|
89
|
+
"description": "Optional key matching the TV's IP control settings. Leave blank for PIN pairing."
|
|
90
|
+
},
|
|
91
|
+
"externalaccessory": {
|
|
92
|
+
"title": "Publish as external television",
|
|
93
|
+
"type": "boolean",
|
|
94
|
+
"default": true,
|
|
95
|
+
"description": "Recommended: pair each TV separately in the Home app. Set false to publish through the bridge instead."
|
|
96
|
+
},
|
|
97
|
+
"debug": { "title": "Debug logging", "type": "boolean", "default": false },
|
|
98
|
+
"sources": {
|
|
99
|
+
"title": "Input sources",
|
|
100
|
+
"type": "array",
|
|
101
|
+
"minItems": 0,
|
|
102
|
+
"items": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"required": ["source"],
|
|
105
|
+
"properties": {
|
|
106
|
+
"source": { "title": "Source category", "type": "string", "minLength": 1 }
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"x-schema-form": { "listItems": 0, "removable": true },
|
|
110
|
+
"description": "Sony source categories, such as extInput:hdmi. Add or delete entries to choose which inputs to expose; an empty list exposes no physical inputs. At most 95 inputs and applications are exposed."
|
|
111
|
+
},
|
|
112
|
+
"applications": {
|
|
113
|
+
"title": "Applications",
|
|
114
|
+
"type": "array",
|
|
115
|
+
"minItems": 0,
|
|
116
|
+
"items": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"required": ["title"],
|
|
119
|
+
"properties": {
|
|
120
|
+
"title": { "title": "App title filter", "type": "string", "minLength": 1 }
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"x-schema-form": { "listItems": 0, "removable": true },
|
|
124
|
+
"description": "Add app titles or title substrings to expose matching installed TV apps as inputs. Delete entries to remove them; an empty list exposes no apps."
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
package/dist/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 James Shi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|