I’m getting the same warnings, at first I just placed {{ entity_id }} without anything else, but then i got the same warning again…
NODeeJay
(Alexander Weber)
November 24, 2024, 2:38am
22
But how to handle actions with multiple entities. Do we need to create an action for every camera?
I tried entity_id as in the documentation Camera - Home Assistant , entity_id.entity_id and entity_id.name, all throw the error through spook.
Have you find a solution for this error? because on the official Home Assistant instructions it even says to use {{ entity_id }}
NODeeJay
(Alexander Weber)
November 28, 2024, 12:31am
24
Well, no, but the cause: Camera.record service not working with entity_id.name in template, says entity_id is undefined · Issue #40241 · home-assistant/core · GitHub and see the commit below: Deprecate entity_id template variable in camera services by emontnemery · Pull Request #128592 · home-assistant/core · GitHub
I tried to find hints how I could do this with a variable but how do I step through them?
In the end I filed a bug, maybe add your thumbs there to gain a bit more attraction:
opened 12:29AM - 28 Nov 24 UTC
integration: camera
### The problem
With the the change https://github.com/home-assistant/core/pu… ll/128592 discussed in https://github.com/home-assistant/core/issues/40241 the option to use the variable `entity_id` in a filename template when multiple entities are provided will not work anymore, however it was mentioned several times in the thread by multiple users.
this:
```
action: camera.record
target:
entitiy_id:
- camera.cam1
- camera.cam2
- camera.cam3
data:
filename: {{ entity_id }}.mp4
```
will not work anymore and I did not find a way to pass an array to the variable one should define as suggested in the docs.
### What version of Home Assistant Core has the issue?
2024.11
### What was the last working version of Home Assistant Core?
2024.10
### What type of installation are you running?
Home Assistant OS
### Integration causing the issue
Camera
### Link to integration documentation on our website
https://www.home-assistant.io/integrations/camera/#action-record
### Diagnostics information
_No response_
### Example YAML snippet
_No response_
### Anything in the logs that might be useful for us?
```txt
A repair message is shown:
The pre-defined template variable entity_id was used when performing action camera.record targeting camera entity camera.cam_driveway_low_latency. The pre-defined template variable entity_id is being removed from the filename parameter of camera.record.
Please update your automations and scripts to use a manually defined variable instead and select Submit to close this issue.
```
### Additional information
_No response_
The docs are uptated, above the variable is in the example defined first and then used in the camera.record action:
actions:
- variables:
entity_id: camera.yourcamera # Store the camera entity_id in a variable for reuse
NODeeJay:
The docs are uptated, above the variable is in the example defined first and then used in the camera.record action:
actions:
- variables:
entity_id: camera.yourcamera # Store the camera entity_id in a variable for re
I’m not sure I read this correctly, but if I do, the documentation is very misleading:
My understanding: entity_id in variables, is just a variable with a poor choice of name being the same as the argument “entity_id” of the service snapshot. So the {{ entity_id }} in the filename, is not the snapshot argument, but the user defined variable above.
Can someone test this by changing the name of that variable and see if it works the same in the automation?
In any case, I managed to fix my own problem in Node Red by changing
{"filename":"/config/www/tmp/snapshot_{{ entity_id.entity_id }}.jpg"}
to
{"filename":"/config/www/tmp/snapshot_"&msg.camera_entity&".jpg"}
Where msg.camera_entity is the name of my camera, passed in the msg in node red (in my case, it’s defined in the previous node). The point is to have a generic snapshot+notification flow, for multiple cameras.
parautenbach
(Pieter Rautenbach)
January 21, 2025, 9:04pm
26
tipouletdomo:
My understanding: entity_id in variables, is just a variable with a poor choice of name being the same as the argument “entity_id” of the service snapshot. So the {{ entity_id }} in the filename, is not the snapshot argument, but the user defined variable above.
You can name the variable whatever you want.
Thanks for the reply. Do you know how to suggest editing the documentation? If an admin reads us
parautenbach
(Pieter Rautenbach)
January 23, 2025, 4:32am
28
Every page has a link to GitHub to edit it.
Thanks, proposed a pull request for it
home-assistant:current ← poulti:patch-1
opened 08:13PM - 27 Jan 25 UTC
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`
<!--
You are amazing! Thanks for contributing to our project!
Please, DO NOT DELETE ANY TEXT from this template! (unless instructed).
Before submitting your pull request, please verify that you have chosen the correct target branch,
and that the PR preview looks fine and does not include unrelated changes.
-->
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
## Type of change
<!--
What types of changes does your PR introduce to our documentation/website?
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR.
-->
- [X] Spelling, grammar or other readability improvements (`current` branch).
- [ ] Adjusted missing or incorrect information in the current documentation (`current` branch).
- [ ] Added documentation for a new integration I'm adding to Home Assistant (`next` branch).
- [ ] I've opened up a PR to add logos and icons in [Brands repository](https://github.com/home-assistant/brands).
- [ ] Added documentation for a new feature I'm adding to Home Assistant (`next` branch).
- [ ] Removed stale or deprecated documentation.
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- Link to parent pull request in the codebase:
- Link to parent pull request in the Brands repository:
- This PR fixes or closes issue: fixes #
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [X] This PR uses the correct branch, based on one of the following:
- I made a change to the existing documentation and used the `current` branch.
- I made a change that is related to an upcoming version of Home Assistant and used the `next` branch.
- [X] The documentation follows the Home Assistant documentation [standards].
[standards]: https://developers.home-assistant.io/docs/documenting/standards
1 Like