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 <hunterjm@gmail.com>

* Update configuration sample

* Remove whitespaces
This commit is contained in:
Jason Hunter 2019-03-12 15:58:09 -04:00 committed by Fabian Affolter
parent 72ce74d9fc
commit c8d9f58597
2 changed files with 48 additions and 1 deletions

View File

@ -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 <img src='/images/screenshots/developer-tool-services-icon.png' alt='service developer tool icon' class="no-shadow" height="38" /> **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**.

View File

@ -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:
```