Can't get camera.record to work

Hi there,
I have some Dahua cameras and while all other functions work perfectly (e.g. streaming to frontend) I cannot get this function to work and would really appreciate some help from the community if possible.

I am trying a super simple service call from the Developer tools tab

Untitled

The above example is me trying with camera installed as a generic camera rather than the Dahua integration but neither work. No file is ever written.

I have included /tmp in the configuration.yaml

homeassistant:
allowlist_external_dirs:
- “/tmp”

There is absolutely nothing coming up in logs at all related to when I hit the service call. The only thing that appears related to the cameras is this which pops up from time to time.

2024-02-16 13:06:00.441 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/site-packages/turbojpeg.py:901: UserWarning: Corrupt JPEG data: 608 extraneous bytes before marker 0xfe

I’m running HAOS on a proxmox VM all updated with latest versions but was having same issue on versions going back ~2/3 months.

Cameras are DH-IPC-HDW3849H-AS-PV-ANZ-BLK

All thoughts/help appreciated.

First of all: I am currently running Core 2024.2.1 and I also use Home Assistant in a VM.

For example, I use a simple automation to start recording with a Dahua camera when someone presses the bell button on my Amcrest AD110. The Dahua camera (192.168.1.87) is also integrated as a generic camera. The recordings are then saved under Media and are then available under Media Sources → My media.
HA_My_media

Integrating the media directory:

homeassistant:
  customize: !include customize.yaml
  allowlist_external_dirs:
    - "/media"

Automation:
AD_Press_Button_Record
YAML-Code:

alias: AD110 Button Press Aufnahme starten
description: AD110 Button Press Aufnahme starten
trigger:
  - type: sound
    platform: device
    device_id: 81f96411aea25128287f4c102305b51a0
    entity_id: 7e9365a358124601233805197b791d4e9
    domain: binary_sensor
condition: []
action:
  - service: camera.record
    data:
      duration: 30
      lookback: 0
      filename: /media/{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4
    target:
      entity_id: camera.192_168_1_87
mode: single

Maybe this helps you. :slightly_smiling_face:

jim_os thanks for taking the time to respond.

I changed the target directory from /tmp to /media and it worked!
Despite defining /tmp in the allowlist it seems the camera.record function didn’t like it being the target directory.

Really appreciate your help, thanks again.