Saving videos on a directory with Blink

Greetings,

I’ve been trying to save videos with Blink using the example on Blink’s integration page:

- 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"

Problem is that the videos are being saved as is “blink_video_{{ now().strftime(’%Y%m%d_%H%M%S’) }}.mp4” instead of blink_video_year_month_day_hour_minute_second".
Any ideas?

Many thanks!

Hmm, yeah I think the example in the Blink docs are wrong. Try getting rid of the quotes around the file name and see if that works

Thanks @fronzbot! I tried that already (and just now too) but it’s the same.

So I just tested it on my end and got the expected blink_YYmmdd_HHMMSS.mp4 syntax. So I’ve got no idea why it’s not working on your end. Hopefully someone with more jinja/templating expertise can comment.

1 Like

Very strange, tried all sorts of combinations with no luck.

Actually, I rescind my last statement. I was just checking the template syntax (which worked) but I actually think this is a bug with the save_video routine in the component. I’ll test some more when I get out of work to see if I can replicate and then fix this problem.

1 Like

Thanks, @fronzbot, appreciate the help!

Yup, it was a bug. PR to fix it is here --> https://github.com/home-assistant/home-assistant/pull/24918

1 Like

Thanks for the update!

I did the changes that were on your PR and they are now recording correctly with the right name. One thing I notice is that some of the videos are corrupt (the file has 40 bytes) and it’s random. I will enable debug for blink and see if I get anything there, if I do, I will post here.

I can’t seem to get save video locally to work for me. I got the snapshot working but can’t get save video working. here’s my config:

automations.yaml

- id: save_blink_video_on_motion_kitchen
  alias: Save Blink Video on Motion Kitchen
  trigger:
    platform: state
    entity_id: binary_sensor.blink_kitchen_motion_detected
    to: 'on'
  action:
    service: blink.save_video
    data:
      name: "Kitchen"
      filename: "/www/blink_video {{ now() }}.mp4"

here’s my working snapshot script config if that matters

scripts.yaml

blinkkitchencamsnap1564782119078:
  alias: Blink Kitchen Cam Snap
  sequence:
  - data:
      name: Kitchen
    service: blink.trigger_camera
  - delay: 00:00:05
  - service: blink.blink_update
  - data:
      entity_id: camera.blink_kitchen
      filename: /config/www/kitchen snap taken {{ now().strftime("%m-%d-%y %I%M%p")
        }}.jpg
    service: camera.snapshot

Did you ever figure it out?
I too have the same video issue downloading but snaps work fine.

I have not been able to figure mine out yet no. It’s lower on my list just been too busy, let me know if you make any progress?