#Where do automation step files get written?

16 messages · Page 1 of 1 (latest)

tepid kettle
#

So, in a home assistant automation, if I have something written to a file -- say, "Camera, take snapshot" -- saved in /tmp/doorbell.jpg , where is that written?

My HA is Home Assistant OS.

I'm trying to troubleshoot it because I am 99% sure that the image file is empty or malformed in some way, given that every single notification I've received for this has been the same description, regardless of who or what is at the door.

This is the automation:

alias: Describe front door motion
description: ""
triggers:
  - entity_id:
      - binary_sensor.doorbell_motion_detected
    to: "on"
    trigger: state
conditions: []
actions:
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - action: camera.snapshot
    metadata: {}
    data:
      filename: /tmp/doorbell.jpg
    target:
      device_id:
        - ec0d36d6966b049509503e3e9e3378a6
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
  - action: google_generative_ai_conversation.generate_content
    metadata: {}
    data:
      image_filename: /tmp/doorbell.jpg
      prompt: >-
        Describe briefly who is at the front door. Look for things you'd
        commonly see at a house front door, like a delivery person or visitor.


        Don't hallucinate things; if the image is blank or otherwise not of a
        view from a doorbell, indicate that.
    response_variable: description
  - action: notify.mobile_app_null_15
    metadata: {}
    data:
      title: Front door person detected
      message: "{{ description.text }}"
mode: single
low berry
#

It would be saved to the /tmp directory within the Core container.

tepid kettle
#

How do I access that container? I've got the ssh addon set up, but honestly that seems to be about the least useful admin tool; I can't (as far as I can tell) even get into other containers from it 😄

#

(I thought perhaps the ssh addon was showing me the filesystem from the core container, but /tmp/doorbell.jpg isn't there:

[core-ssh ~]$ ls /tmp
ssh-XXXXOCIdkN

)

low berry
#

You need to docker exec -it [your core container name/id] bash into it. You can get the list of container names from docker ps -a.

tepid kettle
#

That was my original plan:

[core-ssh ~]$ docker ps
-bash: docker: command not found

Seems that the ssh addon doesn't have a docker CLI in it.

low berry
#

I think you need the Advanced SSH addon, but I don't run HAOS, so I'm not entirely sure. 😦

tepid kettle
#

TIL about that one; I'll give it a try!

neat moon
#

Yes, you need the Advanced SSH & Web Terminal with disabled safe mode to use the docker cli.

#

If safe mode is enabled, it will throw angry yellow text.

tepid kettle
#

That did the trick, thanks!

sleek crescent
#

If you save it into the config folder instead then it'll be easier to see. And if you save it into the www folder in the config then you can even send it in a notification

tepid kettle
#

(I would also wonder, is there a filesystem I should be using instead of the container-local /tmp path, that would make this more ... okay, @sleek crescent answered that as I typed 🙂 )

sleek crescent
#

(Specifically that the file path needs to be added to allowlist_external_dirs)