From c8d9f585977964431c823d25ede62547bcd9f875 Mon Sep 17 00:00:00 2001 From: Jason Hunter Date: Tue, 12 Mar 2019 15:58:09 -0400 Subject: [PATCH] Add documentation for stream component (#8838) * add documentation for stream component * update docs per changes to PR * remove keepalive for now * Apply suggestions from code review Co-Authored-By: hunterjm * Update configuration sample * Remove whitespaces --- source/_components/camera.markdown | 22 +++++++++++++++++++++- source/_components/stream.markdown | 27 +++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 source/_components/stream.markdown diff --git a/source/_components/camera.markdown b/source/_components/camera.markdown index 0231195e04c..4a91357d16f 100644 --- a/source/_components/camera.markdown +++ b/source/_components/camera.markdown @@ -15,7 +15,7 @@ The camera component allows you to use IP cameras with Home Assistant. With a li Once loaded, the `camera` platform will expose services that can be called to perform various actions. -Available services: `turn_on`, `turn_off`, `enable_motion_detection`, `disable_motion_detection`, and `snapshot`. +Available services: `turn_on`, `turn_off`, `enable_motion_detection`, `disable_motion_detection`, `snapshot`, and `play_stream`. #### {% linkable_title Service `turn_on` %} @@ -72,6 +72,26 @@ action: ``` {% endraw %} +#### {% linkable_title Service `play_stream` %} + +Play a live stream from a camera to selected media player(s). Requires `stream` component to be set up. + +| Service data attribute | Optional | Description | +| ---------------------- | -------- | ----------- | +| `entity_id` | no | Name of entity to fetch stream from, e.g., `camera.living_room_camera`. | +| `media_player` | no | Name of media player to play stream on, e.g., `media_player.living_room_tv`. | +| `format` | yes | Stream format supported by `stream` component and selected `media_player`. Default: `hls` | + +For example, the following action in an automation would send an `hls` live stream to your chromecast. + +```yaml +action: + service: camera.play_stream + data: + entity_id: camera.yourcamera + media_player: media_player.chromecast +``` + ### {% linkable_title Test if it works %} A simple way to test if you have set up your `camera` platform correctly, is to use service developer tool icon **Services** from the **Developer Tools**. Choose your service from the dropdown menu **Service**, enter something like the sample below into the **Service Data** field, and hit **CALL SERVICE**. diff --git a/source/_components/stream.markdown b/source/_components/stream.markdown new file mode 100644 index 00000000000..cd277349a98 --- /dev/null +++ b/source/_components/stream.markdown @@ -0,0 +1,27 @@ +--- +layout: page +title: "Stream" +description: "Instructions on how to integrate live streams within Home Assistant." +date: 2019-02-06 13:40 +sidebar: true +comments: false +sharing: true +footer: true +logo: home-assistant.png +ha_category: + - Other +ha_release: "0.90" +ha_iot_class: Local Push +ha_qa_scale: internal +--- + +The `stream` component provides a way to proxy live streams through Home Assistant. The component currently only supports the HLS format. + +## {% linkable_title Configuration %} + +To enable the random binary sensor, add the following lines to your `configuration.yaml` file: + +```yaml +# Example configuration.yaml entry +stream: +```