• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    Python
  • License
    MIT License
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sony Bravia TV (Pre-Shared Key) component for Home Assistant

Code style: black maintained maintainer hacs_badge Community Forum

This component is no longer maintained as I switched to the HA Sony Bravia integration which now also supports using the Pre-Shared Key. I can still merge PRs made and tested by the community and release new versions.

A huge thanks to all users and contributors 👍
It was really fun to develop this custom integration and see that so many people use(d) it 📺

Custom component for Sony Bravia TV using Pre-Shared Key (PSK)

A platform which allows you to interact with the Sony Bravia TV using a Pre-Shared Key.

Homekit TV supported

The media player will show up as Television accessories on devices running iOS 12.2 or later

Screenshots

Component used with Mini Media Player. Detailled program info only available when using the onboard smartcard module.

Component used with Mini Media Player

Component used with standard Media Player. Detailled program info only available when using the onboard smartcard module.

Component used with standard Media Player

Installation

You can use HACS or install the component manually:

To get started put the files from /custom_components/braviatv_psk/ in your folder <config directory>/custom_components/braviatv_psk/

Configuration

Example configuration.yaml

media_player:
  - platform: braviatv_psk
    host: 192.168.1.101
    psk: sony
    mac: AA:BB:CC:DD:EE:FF
    amp: True
    android: True
    sourcefilter:
      - ' HD'
      - HDMI
    time_format: 12H
    user_labels: True
    name: MyBraviaTV

Configuration variables

key required value description
platform yes braviatv_psk The platform name braviatv_psk.
host yes 192.168.1.101 The IP of the Sony Bravia TV, eg. 192.168.1.101.
psk yes sony The Pre-Shared Key of the Sony Bravia TV, eg. sony (see below for instructions how to configure this on the TV). Place the psk between quotes if you use digits and those start with one or more zero's, e.g. '0044'.
mac no AA:BB:CC:DD:EE:FF The MAC address of the Sony Bravia TV (see below for instructions how to get this from the TV). This is used to turn on the TV using WakeOn LAN and is only needed if the TV is non-Android.
amp no False Boolean, defaults to False. Set this to True if you have an amplifier attached to the TV and not use the internal TV speakers. Then the volume slider will not be shown as this doesn’t work for the amplifier. Mute and volume up and down buttons are there and working with an amplifier.
android no False "Boolean, defaults to False. Set this to True when you have an Android TV as these TV’s don’t respond to WakeOn LAN commands, so another method of turning on the TV can be used. Also a service to open apps is added to Home Assistant.
sourcefilter no HD List of text that is used to filter the source list, eg. ’ HD’ (with quotes) will only show TV channels in the source list which contain ‘HD’, eg. ‘NPO 3 HD’ (in my config this will only show HD channels).
time_format no 24H Time format to use for program information. Valid options are 12H or 24H, default is 24H.
user_labels no True Use the user defined labels from the TV (where configured), instead of default port labels. If you have given e.g. the HDMI2 port on your TV a label, that will be shown.
name no Sony Bravia TV The name the TV will have in Home Assistant, default is Sony Bravia TV.

Installation instructions TV

  1. Enable remote start on your TV: [Settings] => [Network] => [Home Network Setup] => [Remote Start] => [On]
  2. Enable pre-shared key on your TV: [Settings] => [Network] => [Home Network Setup] => [IP Control] => [Authentication] => [Normal and Pre-Shared Key]
  3. Set pre-shared key on your TV: [Settings] => [Network] => [Home Network Setup] => [IP Control] => [Pre-Shared Key] => sony
  4. Give your TV a static IP address, or make a DHCP reservation for a specific IP address in your router
  5. Determine the MAC address of your TV: [Settings] => [Network] => [Network Setup] => [View Network Status]

Services

The following service is added to Home Assistant

  • braviatv_psk.bravia_command

This service can be used to send commands to your TV, like Return or Up. Useful for creating a virtual remote control for example. A complete list with examples can be found below.

When you have an Android TV and have set Android: True in the configuration also the following service is added

  • braviatv_psk.bravia_open_app

This service can be used to open an app on your Android TV, like Kodi or Youtube. You have to send the corresponding uri to open the app. A list with some example uris can be found below.

braviatv_psk.bravia_command

The use of command_id depends on which one are supported by your TV. Some examples are:

