Camera - Send & Save snapshot to mobile device when motion is detected with Conditions. Now with Custom Triggers!

I just tested mine with
https://<HA_URL>/lovelace/calibration
on my android and it opened the browser and navigated to the url. Its something. What does yours do?

take a look at this:

adding

homeassistant:
  media_dirs:
    local: /media

to configuration.yaml
I’ve had limited success, pointing to /media/local/... but cannot get the image to update after the first trigger.

And not that I need you to tell me what <HA_URL> is … but …

Do you use Nabu Casa or?

If you use Nabu Casa is the value the URL to your Nabu Casa instance?
If you do not, and you are doing like ###.###.###.###:8123/lovelace/calibration?

I use duck DNS, but you can use the Nabu Casu URL without the :8123

The YAML looks like this:

service: notify.mobile_app_mi_iphone
data:
message: Front Door Visit
title: "Front Door "
data:
sound: doorbell-1s.wav

The door bell (or any short sound) sound is held locally and in the media / sound file of the Home Assistant server as a wav or mp3 file.

1 Like

I’ve made some changes, adding options for custom sounds on iOS, moving snapshot to /media and more!

I think I got that fixed, I was missing something and I think I got it to work with sending the snapshot from /media now! No more exposing to internet

OK, well I just use this which works perfect (nabu address x’d out of course):

alias: Test Send Image
variables:
  server: https://xxxxxxxxxxxxxxxx.ui.nabu.casa
  camera_location: gate
  camera_entity: camera.rc_{{camera_location}}_fluent
  image: "{{state_attr(camera_entity,'entity_picture')}}"
  camera_name: "{{state_attr(camera_entity,'friendly_name')}}"
  phone: kevin_phone
sequence:
  - service: notify.mobile_app_{{phone}}
    data:
      message: Current Status of {{camera_name}}
      data:
        image: "{{server}}{{image}}"
mode: single

I have that as a script and then use an automation that calls that script and passes in the “trigger.id” to the “camera_location” variable which is like “gate” or “intercom” or “driveway”.

image

Now I can iterate through all phones and send notifications from multiple locations and get the images without “any” storage, just grabbing the camera’s feed. ONly thing that would make this totally awesome would be to somehow get the automation’s Nabu Casa URL so that I could copy the same thing onto multiple Home Assistant’ and use it (meaning not hardcoding the Nabu URL). But I will just create a variable based on something that gives Nabu URL based on it in a simple sensor.

2 Likes

Hi,
I am in need of some help configuring. When I first setup the blueprint a couple days ago it was working fine. Once I came back a few days later, it would correctly takes a snapshot and saves last_motion and achieve, but the picture on the notification is the last picture I took when I tested it. Can you help? @TheRealFalseReality

re: I’ve updated to v2 which is working fine on Android, but Notification doesn’t go through to ios.
rere: I found this error log

rerere: Following the error I # all volume setting and notification is working correctly.

Hmm, not sure on the iOS. I only have Android devices. I re-wrote the blueprint using variables for the parameters for the Notification component, so I was hoping it would all work. But maybe the format isn’t right for iOS. Is anyone else having an issue on iOS

Just saw the final edit, is it all working?

1 Like

It is working with all volume setting code disabled.

1 Like

ok, I wish I could debug but no iOS devices here…

1 Like

I will try to debug and see if I can come up with a fix. I think the volume selector should pass value between 0 to 1 instead of 0 to 100.

ok and yes! easy fix!

What do you all thin about actions added to the notifications? Like sound an alarm or update snapshot? I’ve been playing around with it on another automation for my fish tank.

Thank you for this great blueprint.
But in IOS critical or not critical is the same. Is ‘always critical’.Off, On, On During the Day, On During the Night, and On Between 6p - 8a doesn’t work.
And the thumb doesn’t show


Sorry my english!

The following is the solution to the various iOS notification error

    notification_volume:
      name: Critical Notification Volume - iOS Only (Optional)
      description: Specify a sound level %
      default: 100
      selector:
        number:
          max: 100.0
          min: 0.0
          unit_of_measurement: "%"
          step: 1.0
          mode: slider
                  push:
                    sound:
                      name: !input notification_sound
                      volume: "{{ (notification_volume / 100) | float }}"
                      critical: "{{ 1 if notification_critical == 'true' else 0 }}"

I’ve reverted the volume code. Volume code only control volume for critical notification and not the regular notification. Documents need to be updated to reflect limited function.

Critical Notification always defaulted to 1 due to the fact that notification_critical selector dealt false and true as string and not boolean. When attempted to fix the selector with correct punctuation mark, it would cause a grammatical issue. Instead of fixing selector block I decied to fix how data block is handling true and false.

ChatGPT is the king

FYI. iOS bugs still under investigation

  1. When long press the notification shows live feed of camera instead of snapshot.
  2. Clicking the notification doesn’t send to URL

Investigated issue.

  1. It seems like having entity_id: !input camera at the data block is bringing live feed to iOS notification. It is fine for the camera that live is important but for me snapshot is priority and live view has like 6 sec delay.

  2. This was due to the fact that clickable action was not set for iOS.

Solution

                  alert_once: !input notification_alert_once
                  notification_icon: !input notification_icon
                  #entity_id: !input camera
                  actions:
                    action: "URI"
                    uri: !input data_clickaction_url
                  push:
                    sound:
                      name: !input notification_sound
                      volume: "{{ (notification_volume / 100) | float }}"
                      critical: "{{ 1 if notification_critical == 'true' else 0 }}"

1 Like

You have to long press to expand the thumbnail

[quote=“chowhi123, post:78, topic:604156”]

                  alert_once: !input notification_alert_once
                  notification_icon: !input notification_icon
                  #entity_id: !input camera
                  actions:
                    action: "URI"
                    uri: !input data_clickaction_url
                  push:
                    sound:
                      name: !input notification_sound
                      volume: "{{ (notification_volume / 100) | float }}"
                      critical: "{{ 1 if notification_critical == 'true' else 0 }}"

Thank you!
The sound and critical now works ok!

Like this when I long press to expand the thumbnail doesn’t work.

                  alert_once: !input notification_alert_once
                  notification_icon: !input notification_icon
                  #entity_id: !input camera
                  actions:
                    action: "URI"
                    uri: !input data_clickaction_url
                  push:
                    sound:
                      name: !input notification_sound
                      volume: "{{ (notification_volume / 100) | float }}"
                      critical: "{{ 1 if notification_critical == 'true' else 0 }}"

But like this when I long press to expand the thumbnail works ok.

                   alert_once: !input notification_alert_once
                   notification_icon: !input notification_icon
                   entity_id: !input camera
                   actions:
                     action: "URI"
                     uri: !input data_clickaction_url
                   push:
                     sound:
                       name: !input notification_sound
                       volume: "{{ (notification_volume / 100) | float }}"
                       critical: "{{ 1 if notification_critical == 'true' else 0 }}"

The only thing missing is the thumb.
ios

Thank you for your great help!

1 Like

ok, I will remove the entity_id: !input camera line as default, as that is for iOS devices to use video if supported. But it seems to be blocking the thumbnail weather or not video is supported. I will change that to an option in the future.

Also, I fixed the volume, it can either 0 or 1, so I limited it to 1 as the max. I may turn this into a boolean later but for now, 0 or 1.

1 Like