Camera Snapshot, Blue Iris, AI, Deepstack, Input Boolean, Notification

I use Blue Iris with VorlonCD AI Tool & Deepstack to detect motion. I have the VorlonCD AI Tool send an mqtt message when relevant motion is detected. I then use node-red to receive the message and turn on an input_boolean, then after 5 seconds the boolean is turned off. This blueprint will send a notification with image to your device. I can’t take full credit for this blueprint. I just adjusted an existing blueprint posted on this forum to fit my needs with an input_boolean.

All my cameras are in Home Assistant via the HACS Blue-Iris integration.

Here’s the original that I modified.

https://community.home-assistant.io/t/send-camera-snapshot-notification-on-motion/254565![BI_AI-Blueprint

Get started

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Or import this Blueprint by using the forum topic URL:

blueprint:
  name: Send Camera Snapshot on Input Boolean state change
  description: 'Sends a camera snapshot when on Input Boolean state change.

    '
  domain: automation
  input:
    input_boolean:
      name: Input Boolean
      description: The Input Boolean that triggers the snapshot creation
      selector:
        entity:
          domain: input_boolean
    camera:
      name: Camera
      description: The camera that creates the snapshot
      selector:
        entity:
          domain: camera
    notify_device:
      name: Device to notify
      description: Device needs to run the official Home Assistant app to receive
        notifications
      selector:
        device:
          integration: mobile_app
    is_ios:
      name: Is it an iOS device?
      description: Toggle if your selected device runs iOS, default is Android
      selector:
        boolean: {}
      default: false
    notification_title:
      name: Notification title (Optional)
      description: 'Default: "Motion detected!"'
      default: Motion detected!
    notification_message:
      name: Notification message (Optional)
      description: 'Default: "{{ input_boolean_name }} detected movement!"'
      default: '{{ input_boolean_name }} detected movement!'
    delay:
      name: Delay (Optional)
      description: Wait before creating camera snapshot
      default: ''
      selector:
        number:
          min: 0.0
          max: 60.0
          unit_of_measurement: seconds
          mode: slider
          step: 1.0
trigger:
  platform: state
  entity_id: !input 'input_boolean'
  from: 'off'
  to: 'on'
variables:
  input_boolean: !input 'input_boolean'
  input_boolean_name: '{{ states[input_boolean].name }}'
  camera: !input 'camera'
  notify_device: !input 'notify_device'
  is_ios: !input 'is_ios'
  notification_title: !input 'notification_title'
  notification_message: !input 'notification_message'
  delay: !input 'delay'
  snapshot_create_file_path: /config/www/tmp/snapshot_{{ states[camera].object_id
    }}.jpg
  snapshot_access_file_path: '{{ snapshot_create_file_path | replace(''/config/www'',''/local'')
    }}'
action:
- delay: '{{ delay }}'
- service: camera.snapshot
  entity_id: !input 'camera'
  data:
    filename: '{{ snapshot_create_file_path }}'
- device_id: !input 'notify_device'
  domain: mobile_app
  type: notify
  title: '{{ notification_title }}'
  message: '{{ notification_message }}'
  data: '{% set android_data = {"image": "%s"} | format(snapshot_access_file_path)
    %} {% set ios_data = {"attachment": {"url": "%s", "content_type": "JPEG"}} | format(snapshot_access_file_path)
    %} {{ ios_data if is_ios else android_data }}'

2 Likes

i saw your message in blueiris forum. there you mentioned nodered and mqtt, can you please explain how you using them?

I don’t understand what’s the difference between this modified one to the original one…
Isn’t it just takes the snapshot on motion from BI? it doesn’t matter what kind of AI runs in the background, so I’m confused what is the “improvement” here.

First time trying a Blueprint. I’d like to notify two devices (both iPhone). I tried making a Group (group.mobile_app) but the input selector did not recognized it. What is the recommended technic?

What did you use as input boolean? I am presently using mqtt directly from hassio and node-red to store snapshots. This looks like a simpler way to do this.