You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/_components/hdmi_cec.markdown
+86-5Lines changed: 86 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ha_release: 0.23
13
13
ha_iot_class: "Local Push"
14
14
---
15
15
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.
17
17
18
18
## {% linkable_title CEC Setup %}
19
19
@@ -78,6 +78,18 @@ language: ???
78
78
79
79
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.
80
80
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
81
93
```yaml
82
94
hdmi_cec:
83
95
devices:
@@ -88,18 +100,46 @@ hdmi_cec:
88
100
3: Another Device
89
101
3: BlueRay player
90
102
```
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
+
91
124
92
125
## {% linkable_title Services %}
93
126
94
127
### {% linkable_title Select Device %}
95
128
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:
97
130
98
131
```json
99
-
{
100
-
"device": "Chromecast"
101
-
}
132
+
{"device": "Chromecast"}
102
133
```
134
+
135
+
```json
136
+
{"device": "switch.hdmi_3"}
137
+
```
138
+
139
+
```json
140
+
{"device": "1.1.0.0"}
141
+
```
142
+
103
143
So an Automation action using the example above would look something like this.
104
144
105
145
```yaml
@@ -117,6 +157,47 @@ Call the `hdmi_cec/power_on` service (no arguments) to power on any devices that
117
157
118
158
Call the `hdmi_cec/standby` service (no arguments) to place in standby any devices that support this function.
119
159
160
+
### {% linkable_title Change volume level %}
161
+
162
+
Call the `hdmi_cec/volume` service with one of following commands:
0 commit comments