Help - Can't get basic script to work - Save Blink Camera Image to /tmp

Sorry, I’m new to HA, just installed it 2 days ago. I’m following the guide for installing Blink cameras, and they show up within HA. However, when I follow the directions on this script (while adjusting it to my camera names), it does nothing…

  alias: Take Garage Pic
  sequence:
  - data:
      name: Garage
    service: blink.trigger_camera
  - delay: 00:00:05
  - data: {}
    service: blink.blink_update
  - data:
      filename: /tmp/blink_garage_pic.jpg
    entity_id: camera.blink_garage
    service: camera.snapshot

I also added to configuration.yaml,

homeassistant:
  whitelist_external_dirs:
    - '/tmp'

When I run the script, I don’t get anything file output in the /tmp directory. I’ve been messing w/ this for a couple of hours now, and I can’t figure out what I’m doing wrong. I’ve not yet setup any scripts or automations, so I’m also learning as I go.

Anyways, appreciate the help!

Verify folder permissions for /tmp/ are correct for your home-assistant user, also is that supposed to be tmp from / the root of the drive or inside your config folder.

How do I verify folder permissions are correct? I have retested this w/ ‘/config/tmp’, and I do have a ‘/tmp’ folder.

I appreciate the help. Quite a bit of a learning curve for me… I’m making progress, but there’s a TON of trial and error going on.

So do you have a /tmp folder at the root of your drive? Because that’s where /tmp would be. If trying to do inside config folder you may want to try the full path /home/homeassistant/.homeassistant/tmp (if that’s how yours is)

As far as permissions, how did you install? If you have command line cd to the folder and “ls -al” will show you all files owners and permissions

I have updated to try and use /config/tmp. I installed a hassio on a VM. Assuming what you’re saying, I should point to - /home/homeassistant/.homeassistant/config/tmp?

If that’s your path to config… it should work with /tmp as well since you have it in the whitelist… was just making sure you had a folder at /tmp since that’s where it was pointing in your first example… did you get a chance to check the permissions?

Also… did you check the log after trying to save the image ? What does the error log say … I guess I should have asked that first. :grimacing:

I should have full permissions (as there aren’t any other users) file access - drwxr-xr-x.

Error log (which I don’t know how to make sense of) is,

Logger: homeassistant.core
First occured: 6:41:51 PM (2 occurences)
Last logged: 8:05:06 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 247, in async_run
    await self._handle_action(action, variables, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 331, in _handle_action
    await self._actions[_determine_action(action)](action, variables, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 413, in _async_call_service
    context=context,
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 101, in async_call_from_config
    domain, service_name, service_data, blocking=blocking, context=context
  File "/usr/src/homeassistant/homeassistant/core.py", line 1208, in async_call
    processed_data = handler.schema(service_data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: required key not provided @ data['filename']

Oh, try quotes around the path … sorry

Unfortunately, that also didn’t work. Same exact error.

entity_id has wrong indent, try something more like that:

  alias: Take Garage Pic
  sequence:
  - data:
      name: Garage
    service: blink.trigger_camera
  - delay: 00:00:05
  - data: {}
    service: blink.blink_update
  - data:
      filename: /tmp/blink_garage_pic.jpg
      entity_id: camera.blink_garage
    service: camera.snapshot
2 Likes

Thank you, that worked!