# bravia2mqtt > A bridge between Sony Bravia Smart TVs and MQTT. [![NPM Version][npm-image]][npm-url] [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md) bravia2mqtt is a Node.js application that links Sony Bravia smart TVs to an MQTT broker. It is designed to be used to integrate these devices into a home automation system. ## Getting Started bravia2mqtt is distributed through NPM: ```sh npm install -g bravia2mqtt # or, if you prefer: yarn global add bravia2mqtt ``` Running it is likewise easy: ```sh bravia2mqtt # if your MQTT broker is running on localhost bravia2mqtt -b mqtt:// # if your broker is running elsewhere bravia2mqtt --help # to see the full usage documentation ``` ## Topics and Payloads This app is intended to conform to the [mqtt-smarthome](http://www.github.com/mqtt-smarthome/mqtt-smarthome/) architecture. Below is a description of the topics used. ### Status updates These topics are published as update notifications are received from the TV. | Topic | Value | |-------------------------------------|----------------------------------------------------------------------------------| | `bravia:/status/isOn` | The current power status as a boolean | `bravia:/status/volume` | The current volume level as an integer | `bravia:/status/isMuted` | The current audio mute status as a boolean | `bravia:/status/channel` | The current channel as a string of the form `.` | `bravia:/status/input` | The currently selected input as a string (eg. component1, hdmi3) | `bravia:/status/isPictureMuted` | The current video mute status as a boolean | `bravia:/status/isPipEnabled` | The current state of the PIP display as a boolean ### Control These topics can be used to control various features of the TV. | Topic Template | Command | Value Type | Results on | |--------------------------|---------|------------|--------------------------------------------------------------------------| | `bravia:/sendIrCode` | Send an IR code to the TV. See [here](http://www.github.com/forty2/bravia-simple-ip-control/blob/master/KEYS.md) for a full list of codes | `bravia://isOn` | get
set
toggle | boolean | `bravia:/status/isOn` | `bravia://volume` | get
set | integer | `bravia:/status/volume` | `bravia://isMuted` | get
set | boolean | `bravia:/status/isMuted` | `bravia://channel` | get
set | string: `.` | `bravia:/status/channel` | `bravia://tripletChannel` | get
set | string: `..` | `bravia:/status/tripletChannel` | `bravia://inputSource` | get
set | string: `cable`, `antenna`, etc. | `bravia:/status/inputSource` | `bravia://input` | get
set | string: `hdmi3`, `component1`, etc. | `bravia:/status/input` | `bravia://isPictureMuted` | get
set
toggle | boolean | `bravia:/status/isPictureMuted` | `bravia://isPipEnabled` | get
set
toggle | boolean | `bravia:/status/isPipEnabled` | `bravia://pipPosition` | toggle | | | `bravia://broadcastAddress` | get | string | `bravia:/status/broadcastAddress` | `bravia://macAddress` | get | string | `bravia:/status/macAddress` | `bravia://sceneSetting` | get
set | string: `auto`, `auto24pSync`, `general` | `bravia:/status/sceneSetting` ## Contributing Contributions are of course always welcome. If you find problems, please report them in the [Issue Tracker](http://www.github.com/forty2/bravia2mqtt/issues/). If you've made an improvement, open a [pull request](http://www.github.com/forty2/bravia2mqtt/pulls). Getting set up for development is very easy: ```sh git clone cd bravia2mqtt yarn ``` And the development workflow is likewise straightforward: ```sh # make a change to the src/ file, then... yarn build node dist/index.js # or if you want to clean up all the leftover build products: yarn run clean ``` ## Release History * 1.0.0 * The first release. ## Meta Zach Bean – zb@forty2.com Distributed under the MIT license. See [LICENSE](LICENSE.md) for more detail. [npm-image]: https://img.shields.io/npm/v/bravia2mqtt.svg?style=flat [npm-url]: https://npmjs.org/package/bravia2mqtt