📺 Bravia REST API — Full Sony Bravia integration for Home Assistant

Hi everyone! I’d like to share a new custom integration I’ve been working on: Bravia REST API.

The existing bravia integration is quite limited. I wanted full access to everything Sony Bravia TVs expose via their REST API — IRCC infrared codes, app control, screen management, Wake-on-LAN and more — so I built this from scratch.


:sparkles: What it does

Exposes the full Sony Bravia REST API as native Home Assistant entities:

  • :satellite_antenna: Media Player — power, volume (absolute + step), source selection mixing HDMI inputs and Android apps
  • :video_game: Remote — send any IRCC command by name (VolumeUp, Home, Back…) or raw base64 code
  • :radio_button: Buttons — one-tap actions: Blank Screen, Picture On, Reboot, Close Apps, and all directional/navigation IR buttons
  • :downwards_button: Selects — Sound output (speaker/HDMI/audio system), Screen rotation
  • :bar_chart: Sensors — Model, Firmware, Serial Number, MAC address
  • :on_arrow: Switches — LED Indicator, Wake-on-LAN
  • :gear: Custom Servicesopen_app, send_ircc, set_audio_output, blank_screen, get_installed_apps

Key features:

  • :magnifying_glass_tilted_left: Auto-discovers TV model and capabilities at setup time
  • :zzz: Works with TVs in standby (no need to have the TV on to configure)
  • :globe_with_meridians: Wake-on-LAN support to power on from standby
  • :mobile_phone: Discovers all installed Android apps and lets you launch them from the source list
  • :electric_plug: Local polling — no cloud, no account needed. Just IP + PSK

:clipboard: Requirements

  • Sony Bravia TV with Pre-Shared Key (PSK) enabled
    • Settings → Network → IP Control → Authentication → set a PSK
  • Home Assistant 2024.1+
  • TV on same local network as HA

:rocket: Installation via HACS

  1. HACS → Integrations → ⋮ → Custom repositories
  2. Add https://github.com/cmos486/Bravia-REST-API → Category: Integration
  3. Install Bravia REST API
  4. Restart Home Assistant
  5. Settings → Devices & Services → Add Integration → search Bravia REST API
  6. Enter your TV’s IP and PSK — that’s it!

:video_game: Example: sending IR commands from automations

service: remote.send_command
target:
  entity_id: remote.kd_65xh9096
data:
  command: Home

Or open Netflix directly:

service: bravia_rest_api.open_app
target:
  entity_id: media_player.kd_65xh9096
data:
  app_name: Netflix

:link: Links


Tested on a KD-65XH9096 running firmware 5.7.0. Should work on any Bravia with PSK support, though some features depend on the model. If you try it on a different model I’d love to hear how it goes — feedback and PRs welcome! :raising_hands:

2 Likes

Why not enhance the existing core integration instead of creating a new custom integration? This will be the third integration for Bravia TVs.

1 Like

+1, would have been a lot better :wink:

I was unaware of that possibility, my apologies ;(

You don’t have to apologize, it’s great that you want to support the community and create something new :muscle:
However, I encourage you to develop the core integration so that more users can benefit from your work.
You can find the integration source here: core/homeassistant/components/braviatv at dev · home-assistant/core · GitHub
Pybravia (backend library) source: GitHub - Drafteed/pybravia: Python async library for remote control of Sony Bravia TVs 2013 and newer. · GitHub

2 Likes

does your integration do remote and app launching differently from the official one? those features already exist and function the same way as your as far as i can tell