Skip to content

Commit

Permalink
Add documentation for stream component (home-assistant#8838)
Browse files Browse the repository at this point in the history
* add documentation for stream component

* update docs per changes to PR

* remove keepalive for now

* Apply suggestions from code review

Co-Authored-By: hunterjm <[email protected]>

* Update configuration sample

* Remove whitespaces
  • Loading branch information
hunterjm authored and fabaff committed Mar 12, 2019
1 parent 72ce74d commit c8d9f58
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
22 changes: 21 additions & 1 deletion source/_components/camera.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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` %}

Expand Down Expand Up @@ -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**.
Expand Down
27 changes: 27 additions & 0 deletions source/_components/stream.markdown
Original file line number Diff line number Diff line change
@@ -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:
```

0 comments on commit c8d9f58

Please sign in to comment.