Problem with image data stream to pushbullet

I have written the below script to send a pushbullet when my Dafang security cam have identified movement.

The “camera.dafang_motion_snapshot” seems to be raw data of some kind:

data:image/jpeg;base64, /9j/2wBDAAgGBgcGBQgHBwcJC…

When the script is executed I get data error. Do I need to export the raw data to a file before I send it to pushbullet?

security_cam_alert:
alias: ‘security_cam_alert’
sequence:
- service: notify.pushbullet
data:
title: Security cam have identified movement
message: Security cam have identified movement!
data:
file: camera.dafang_motion_snapshot

I finally solved this by adding the following to the script and then using the same filename to send to pushbullet.

  • service: camera.snapshot
    data:
    entity_id: camera.dafang_motion_snapshot
    filename: “/config/www/cam_captures/snapshot.jpg”