Update generic camera platform

This commit is contained in:
Paulus Schoutsen 2016-08-20 23:26:41 -07:00
parent a99e6e431b
commit ec4f61e361
4 changed files with 47 additions and 5 deletions

View File

@ -13,9 +13,9 @@ ha_release: pre 0.7
--- ---
The `generic` camera platform allows you to integrate any IP camera into Home Assistant. It supports fetching images from a url with optional HTTP authentication. The `generic` camera platform allows you to integrate any IP camera or other url into Home Assistant. Templates can be used to generate the urls on the fly.
Home Assistant will serve the images via its server, making it possible to view your IP camera's while outside of your network. The endpoint is `/api/camera_proxy/camera.[name]?time=[timestamp]`. Home Assistant will serve the images via its server, making it possible to view your IP camera's while outside of your network. The endpoint is `/api/camera_proxy/camera.[name]`.
To enable this camera in your installation, add the following to your `configuration.yaml` file: To enable this camera in your installation, add the following to your `configuration.yaml` file:
@ -28,12 +28,23 @@ camera:
username: USERNAME username: USERNAME
password: PASSWORD password: PASSWORD
authentication: basic authentication: basic
limit_refetch_to_url_change: true
``` ```
Configuration variables: Configuration variables:
- **still_image_url** (*Required*): The URL your camera serves the image on, eg. http://192.168.1.21:2112/ - **still_image_url** (*Required*): The URL your camera serves the image on, eg. http://192.168.1.21:2112/. Can be a [template].
- **name** (*Optional*): This parameter allows you to override the name of your camera. - **name** (*Optional*): This parameter allows you to override the name of your camera.
- **username** (*Optional*): The username for accessing your camera. - **username** (*Optional*): The username for accessing your camera.
- **password** (*Optional*): The password for accessing your camera. - **password** (*Optional*): The password for accessing your camera.
- **authentication** (*Optional*): `basic` (default) or `digest` auth for requests. - **authentication** (*Optional*): `basic` (default) or `digest` auth for requests.
- **limit_refetch_to_url_change** (*Optional*): true/false value (default: false). Limits refetching of the remote image to when the url changes. Only relevant if using a template to fetch the remote image.
<p class='img'>
<a href='/cookbook/google_maps_card/'>
<img src='/images/components/camera/generic-google-maps.png' alt='Screenshot showing Google Maps integration in Home Assistant front end.'>
Example showing the Generic camera platform pointing at a dynamic Google Map image.
</a>
</p>
[template]: /topics/templating/

View File

@ -7,7 +7,7 @@ sidebar: true
comments: false comments: false
sharing: true sharing: true
footer: true footer: true
ha_category: Custom Panel Examples ha_category: User Interface
--- ---
This is a [React](https://facebook.github.io/react/) implementation of [TodoMVC](http://todomvc.com/) but instead of checking off to do items, you are turning lights and switches on/off. This is a [React](https://facebook.github.io/react/) implementation of [TodoMVC](http://todomvc.com/) but instead of checking off to do items, you are turning lights and switches on/off.

View File

@ -0,0 +1,31 @@
---
layout: page
title: "Show Google Maps as a card"
description: "Example how to show a Google Map as a Google card."
date: 2016-08-20 19:05
sidebar: true
comments: false
sharing: true
footer: true
ha_category: User Interface
---
Using the [generic camera platform] you can present any image on the internet as a camera. Starting release 0.27 these urls can also be based on a template. This example uses this functionality to point a generic camera at the Google Maps static image API and pass in the location of a device.
It also leverages the `limit_refetch_to_url_change` option to ensure that we do not make a lot of requests to the Google Maps API.
```yaml
# Example configuration.yaml entry.
# Shows device_tracker.demo_paulus on a map.
camera:
name: Paulus
platform: generic
still_image_url: {% raw %}https://maps.googleapis.com/maps/api/staticmap?center={{ states.device_tracker.demo_paulus.attributes.latitude }},{{ states.device_tracker.demo_paulus.attributes.longitude }}&zoom=13&size=500x500&maptype=roadmap&markers=color:blue%7Clabel:P%7C{{ states.device_tracker.demo_paulus.attributes.latitude }},{{ states.device_tracker.demo_paulus.attributes.longitude }}{% endraw %}
limit_refetch_to_url_change: true
```
<p class='img'>
<img src='/images/components/camera/generic-google-maps.png' alt='Screenshot showing Google Maps integration in Home Assistant front end.'>
</p>
[generic camera platform]: /components/camera.generic/

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB