Remove documentation of entity_id camera action service template variable (#35267)

This commit is contained in:
Erik Montnemery 2024-10-21 19:45:30 +02:00 committed by GitHub
parent 76c0d8454c
commit 29729ca293
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,7 +91,7 @@ Both `duration` and `lookback` options are suggestions, but should be consistent
| Data attribute | Optional | Description |
| -------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `entity_id` | no | Name(s) of entities to create a snapshot from, e.g., `camera.living_room_camera`. |
| `filename` | no | Template of a file name. Variable is `entity_id`, e.g., {% raw %}`/tmp/{{ entity_id.name }}.mp4`{% endraw %}. |
| `filename` | no | Recording file name. |
| `duration` | yes | Target recording length (in seconds). Default: 30 |
| `lookback` | yes | Target lookback period (in seconds) to include in addition to duration. Only available if there is currently an active HLS stream. Default: 0 |
@ -103,11 +103,13 @@ 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
- action: camera.record
target:
entity_id: camera.yourcamera
entity_id: '{{ entity_id }}'
data:
filename: '/tmp/{{ entity_id.name }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4'
filename: '/tmp/{{ entity_id }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4'
```
{% endraw %}
@ -119,7 +121,7 @@ Take a snapshot from a camera.
| Data attribute | Optional | Description |
| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| `entity_id` | no | Name(s) of entities to create a snapshot from, e.g., `camera.living_room_camera`. |
| `filename` | no | Template of a file name. Variable is `entity_id`, e.g., {% raw %}`/tmp/snapshot_{{ entity_id.name }}`{% endraw %}. |
| `filename` | no | Snapshot file name. |
The path part of `filename` must be an entry in the `allowlist_external_dirs` in your [`homeassistant:`](/integrations/homeassistant/) section of your {% term "`configuration.yaml`" %} file.
@ -129,11 +131,13 @@ 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
- action: camera.snapshot
target:
entity_id: camera.yourcamera
entity_id: '{{ entity_id }}'
data:
filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
filename: '/tmp/{{ entity_id }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
```
{% endraw %}