Skip to content

Commit f57aedf

Browse files
authored
Merge pull request home-assistant#1642 from konikvranik/next
hdmi_cec enhancement
2 parents 5dbd42f + 862b666 commit f57aedf

File tree

1 file changed

+86
-5
lines changed

1 file changed

+86
-5
lines changed

source/_components/hdmi_cec.markdown

Lines changed: 86 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ha_release: 0.23
1313
ha_iot_class: "Local Push"
1414
---
1515

16-
The CEC component provides services that allow selecting the active device, powering on all devices, and setting all devices to standby. Devices are defined in the configuration file by associating HDMI port number and a device name. Connected devices that provide further HDMI ports, such as Soundbars and AVRs are also supported. Devices are listed from the perspective of the CEC-enabled Home Assistant device. Any connected device can be listed, regardless of whether it supports CEC. Ideally the HDMI port number on your device will map correctly the CEC physical address. If it does not, use `cec-client` (part of the `libcec` package) to listen to traffic on the CEC bus and discover the correct numbers.
16+
The HDMI CEC component provides services that allow selecting the active device, powering on all devices, setting all devices to standby and creates switch entites for HDMI devices. Devices are defined in the configuration file by associating HDMI port number and a device name. Connected devices that provide further HDMI ports, such as Soundbars and AVRs are also supported. Devices are listed from the perspective of the CEC-enabled Home Assistant device. Any connected device can be listed, regardless of whether it supports CEC. Ideally the HDMI port number on your device will map correctly the CEC physical address. If it does not, use `cec-client` (part of the `libcec` package) to listen to traffic on the CEC bus and discover the correct numbers.
1717

1818
## {% linkable_title CEC Setup %}
1919

@@ -78,6 +78,18 @@ language: ???
7878

7979
In the following example, a Pi Zero running Home Assistant is on a TV's HDMI port 1. HDMI port 2 is attached to a AV receiver. Three devices are attached to the AV receiver on HDMI ports 1 through 3.
8080

81+
You can use either direct mapping name to physical address of device
82+
```yaml
83+
hdmi_cec:
84+
devices:
85+
TV: 0.0.0.0
86+
Pi Zero: 1.0.0.0
87+
Fire TV Stick: 2.1.0.0
88+
Chromecast: 2.2.0.0
89+
Another Device: 2.3.0.0
90+
BlueRay player: 3.0.0.0
91+
```
92+
or port mapping tree
8193
```yaml
8294
hdmi_cec:
8395
devices:
@@ -88,18 +100,46 @@ hdmi_cec:
88100
3: Another Device
89101
3: BlueRay player
90102
```
103+
Choose just one schema. Mixing both approaches is not possible.
104+
105+
Another option you can use in config is `platform` which specifying of default platform of HDMI devices. "switch" and "media_player" are supported. Switch is default.
106+
```yaml
107+
hdmi_cec:
108+
platform: media_player
109+
```
110+
Then you set individual platform for devices in customizations:
111+
```yaml
112+
homeassistant:
113+
customize:
114+
hdmi_cec.hdmi_5:
115+
platform: media_player
116+
```
117+
118+
And the last option is `host`. PyCEC supports bridging CEC commands over TCP. When you start pyCEC on machine with HDMI port (`python -m pycec`), you can then run homeassistant on another machine and connect to CEC over TCP. Specify TCP address of pyCEC server:
119+
```yaml
120+
hdmi_cec:
121+
host: 192.168.1.3
122+
```
123+
91124

92125
## {% linkable_title Services %}
93126

94127
### {% linkable_title Select Device %}
95128

96-
Call the `hdmi_cec/select_device` service with the name of the device to select, for example:
129+
Call the `hdmi_cec/select_device` service with the name of the device from config or entity_id or physical address"to select it, for example:
97130

98131
```json
99-
{
100-
"device": "Chromecast"
101-
}
132+
{"device": "Chromecast"}
102133
```
134+
135+
```json
136+
{"device": "switch.hdmi_3"}
137+
```
138+
139+
```json
140+
{"device": "1.1.0.0"}
141+
```
142+
103143
So an Automation action using the example above would look something like this.
104144

105145
```yaml
@@ -117,6 +157,47 @@ Call the `hdmi_cec/power_on` service (no arguments) to power on any devices that
117157

118158
Call the `hdmi_cec/standby` service (no arguments) to place in standby any devices that support this function.
119159

160+
### {% linkable_title Change volume level %}
161+
162+
Call the `hdmi_cec/volume` service with one of following commands:
163+
164+
#### Volume up
165+
Increase volume three times:
166+
```json
167+
{"up": 3}
168+
```
169+
Keep increasing volume until release is called:
170+
```json
171+
{"up": "press"}
172+
```
173+
Stop increasing volume:
174+
```json
175+
{"up": "release"}
176+
```
177+
178+
179+
#### Volume down
180+
Decrease volume three times:
181+
```json
182+
{"down": 3}
183+
```
184+
Keep decreasing volume until release is called:
185+
```json
186+
{"down": "press"}
187+
```
188+
Stop decreasing volume:
189+
```json
190+
{"down": "release"}
191+
```
192+
193+
#### Volume mute
194+
Toggle mute:
195+
```json
196+
{"mute": ""}
197+
```
198+
value is ignores.
199+
200+
120201
## {% linkable_title Useful References %}
121202

122203
* [CEC overview](http://wiki.kwikwai.com/index.php?title=The_HDMI-CEC_bus)

0 commit comments

Comments
 (0)