Hikvision camera photo in iOS notification

Hey guys, I have Hikvision NVR with 5 x IP cameras, an Aeotec multi-sensor outside the front door. I have setup iOS notification for when the sensor picks up a motion. That works well. Is it possible to add a photo from my front door camera in the notification?

I’ve added the Hikvision motion sensor binary, and that works fine. But I haven’t added any video streams or photos

My sensor motion detection automation
- alias: iOS notification - Motion detected at front door!
trigger:
platform: state
entity_id: sensor.aeotec_zw100_multisensor_6_burglar
from: ‘0’
to: ‘8’
action:
service: notify.ios_devices
data:
message: “Motion detected at the front door!”

image

Hi,

I’m using this code to send a notification with a live stream from my Hikvision camera when someone press the doorbell. Maybe it can help you to create what you want…

- alias: 'Huskamera dörrklocka'
  trigger:
    - platform: event
      event_type: button_pressed
      event_data: {"entity_id": "switch.dorrklocka_koksentre"}
  action:
    - service: notify.ha_push_group
      data:
        message: "Write your message hear..."
        data:
          attachment:
            content-type: jpeg
          push:
            category: camera
          entity_id: camera.huskamera
    - delay: 0:10
1 Like

@anasazi great, thank you. I’ll give it a try. Other than the Hikvision sensor in the config file what else have you added?

I wanted to do the same and also played with the live stream options discussed above. However it did not meet my needs. Reasons are twofold 1) the ios notifications just disappears once looked at (so no history) 2) as it is a live stream it’s useless if you dont look at the notification right away.

If you are fine with losing the notifications (so stick with ios app) you can also use the following code:

# Code om via de IOS app een alert te sturen als een sensort van status veranderd
- alias: propertylinecrossed
  trigger:
    platform: state
    entity_id: binary_sensor.voordeurh_field_detection
    to: 'on'
  action:
    - service: notify.ios_iphone_name
      data_template:
        title: 'Bezoeker!'
        message: >
          ‘Bezoeker gedetecteerd om {{now().strftime("%H:%M %d-%m-%Y")}}’
        data:
          attachment:
            url: http://username:password@ipaddress:port/Streaming/channels/1/picture
            content-type: jpeg

I also have code using pushover that sends a snapshot as an attachment, this is what I use as it saves the notifications send+you can access on different platforms (ie a browser)

Great thank you. What do you use for the pushover method?

First i used an updated pushover.py to be able to send attachments, see here; https://community.home-assistant.io/t/pushing-images-with-pushover-3-0/40667/17?u=bigben

Than I use this:

- alias: Bezoeker
  trigger:
    platform: state
    entity_id: binary_sensor.voordeurh_line_crossing
    to: 'on'
  action:
    - service: notify.pushover_ha
      data_template:
        message: 'Bezoeker om {{now().strftime("%H:%M %d-%m-%Y")}}'
      data:
        title: "Home Assistant"
        data:
          priority: 0
          sound: intermission
          file:
            url: http://username:password@ip:port/Streaming/channels/1/picture