Blink Integration Scripts for dummies

Hi I am using the blink integration. But I can’t get the scripts working.

Here is what I did:

-First I allowed the /tmp folder in the configuration.yml

homeassistant:
  allowlist_external_dirs:
    - "/tmp"

-Restart Home Assistant

-tmp folder exists (checked in the terminal)


[core-ssh ~]$ ls -la /tmp/
total 16
drwxrwxrwt    1 root     root          4096 Jul 26 16:35 .
drwxr-xr-x    1 root     root          4096 Jul 24 15:14 ..
drwxr-xr-x    2 root     root          4096 Jul 24 15:15 .bashio
drwx------    2 root     root          4096 Jul 24 17:44 tmux-0
[core-ssh ~]$

Settings → Automation & Scenes → Scripts → Add Script → Create New Script → Edit in YML

Pasted this:

alias: "Blink Snap Picture"
sequence:
  - service: blink.trigger_camera
    target:
      entity_id: camera.blink_my_camera
  - delay: 00:00:05
  - service: blink.blink_update
  - service: camera.snapshot
    target:
      entity_id: camera.blink_my_camera
    data:
      filename: /tmp/my_image.jpg

I tried it like this and also changed it to this because my camera is called Garage in the App.

alias: Blink Snap Picture
sequence:
  - service: blink.trigger_camera
    data: {}
    target:
      entity_id: camera.garage
  - delay: "00:00:05"
  - service: blink.blink_update
    data: {}
  - service: camera.snapshot
    target:
      entity_id:
        - camera.garage
    data:
      filename: /tmp/my_image.jpg

I don’t get any file in the /tmp directory.

I also added multiple cameras to the script like this:

alias: Blink Snap Picture
sequence:
  - service: blink.trigger_camera
    data: {}
    target:
      entity_id:
        - camera.garage
        - camera.haus
        - camera.nebengebaude
  - delay: "00:00:05"
  - service: blink.blink_update
    data: {}
  - service: camera.snapshot
    target:
      entity_id:
        - camera.garage
        - camera.haus
        - camera.nebengebaude
    data:
      filename: /tmp/my_image.jpg

also no success.

I also tried another script which I want to use:

- id: save_blink_video_on_motion
  alias: "Save Blink Video on Motion"
  trigger:
    platform: state
    entity_id: binary_sensor.blink_my_camera_motion_detected
    to: "on"
  action:
    service: blink.save_video
    data:
      name: "My Camera"
      filename: "/tmp/videos/blink_video_{{ now().strftime('%Y%m%d_%H%M%S') }}.mp4"

Here I get the message when I want to save the script:
Message malformed: expected a dictionary

Can anyone explain me how to use this integration and what I am doing wrong here.

I am using a Sync Module 2 and 3 x Blink Mini Cameras.

1 Like

:thinking:

filename: /config/tmp/..........

Hi,
yes this helped now I get the file.

Is it possible to have one script and use 3 cameras in it and save a file for each camera with the camera name. I am not sure of the syntax but something like this.

alias: Blink Snap Picture
sequence:
  - service: blink.trigger_camera
    data: {}
    target:
      entity_id:
        - camera.garage
        - camera.haus
        - camera.nebengebaude
  - delay: "00:00:05"
  - service: blink.blink_update
    data: {}
  - service: camera.snapshot
    target:
      entity_id:
        - camera.garage
        - camera.haus
        - camera.nebengebaude
    data:
      filename: >-
        /config/tmp/blink_image_{"target.${entity.id}}_{{now().strftime('%Y%m%d_%H%M%S')}}.jpg

How can I put the snapshot later to the dashboard ?

your step by step explanation really helped me a lot!
(Even though it was actually meant as a question)

I don’t understand why the instructions on “Blink - Home Assistant” etc. are not formulated so clearly…

did you find a solution to show the updated pictrure in lovelace?

no not yet :frowning: