Snapshot camera has a bug?

Hi, I made an automation that will send me an email with a snapshot of my front camera when ever someones triggers it. see attached code:

- id: '1576949983926'
  alias: Send pic to phone
  description: Send a pic to my phone if alarm is on and line is crossed
  trigger:
  - entity_id: binary_sensor.framsidan_line_crossing
    platform: state
    to: 'on'
  condition:
  - condition: state
    entity_id: input_boolean.alarm_on
    state: 'on'
  action:
  - data:
      filename: /config/cctv/framsidan_1.jpg
    entity_id: camera.framsidan
    service: camera.snapshot
  - data:
      data:
        images:
        - /config/cctv/framsidan_1.jpg
      message: Vem är detta?
      title: Larm
    service: notify.hemma_larm

When I trigger it through hassio it does as it should, sends me a pic.

When I try to trigger it by crossing the line IRL, it sends me an email with a corrupt (or empty) jpg… When I try to open the jpg through ssh to view it manually it is also corrupt (or empty).

Any ideas on what is going on, is there a bug here? Since I can not figure out why triggering it though hassio would function and triggering it IRL would not… Code is the same…

Have you tried to simply trigger a snapshot from the services tab on the developer tools page?

But does the it create a working jpeg?

Well I get this:
Attachment /config/cctv/framsidan_1.jpg has an unknown MIME type. Falling back to file

After clearing that and trying again I do not get that error again

Yes, now that the error was cleared and not comming back it does.

This is the command:
image

Any ideas on this? It seems like it is 50/50, one pic is sent correctly, the other is sent as corrupted?

Same camera, same settings, when triggering the automation manually I always get a correct picture sent to me…

Reviving an old thread but did you ever figured this out?

I’m using 2 Hikvisions, set up identically and only one gives me usable pictures… doesn’t make sense to me

Hey, no it started working much better after an update, I think it was 101, so now it works 90% of the time, I am waiting for the push notification system to enable local images to be pushed to solve this issue.

Hi, this is still an issue even when sending snapshots through the mobile app, I can access them on lan and wan, there is no issue with connection or permission, when triggering the automation manually I get the desired behavior with the app showing me a snapshot, but sometimes I do not get an image even thou I get the notification, when trying to open the image manually through the web adress to the storage path “myip”/local/“image path”, the image is just a grey frame on black screen, so it is corrupt in some ways. Any idea on how to fault search this?

Having the same problem as in this , anyone worked out what we’re doing wrong?

I “fixed” the issue by using the notification function of the native app, so I send my self a screenshot using this code in the automation:

service: notify.mobile_app_yourname
data:
  message: Message tex
  data:
    image: 'https://yoururl/local/snapshot.jpg'