Snapshot on ios notifications

Hey there. Trying to configure notification with camera image. For now I have dynamic one, but I want to get image at triggering time.

I am trying first to get snapshots from this instruction. Here is what automation I have:

  action:
    service: camera.snapshot
    data:
      entity_id: camera.ffmpeg
      filename: '/tmp/camera.ffmpeg_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'

and I am getting this in logs when triggering it:

Can't write /tmp/camera.ffmpeg_20181001-215447.jpg, no access to path!

Can not figure out where I am wrong

I understand that issue may be here:

The path part of filename must be an entry in the whitelist_external_dirs in your [homeassistant:](https://www.home-assistant.io/docs/configuration/basic/) section of your configuration.yaml file.

But can not really understand what to write in configuration.yaml

I use the following in the homeassistant: section of configuration.yaml

whitelist_external_dirs: !include whitelist_external_dirs.yaml

Then in the whitelist_external_dirs.yaml file just include the paths for example this is part of mine. You should be able to just add the last line. I think you can do it directly in the configuration.yaml but this way allows you to add more if you need them later.

- /sys/class/thermal/thermal_zone0
- /sys/devices/virtual/thermal/thermal_zone0
- /tmp
1 Like

Now I can get snapshots in my folder, but can not send it to iphone. How should it be done?
Here is what I have:

- id: '1324567345563'
  alias: Test snap
  trigger:
  - entity_id: binary_sensor.door_window_sensor_158d0001dcb0e3
    platform: state
    to: 'on'
  action:
  - data:
      entity_id: camera.generic_camera
      filename: '/config/tmp/camera.generic_camera_fire.jpg'
    service: camera.snapshot
  - data:
      data:
        file: '/config/tmp/camera.generic_camera_fire.jpg'
      title: "Внимание"
      message: "Было зафиксирование действие в {{now().strftime('%H:%M %d-%m-%Y')}}"
    service: notify.ios_argo

Maybe the issue is in timing and there is not yet image when HA tries to send me a notification?
I just get notification without image

Nope, I tried to get a snapshot witch already existed, again only text in notification

Tried this:

  action:
  - data:
      entity_id: camera.generic_camera
      filename: /config/tmp/camera.generic_camera_fire.jpg
    service: camera.snapshot
  - delay: 
      seconds: 5
  - service: notify.ios_argo
    data:
      title: "Presence Detected at kitchen"
      message: "1.- presence_kitchen_notifications_when_detected - Occupancy Detection - kitchen - Notifications"
      data:
        photo:
          - file: "/config/tmp/camera.generic_camera_fire.jpg"
            capture: Snapshoot

Same thing again, only text.

Anyone can say anything? Is it even possible to get snapshot on ios notification?

Same problem!
I have the snapshot but cant send it to the IOS notification?

# Garageport IOS notification
  - alias: Notify IOS garageport is open
    initial_state: true
    hide_entity: true
    trigger:
      - platform: state
        entity_id: cover.sonoff_sv_garage
        from: 'closed'
        to: 'open'
    action:
      - service: notify.ios_group_caspersen_home
        data:
          title: "Garageport status"
          message: "Garageporten er åben {{ states('sensor.time') }}"
          data:
            push:
              sound: "US-EN-Daisy-Garage-Door-Open.wav"
              badge: 0 ## This will remove the badge/app icon number ##
              category: 'garage1'
              data:
                file: '/config/tmp/axis_m1031w15.jpg'

Okay I found this dont know if this is still valid?

One thing I don’t like about this setup is that the picture saved in www folder is accessible from the internet, without the need of a password. That is also the reason why ios notification is able to access it. Is there any other method to do this more securely?

2 Likes

I got it working…