Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove documentation of entity_id camera action service template variable #35267

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions source/_integrations/camera.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand All @@ -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 %}
Expand All @@ -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.

Expand All @@ -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 %}
Expand Down