mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 16:56:50 +00:00
Update camera.markdown (#37147)
For actions Record and Snapshot, rename the user defined variable `entity_id` to a different name (suggested my_camera_id) to avoid the confusion between the data attribute `entity_id` and the user defined variable `entity_id`
This commit is contained in:
parent
c9f8c204c2
commit
86b5b9079b
@ -104,12 +104,12 @@ For example, the following action in an automation would take a recording from "
|
||||
```yaml
|
||||
actions:
|
||||
- variables:
|
||||
entity_id: camera.yourcamera # Store the camera entity_id in a variable for reuse
|
||||
my_camera_id: camera.yourcamera # Store the camera entity_id in a variable for reuse
|
||||
- action: camera.record
|
||||
target:
|
||||
entity_id: '{{ entity_id }}'
|
||||
entity_id: '{{ my_camera_id }}'
|
||||
data:
|
||||
filename: '/tmp/{{ entity_id }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4'
|
||||
filename: '/tmp/{{ my_camera_id }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4'
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
@ -132,12 +132,12 @@ For example, the following action in an automation would take a snapshot from "y
|
||||
```yaml
|
||||
actions:
|
||||
- variables:
|
||||
entity_id: camera.yourcamera # Store the camera entity_id in a variable for reuse
|
||||
my_camera_id: camera.yourcamera # Store the camera entity_id in a variable for reuse
|
||||
- action: camera.snapshot
|
||||
target:
|
||||
entity_id: '{{ entity_id }}'
|
||||
entity_id: '{{ my_camera_id }}'
|
||||
data:
|
||||
filename: '/tmp/{{ entity_id }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
|
||||
filename: '/tmp/{{ my_camera_id }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user