5.0.8 • Published 3 years ago

homebridge-bravia-tvos v5.0.8

Weekly downloads
88
License
MIT
Repository
github
Last release
3 years ago

homebridge-bravia-tvos v5

npm npm GitHub last commit verified-by-homebridge Discord Donate

Creating and maintaining Homebridge plugins consume a lot of time and effort, if you would like to share your appreciation, feel free to "Star" or donate.

Click here to review more of my plugins.

Info

This is a plugin for Homebridge to control your Sony Bravia Android TV.

This plugin supports following functions:

  • Power Switch
  • Inputs: like HDMI, Scart, CEC Devices, AV, WIFI etc.
  • Apps: like YouTube, Prime Video etc.
  • Channels: Your favourite channels as inputs.
  • Commands: IRCC commands s inputs.
  • Macros: A set of IRCC commands as one input
  • Remote control: native iOS Remote control with customizable commands
  • Authentication: with Pre-Shared Key or PIN
  • WOL: supports Wake on Lan
  • Speaker: with support for two types of speaker (switch or lightbulb)
  • Config UI X Custom UI

Installation instructions

After Homebridge has been installed:

sudo npm i -g homebridge-bravia-tvos@latest

Preparing the TV

TV Settings

  • Set Remote start to ON (Settings -> Network -> Remote Start)
  • Change Authentication to Normal and Pre-Shared Key (Settings -> Network -> IP Control -> Authentication)

If you want to use authentication with a Pre-Shared key, please do following steps:

  • Enter a Pre-Shared Key (Settings -> Network -> IP control -> Pre-Shared Key)

Configuration (Config UI X)

Bravia TV OS v5 supports a custom user interface making configuration via homebridge-config-ui-x even easier! Below you can see how easy it is to create, edit or delete a new TV for the config.json using the custom user interface. To use the custom user interface you need at least homebridge-config-ui-x v4.34.0!

https://user-images.githubusercontent.com/34152761/124396673-4b249700-dd0b-11eb-8deb-b7ab18c429e7.mov

Configuration (Manually)

If you cannot use the custom user interface or want to edit the config.json manually, you must first decide which authentication to use.

a) PIN Authentication (prefered)

To use the PIN authentication you must first install the bravia module:

sudo npm i -g @seydx/bravia@beta

And to be able to use the plugin with the PIN procedure your credentials must be created first.

You can create the credentials as follows:

bravia pair <host> -p 80 -n MyTV

  • \<host>: The address of your Bravia TV (eg 192.168.178.99)
  • -n: Name for the app (Default "@seydx/bravia")
  • -p: The port of your Bravia TV (Default: 80)

The PIN displayed on the TV must then be entered in the terminal. This will generate a credentials <Object> like this:

{
  name: 'MyTV',
  uuid: 'e9812807-d394-407c-b657-c89a98804e65',
  token: 'A0B9B9D7580466F22EE8F8EA148863774ACCE203',
  expires: 'Fr., 26 Apr. 2009 21:42:48 GMT+00:00'
}

Once that is done, you just need to add the "name" to your config.json under "appName". (E.g.: "appName": "MyTV")

Example:

{
  ...
  "active": true,
  "name": "Sony TV",
  "ip": "192.168.178.123",
  "port": 80,
  "appName": "MyTV",
  ...
}

b) PSK Authentication

  • Enter a Pre-Shared Key (Settings -> Network -> IP control -> Pre-Shared Key)

You need to put the PSK entered in your tv also in your config.json.

Example:

{
  "name": "Sony TV",
  "ip": "192.168.178.123",
  "psk": "MYPSK"
  ...
}

Example BASIC config

{
"bridge": {
  ...
},
"accessories": [
  ...
],
"platforms": [
   {
     "platform": "BraviaOSPlatform"
     "name": "BraviaTVOS",
     "debug": true,
     "tvs": [
       {
         "name": "Sony TV",
         "ip": "192.168.178.123",
         "psk": "0000",
         "inputs": [
            {
             "name": "Apple TV",
             "identifier": "Wohnzimmer",
             "source": "cec"
           }
         ],
         "apps": [
           {
             "name": "You Tube",
             "identifier": "YouTube"
           }
         ],
         "channels": [
           {
             "name": "Planet HD",
             "channel": 97,
             "source": "dvbt"
           }
         ],
         "commands": [
           {
             "name": "Volume Up",
             "value": "AAAAAQAAAAEAAABgAw=="
           }
         ],
         "speaker": {
           "active": true,
           "output": "speaker",
           "increaseBy": 1,
           "reduceBy": 1,
           "accType": "lightbulb"
         },
       }
     ]
   }
]
}

See Example Config for a FULL config example.

Options General

AttributesRequiredUsageDefaultOptions
nameXName for the log.BraviaTVOS
debugEnables additional output (debug) in the log.falsetrue, false
warnEnables additional output (warn) in the log.truetrue, false
errorEnables additional output (error) in the log.truetrue, false
extendedErrorEnables additional output (detailed error) in the log.truetrue, false

Options TV

AttributesRequiredUsageDefaultOptions
activeXIf enabled, the device will be exposed to HomeKitfalsetrue, false
ipXSony TV IP Address.
macSony TV MAC Address.
portSony TV Port.80
pskXEither psk OR appName/appUUID must be setted. (see preparing the TV above)
appNameXEither psk OR appName must be setted. (see preparing the TV above)
manufacturerManufacturer name for display in the Home app. Sony
modelModel name for display in the Home app.Bravia
serialNumberSerialnumber for display in the Home app.00000000
refreshInputsWhen this option is enabled, the TV updates all inputs and saves them to disk for further use. (Please turn on the TV before restarting homebridge with this option enabled, otherwise the plugin will turn on the TV to also retrieve CEC inputs)falsetrue, false
wolWhen this option is enabled, the plugin uses WOL instead of API to turn on the TV. (WOL must be enabled on the TV and a MAC address must be specified)falsetrue, false
pollingPolling interval in seconds.10 (s)
sheduledRefreshSheduled television (inputs) cache refresh in hours.12 (h)

Options TV Inputs

AttributesRequiredUsageDefaultOptions
inputs.nameXName for the channel to display in the tv inputs list
inputs.identifierXExact name of the input (eg HDMI 1)
inputs.sourceXType of the tv inputcec, component, composite, hdmi, scart, widi

Options TV Apps

AttributesRequiredUsageDefaultOptions
apps.nameXName for the application to display in the tv inputs list
apps.identifierXExact name of the Application

Options TV Channels

AttributesRequiredUsageDefaultOptions
channels.nameXName for the channel to display in the tv inputs list
channels.channelXNumber of the channel as seen on the TV.
channels.sourceXSource of the channel.dvbt, dvbc, dvbs, isdbt, isdbc, atsct, isdbs, analog

Options TV Commands

AttributesRequiredUsageDefaultOptions
commands.nameXName for the command to display in the tv inputs list
commands.valueXIRCC code or name of the command to display in Apple Home. (eg. "AAAAAQAAAAEAAABgAw==" or "PowerOff")

Options TV Macros

AttributesRequiredUsageDefaultOptions
macros.nameXName for the macro to display in the tv inputs list
macros.delayDelay between sending commands (in ms). (Default 1000ms)
macros.commandsXAn array of IRCC codes/names to perform the macro

Options TV Speaker

AttributesRequiredUsageDefaultOptions
speaker.activeXIf enabled, the device will be exposed to HomeKit (as service within the TV accessory)false true, false
speaker.outputAudio output.speakerspeaker, headphone, other
speaker.increaseByVolume level to increse. (for Apple Remote)1
speaker.reduceByVolume level to reduce. (for Apple Remote)1
speaker.accTypeAccessory type for the speaker.lightbulbswitch, lightbulb

Options TV Remote

AttributesRequiredUsageDefaultOptions
remote.commandXIRCC command/name for choosen target
remote.targetXApple remote target.ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, BACK, EXIT, FAST_FORWARD, INFORMATION, NEXT_TRACK, PAUSE, PLAY, PREVIOUS_TRACK, REWIND, SELECT, SETTINGS, STOP, VOLUME_DOWN, VOLUME_UP

Options TV Display Order

AttributesRequiredUsageDefaultOptions
displayOrderArray of catagories to sort inputs["apps", "channels", "commands", "inputs", "macros"]apps, channels, commands, inputs, macros

Supported clients

This plugin has been verified to work with the following apps on iOS 14:

  • iOS 14
  • Apple Home
  • Homebridge v1.3.0+

Contributing

You can contribute to this homebridge plugin in following ways:

Pull requests are accepted.

Troubleshooting

If you have any issues with the plugin or TV services then you can run homebridge in debug mode, which will provide some additional information. This might be useful for debugging issues. Just enable "debug" in your config and restart homebridge.

Disclaimer

All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.

5.0.8-beta.4

3 years ago

5.0.8

3 years ago

5.0.8-beta.2

3 years ago

5.0.8-beta.3

3 years ago

5.0.8-beta.0

3 years ago

5.0.8-beta.1

3 years ago

5.0.7

3 years ago

5.0.7-beta.3

3 years ago

5.0.7-beta.1

3 years ago

5.0.7-beta.2

3 years ago

5.0.7-beta.0

3 years ago

5.0.6-beta.7

3 years ago

5.0.6

3 years ago

5.0.6-beta.6

3 years ago

5.0.6-beta.5

3 years ago

5.0.6-beta.4

3 years ago

5.0.6-beta.3

3 years ago

5.0.6-beta.2

3 years ago

5.0.6-beta.0

3 years ago

5.0.5

3 years ago

5.0.4

3 years ago

5.0.3

3 years ago

5.0.5-beta.0

3 years ago

5.0.3-beta.0

3 years ago

5.0.5-beta.1

3 years ago

5.0.5-beta.2

3 years ago

5.0.5-beta.3

3 years ago

5.0.5-beta.4

3 years ago

5.0.3-beta.1

3 years ago

5.0.2

3 years ago

5.0.2-beta.0

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.1.11

3 years ago

4.1.12

3 years ago

4.1.9

3 years ago

4.1.10

3 years ago

4.1.8

3 years ago

4.1.7

3 years ago

4.1.6

3 years ago

4.1.5

3 years ago

4.1.4

3 years ago

4.1.3

3 years ago

4.1.2

3 years ago

4.1.0

3 years ago

4.1.1

3 years ago

4.0.9

3 years ago

4.0.8

3 years ago

4.0.7

3 years ago

4.0.6

3 years ago

4.0.5

3 years ago

4.0.4

3 years ago

4.0.3

3 years ago

4.0.1

3 years ago

4.0.2

3 years ago

4.0.0

3 years ago

4.0.0-beta.4

3 years ago

4.0.0-beta.3

3 years ago

4.0.0-beta.2

3 years ago

4.0.0-beta.1

3 years ago

3.0.7

4 years ago

3.0.6

5 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago