From 9ca5df951c0608e82449077e3369d5517e095b63 Mon Sep 17 00:00:00 2001 From: Stephen Foskett Date: Sat, 30 Dec 2017 06:07:01 -0500 Subject: [PATCH] Update camera.markdown (#4146) * Update camera.markdown Added an example for the new camera.snapshot service with a timestamped filename (seems to be a common request). * :pencil2: Updated PR with suggestions from arsaboo --- source/_components/camera.markdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/_components/camera.markdown b/source/_components/camera.markdown index e0dee527ad6..cd4314d5581 100644 --- a/source/_components/camera.markdown +++ b/source/_components/camera.markdown @@ -45,6 +45,16 @@ Take a snapshot from a camera. The path part of `filename` must be an entry in the `whitelist_external_dirs` in your [`homeassistant:`](/docs/configuration/basic/) section of your `configuration.yaml` file. +For example, the following action in an automation would take a snapshot from "yourcamera" and save it to /tmp with a timestamped filename. + +```yaml +action: + service: camera.snapshot + data: + entity_id: camera.yourcamera + filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg' +``` + ### {% 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**.