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

camera.record will not support multiple entities anymore when entity_id should be part of the filename template #131779

Open
NODeeJay opened this issue Nov 28, 2024 · 3 comments

Comments

@NODeeJay
Copy link

NODeeJay commented Nov 28, 2024

The problem

With the the change #128592 discussed in #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?

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

@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (camera) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of camera can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign camera Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


camera documentation
camera source
(message by IssueLinks)

@billsq
Copy link
Contributor

billsq commented Dec 13, 2024

try write your action like this, using repeat:

repeat:
  sequence:
    - action: camera.record
      target:
        entity_id:
          - "{{ repeat.item.cam }}"
      data:
        filename: /tmp/{{ repeat.item.cam }}.mp4
  for_each:
    - cam: camera.cam1
    - cam: camera.cam2
    - cam: camera.cam3

@illuzn
Copy link

illuzn commented Jan 12, 2025

@billsq Unfortunately that solution doesn't work... it triggers a sequential record i.e. it records cam1 for 30s (default) then cam2 for 30s then cam3. Obviously the use case generally, is that an important event has occurred e.g. alarm triggered and you want to record all cameras at the same time.

I've provided a workaround in the other thread regarding this from 2020.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants