Skip to content

Commit ec4f61e

Browse files
committed
Update generic camera platform
1 parent a99e6e4 commit ec4f61e

File tree

4 files changed

+47
-5
lines changed

4 files changed

+47
-5
lines changed

source/_components/camera.generic.markdown

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ ha_release: pre 0.7
1313
---
1414

1515

16-
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.
16+
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.
1717

18-
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]`.
18+
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]`.
1919

2020
To enable this camera in your installation, add the following to your `configuration.yaml` file:
2121

@@ -28,12 +28,23 @@ camera:
2828
username: USERNAME
2929
password: PASSWORD
3030
authentication: basic
31+
limit_refetch_to_url_change: true
3132
```
3233
3334
Configuration variables:
3435
35-
- **still_image_url** (*Required*): The URL your camera serves the image on, eg. http://192.168.1.21:2112/
36+
- **still_image_url** (*Required*): The URL your camera serves the image on, eg. http://192.168.1.21:2112/. Can be a [template].
3637
- **name** (*Optional*): This parameter allows you to override the name of your camera.
3738
- **username** (*Optional*): The username for accessing your camera.
3839
- **password** (*Optional*): The password for accessing your camera.
39-
- **authentication** (*Optional*): `basic` (default) or `digest` auth for requests.
40+
- **authentication** (*Optional*): `basic` (default) or `digest` auth for requests.
41+
- **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.
42+
43+
<p class='img'>
44+
<a href='/cookbook/google_maps_card/'>
45+
<img src='/images/components/camera/generic-google-maps.png' alt='Screenshot showing Google Maps integration in Home Assistant front end.'>
46+
Example showing the Generic camera platform pointing at a dynamic Google Map image.
47+
</a>
48+
</p>
49+
50+
[template]: /topics/templating/

source/_cookbook/custom_panel_using_react.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar: true
77
comments: false
88
sharing: true
99
footer: true
10-
ha_category: Custom Panel Examples
10+
ha_category: User Interface
1111
---
1212

1313
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.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
layout: page
3+
title: "Show Google Maps as a card"
4+
description: "Example how to show a Google Map as a Google card."
5+
date: 2016-08-20 19:05
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
ha_category: User Interface
11+
---
12+
13+
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.
14+
15+
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.
16+
17+
```yaml
18+
# Example configuration.yaml entry.
19+
# Shows device_tracker.demo_paulus on a map.
20+
camera:
21+
name: Paulus
22+
platform: generic
23+
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 %}
24+
limit_refetch_to_url_change: true
25+
```
26+
27+
<p class='img'>
28+
<img src='/images/components/camera/generic-google-maps.png' alt='Screenshot showing Google Maps integration in Home Assistant front end.'>
29+
</p>
30+
31+
[generic camera platform]: /components/camera.generic/
Loading

0 commit comments

Comments
 (0)