Num1
Num2
Num3
Num4
Num5
Num6
Num7
Num8
Num9
Num0
Num11
Num12
Enter
GGuide
ChannelUp
ChannelDown
VolumeUp
VolumeDown
Mute
TvPower
Audio
MediaAudioTrack
Tv
Input
TvInput
TvAntennaCable
WakeUp
PowerOff
Sleep
Right
Left
SleepTimer
Analog2
TvAnalog
Display
Jump
PicOff
PictureOff
Teletext
Video1
Video2
AnalogRgb1
Home
Exit
PictureMode
Confirm
Up
Down
ClosedCaption
Component1
Component2
Wide
EPG
PAP
TenKey
BSCS
Ddata
Stop
Pause
Play
Rewind
Forward
DOT
Rec
Return
Blue
Red
Green
Yellow
SubTitle
CS
BS
Digital
Options
Media
Prev
Next
DpadCenter
CursorUp
CursorDown
CursorLeft
CursorRight
ShopRemoteControlForcedDynamic
FlashPlus
FlashMinus
DemoMode
Analog
Mode3D
DigitalToggle
DemoSurround
AD
AudioMixUp
AudioMixDown
PhotoFrame
Tv_Radio
SyncMenu
Hdmi1
Hdmi2
Hdmi3
Hdmi4
TopMenu
PopUpMenu
OneTouchTimeRec
OneTouchView
DUX
FootballMode
iManual
Netflix
Assists
FeaturedApp
FeaturedAppVOD
GooglePlay
ActionMenu
Help
TvSatellite
WirelessSubwoofer
AndroidMenu

braviatv_psk.bravia_open_app

If you have an Android TV you can use an uri to open the corresponding app.

You can use the following command to get all uri's from the TV:

curl -H 'Content-Type: application/json' -H 'X-Auth-PSK:[psk]' -X POST -d "{'id': 1, 'method': 'getApplicationList', 'version': '1.0', 'params': ['']}" http://[IP]/sony/appControl

Change [psk] with your psk and [IP] with the IP address of the TV.

Also see this post to get a list of all apps supported by your TV. Some examples:

YouTube uri: "com.sony.dtv.com.google.android.youtube.tv.com.google.android.apps.youtube.tv.activity.ShellActivity"
Music uri: "com.sony.dtv.com.sony.dtv.osat.music.com.sonyericsson.music.MusicActivity"
Netflix uri: "com.sony.dtv.com.netflix.ninja.com.netflix.ninja.MainActivity"
Kodi uri: "com.sony.dtv.org.xbmc.kodi.org.xbmc.kodi.Splash"
Disney+ uri: "com.sony.dtv.com.disney.disneyplus.com.bamtechmedia.dominguez.main.MainActivity"
NLZiet uri: "com.sony.dtv.nl.nlziet.nl.nlziet.ui.splash.SplashActivity"
Videoland uri: "com.sony.dtv.nl.rtl.videoland.nl.rtl.videoland.ui.splash.SplashActivity"

Working uri's for Sony KD-55XF9005: KD-55XF9005.txt

Working uri's for Sony KD-50W805C: KD-50W805C.txt

More Repositories

1

ble_monitor

BLE monitor for passive BLE sensors
Python
1,895
star
2

remote_homeassistant

Links multiple home-assistant instances together
Python
884
star
3

pyscript

Pyscript adds rich Python scripting to HASS
Python
851
star
4

nordpool

This component allows you to pull in the energy prices into Home-Assistant.
Python
443
star
5

custom_updater

[DEPRECATED]📦 A component which allows you to track and update custom cards/components and python_scripts
Python
166
star
6

grocy

Custom Grocy integration for Home Assistant
Python
156
star
7

feedparser

📰 RSS Feed Integration
Python
137
star
8

sensor.unifigateway

High level health status of UniFi Security Gateway devices via UniFi Controller
Python
127
star
9

weatheralerts

A sensor that gives you weather alerts from alerts.weather.gov.
Python
126
star
10

climate.programmable_thermostat

Programmable thermostat that let you have a smart thermostat on budget.
Python
113
star
11

places

Component to integrate with OpenStreetMap Reverse Geocode (places)
Python
111
star
12

sensor.rpi_power

A Custom component for Home-Assistant that checks if your Raspberry Pi power supply is giving enough voltage from the kernel.
Python
103
star
13

sensor.airthings_wave

hassio support for Airthings Wave BLE environmental radon sensor.
Python
100
star
14

sensor.plex_recently_added

▶️ Plex component to feed Upcoming Media Card.
Python
82
star
15

authenticated

A platform which allows you to get information about sucessfull logins to Home Assistant.
Python
82
star
16

breaking_changes

Component to show potential breaking_changes in the current published version based on your loaded components
Python
81
star
17

