From 092e0e8962c00afc226b10f2fddd137b01428914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Vran=C3=ADk?= Date: Thu, 22 Dec 2016 11:11:32 +0100 Subject: [PATCH 1/5] Update hdmi_cec.markdown --- source/_components/hdmi_cec.markdown | 29 +++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/source/_components/hdmi_cec.markdown b/source/_components/hdmi_cec.markdown index 6cbfcd2e05c..911c0d9570a 100644 --- a/source/_components/hdmi_cec.markdown +++ b/source/_components/hdmi_cec.markdown @@ -13,7 +13,7 @@ ha_release: 0.23 ha_iot_class: "Local Push" --- -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. +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. ## {% linkable_title CEC Setup %} @@ -81,25 +81,32 @@ In the following example, a Pi Zero running Home Assistant is on a TV's HDMI por ```yaml hdmi_cec: devices: - 1: Pi Zero - 2: - 1: Fire TV Stick - 2: Chromecast - 3: Another Device - 3: BlueRay player + TV: 0.0.0.0 + Pi Zero: 1.0.0.0 + Fire TV Stick: 2.1.0.0 + Chromecast: 2.2.0.0 + Another Device: 2.3.0.0 + BlueRay player: 3.0.0.0 ``` ## {% linkable_title Services %} ### {% linkable_title Select Device %} -Call the `hdmi_cec/select_device` service with the name of the device to select, for example: +Call the `hdmi_cec/select_device` service with the name of the device from config or entity_id or prysical address"to select it, for example: ```json -{ - "device": "Chromecast" -} +{"device": "Chromecast"} ``` + +```json +{"device": "switch.hdmi_3"} +``` + +```json +{"device": "1.1.0.0"} +``` + So an Automation action using the example above would look something like this. ```yaml From 7856b00acee09b2d9946034dab0ea63a6c7faac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Vran=C3=ADk?= Date: Fri, 23 Dec 2016 16:59:58 +0100 Subject: [PATCH 2/5] support for old config --- source/_components/hdmi_cec.markdown | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/_components/hdmi_cec.markdown b/source/_components/hdmi_cec.markdown index 911c0d9570a..60611b83ef7 100644 --- a/source/_components/hdmi_cec.markdown +++ b/source/_components/hdmi_cec.markdown @@ -78,6 +78,7 @@ language: ??? 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. +You can use either direct mapping name to physical address of device ```yaml hdmi_cec: devices: @@ -88,6 +89,18 @@ hdmi_cec: Another Device: 2.3.0.0 BlueRay player: 3.0.0.0 ``` +or port mapping tree +```yaml +hdmi_cec: + devices: + 1: Pi Zero + 2: + 1: Fire TV Stick + 2: Chromecast + 3: Another Device + 3: BlueRay player +``` +Choose just one schema. Mixing both approaches is not possible. ## {% linkable_title Services %} From fd40b4fa9702c6929beeee3da6f850b082d40e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Vran=C3=ADk?= Date: Fri, 23 Dec 2016 17:12:34 +0100 Subject: [PATCH 3/5] Update hdmi_cec.markdown --- source/_components/hdmi_cec.markdown | 43 +++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/source/_components/hdmi_cec.markdown b/source/_components/hdmi_cec.markdown index 60611b83ef7..575769d2e28 100644 --- a/source/_components/hdmi_cec.markdown +++ b/source/_components/hdmi_cec.markdown @@ -106,7 +106,7 @@ Choose just one schema. Mixing both approaches is not possible. ### {% linkable_title Select Device %} -Call the `hdmi_cec/select_device` service with the name of the device from config or entity_id or prysical address"to select it, for example: +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: ```json {"device": "Chromecast"} @@ -137,6 +137,47 @@ Call the `hdmi_cec/power_on` service (no arguments) to power on any devices that Call the `hdmi_cec/standby` service (no arguments) to place in standby any devices that support this function. +### {% linkable_title Change volume level %} + +Call the `hdmi_cec/volume` service with one of following commands: + +#### Volume up +Increase volume three times: +```json +{"up": 3} +``` +Keep increasing volume until release is called: +```json +{"up": "press"} +``` +Stop increasing volume: +```json +{"up": "release"} +``` + + +#### Volume down +Decrease volume three times: +```json +{"down": 3} +``` +Keep decreasing volume until release is called: +```json +{"down": "press"} +``` +Stop decreasing volume: +```json +{"down": "release"} +``` + +#### Volume mute +Toggle mute: +```json +{"mute": ""} +``` +value is ignores. + + ## {% linkable_title Useful References %} * [CEC overview](http://wiki.kwikwai.com/index.php?title=The_HDMI-CEC_bus) From 976a4106e1efa35fe03c064d490ae2a7026e0e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Vran=C3=ADk?= Date: Mon, 26 Dec 2016 23:16:43 +0100 Subject: [PATCH 4/5] specifying default platform --- source/_components/hdmi_cec.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/_components/hdmi_cec.markdown b/source/_components/hdmi_cec.markdown index 575769d2e28..11ce78e1438 100644 --- a/source/_components/hdmi_cec.markdown +++ b/source/_components/hdmi_cec.markdown @@ -102,6 +102,12 @@ hdmi_cec: ``` Choose just one schema. Mixing both approaches is not possible. +Another option you can use in config is specifiing of default platform of HDMI devices. "switch" and "media_player" are supported. Switch is default. +```yaml +hdmi_cec: + platform: media_player +``` + ## {% linkable_title Services %} ### {% linkable_title Select Device %} From 862b66615298f703e36a496678422606a464da62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Vran=C3=ADk?= Date: Sun, 1 Jan 2017 13:05:23 +0100 Subject: [PATCH 5/5] Update hdmi_cec.markdown --- source/_components/hdmi_cec.markdown | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/_components/hdmi_cec.markdown b/source/_components/hdmi_cec.markdown index 11ce78e1438..07c08e45ce9 100644 --- a/source/_components/hdmi_cec.markdown +++ b/source/_components/hdmi_cec.markdown @@ -102,11 +102,25 @@ hdmi_cec: ``` Choose just one schema. Mixing both approaches is not possible. -Another option you can use in config is specifiing of default platform of HDMI devices. "switch" and "media_player" are supported. Switch is default. +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. ```yaml hdmi_cec: platform: media_player ``` +Then you set individual platform for devices in customizations: +```yaml +homeassistant: + customize: + hdmi_cec.hdmi_5: + platform: media_player +``` + +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: +```yaml +hdmi_cec: + host: 192.168.1.3 +``` + ## {% linkable_title Services %}