Skip to content

Commit 90ff89c

Browse files
committed
Escape templates, convert titles to links, and other fixes
1 parent 348c8b2 commit 90ff89c

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

source/_components/media_player.braviatv.markdown

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,44 +33,43 @@ Configuration variables:
3333
- **host** (*Required*): The IP of the Sony Bravia TV, eg. 192.168.0.10
3434
- **name** (*Optional*): The name to use on the frontend.
3535
36-
You are also able to configure the TV manually by placing a `bravia.conf` file in your `.homeassistant` config directory with the following information - please update the details to match your setup:
36+
You are also able to configure the TV manually by placing a `bravia.conf` file in your [configuration directory](/docs/configuration/) with the following information - please update the details to match your setup:
3737

3838
```json
3939
{"192.168.0.10": {"pin": "7745", "mac": "ac:1e:0a:e1:0c:01"}}
4040
```
4141

42-
## For TVs older than 2013.
42+
## {% linkable_title For TVs older than 2013 %}
4343

44-
Users of TVs older than 2013 still have several options for controlling their TV via Home Assistant.
44+
Users of TVs older than 2013 have another option for controlling their TV via Home Assistant.
4545

46-
Unfortunately depending on desired goal, the outcome may have some undesired trade off.
47-
48-
#### Using HDMI-CEC ####
46+
### {% linkable_title Using HDMI-CEC %}
4947

5048
If you have a Raspberry Pi connected to your TV:
5149

52-
```json
53-
- platform: command_line
54-
switches:
55-
tv_rpi:
56-
command_on: ssh root@[IP] "echo 'on 0' | cec-client -s"
57-
command_off: ssh root@[IP] "echo 'standby 0' | cec-client -s"
58-
command_state: ssh root@[IP] "echo 'pow 0' | cec-client -s |grep 'power status:'"
59-
value_template: '{{ value == "power status: on" }}'
50+
```yaml
51+
switch:
52+
- platform: command_line
53+
switches:
54+
tv_rpi:
55+
command_on: ssh root@[IP] "echo 'on 0' | cec-client -s"
56+
command_off: ssh root@[IP] "echo 'standby 0' | cec-client -s"
57+
command_state: ssh root@[IP] "echo 'pow 0' | cec-client -s |grep 'power status:'"
58+
value_template: {% raw %}'{{ value == "power status: on" }}{% endraw %}'
6059
```
6160

62-
Using cec-client seems like a great method to turn your TV off/on, however the trade off is if you're using Kodi, it will no longer be able to control your TV using the TV Remote.
61+
Using `cec-client` is a great method to turn your TV off/on, however the trade off is if you're using Kodi, it will no longer be able to control your TV using the TV Remote.
6362

64-
This is because only one process can control the CEC functionality within the Raspberry Pi at a time, and running the above commands terminates the functionality inside libCEC within Kodi. Kodi must be restarted for TV remove functionality to work again.
63+
This is because only one process can control the CEC functionality within the Raspberry Pi at a time and running the above commands terminates the functionality inside libCEC within Kodi. Kodi must be restarted for TV remove functionality to work again.
6564

6665
**Workaround:**
6766

6867
If your desire is only to turn on your TV, the following "workaround" may be desirable:
6968

70-
Change the 'on' command to a restart for Kodi - this doesn't reboot the Kodi device.
69+
Change the 'on' command to a restart for Kodi. This doesn't reboot the Kodi device.
7170

7271
Restarting Kodi will trigger a HDMI-CEC event to bring the TV out of standby. The following can replace your TV 'on' command.
7372

74-
```json
73+
```yaml
7574
command_on: ssh root@[IP] "systemctl restart kodi"
7675
```

0 commit comments

Comments
 (0)