zaptec

zaptec charger custom component for home assistant
Python
63
star
18

sensor.trakt

📺 Trakt Integration for Upcoming Media Card
Python
61
star
19

sensor.radarr_upcoming_media

🎬 Radarr component to feed Upcoming Media Card.
Python
59
star
20

youtube

A platform which give you info about the newest video on a channel
Python
55
star
21

sensor.sonarr_upcoming_media

📺 Sonarr component to feed Upcoming Media Card.
Python
54
star
22

healthchecksio

Update and display the status of your healthchecks.io checks.
Python
51
star
23

sensor.avanza_stock

Custom component to get stock data from Avanza for Home Assistant
Python
46
star
24

sensor.ssh

SSH Generic Sensor
Python
43
star
25

sensor.untappd

🍻 Untappd Integration
Python
37
star
26

readme

Use Jinja and data from Home Assistant to generate your README.md file
Python
33
star
27

information

📜 Information about this organization
31
star
28

sensor.stadtreinigung_hamburg

Stadtreinigung Hamburg - get garbage collection dates in Hamburg - custom component for Home Assistant
Python
25
star
29

sensor.yandex_maps

A platform which give you the time it will take to drive.
Python
25
star
30

combined

A camera platform that give you a combined feed of your defined camera entities.
Python
24
star
31

wienerlinien

A sensor that give you information about next departure from spesified stop.
Python
21
star
32

templatesensor

Add template sensors from the UI.
Python
19
star
33

uilogs

DEPRECATED: Custom panel that show colorful logs for Home Assistant (core), and the supervisor (if you have it).
TypeScript
18
star
34

sensor.nintendo_wishlist

A sensor that monitors a Nintendo Switch wish list for when games are on sale.
Python
17
star
35

sensor.personalcapital

💵 Personal Capital Integration for Bank Account Monitoring
Python
15
star
36

switch.hadockermon

A switch platform that interact with ha-dockermon.
Python
14
star
37

unsplash

A camera platform that give you random images from Unsplash presented as a camera feed.
Python
13
star
38

gpodder

🎧 gPodder Integration for Podcast Feed Monitoring
Python
13
star
39

sensor.owlintuition

A set of sensors to integrate the OWL Intuition devices network
Python
11
star
40

sensor.file_restore

Improved file sensor component that let you read the whole last line content.
Python
11
star
41

usps_mail

A component that give you to info about incoming letters and packages from USPS.
Python
9
star
42

sensor.custom_aftership

A component which allows you to get information about pending parcels.
Python
8
star
43

sensor.tautulli

A platform which allows you to get information from Tautulli.
Python
8
star
44

sensor.avfallsor

Simple sensor for avfallsor
Python
8
star
45

brewdog

🍻 Display information about random beers from Brewdog as a sensor in Home Assistant, you can use this in a push notification next time you visit a bar.
Python
7
star
46

sensor.kodi_recently_added

Kodi component to feed the Upcoming Media Card for Home Assistant.
Python
7
star
47

config_check

Run the CLI config_check from a service call.
Python
7
star
48

ups

The ups platform allows one to track deliveries by the UPS
Python
6
star
49

fedex

The fedex platform allows one to track deliveries by FedEx
Python
5
star
50

sensor.launchlibrary

Get info about next space launches
Python
4
star
51

climate.e_thermostaat

E-Thermostaat (ICY) component for Home Assistant
Python
3
star
52

custom_components

[archived] Use this instead: https://github.com/custom-components/custom_updater
Python
3
star
53

camera.multisource

A camera platform that generate a camera feed from multiple sources.
Python
2
star
54

srp_energy

The srp_energy integration shows information from Srp hourly energy usage report for their customers
Python
2
star
55

hassbian_config

A custom component which allows you to controll some hassbian-config functions from Home Assistant.
Python
2
star
56

sensor.ruter

A sensor platform that gives you information about next departures.
Python
2
star
57

lists

Python
2
star
58

sensor.wifi-scanner

A Wi-Fi scanner sensor
Python
2
star
59

sensor.versions

Deprecated.
Python
2
star
60

sensor.custom_cards

This sensor is no longer needed
Python
1
star
61

sytadin

The sytadin sensor platform allows you to monitor traffic details from Sytadin
Python
1
star
62

sickchill

Taps into Sickchill Api so you can perform basic commands
Python
1
star
63

complimentr

Component to integrate with complimentr.
Python
1
star
64

binary_sensor.hadockermon

A custom binary_sensor platform which allows you get sensor data from ha-dockermon.
Python
1
star