I’m new to HA, so sorry in advance but I’m trying to make a notification sent on my phone including a snapshot of the even to my iPhone/AppleWatch (only on “Person” notification and nothing else)
- id: '11111111111111'
alias: New Automation
description: ''
trigger:
- platform: state
entity_id: binary_sensor.motion_uvc_g4_pro
to: person
attribute: event_object
condition:
- condition: time
after: '21:00'
before: '10:00'
action:
- service: notify.mobile_app_kevins_iphone
data:
message: Person detected
title: Person
mode: single
This seems to work fine but
I’m getting a lot of notifications, for one even / notification with UniFi Protect, I’m getting like 7 notifications, is there a way to limit the notification? perhaps add a 30s delay in between notification?
I can’t find a way to add the snapshot to the notification
Another minor update with a few fixes and a change in the Services UI.
FIXED: Issues when activating Services that required an Integer as value, and using a Template to supply that value. Services Schemas have now been converted to use vol.Coerce(int) instead of just int.
CHANGED: All Services definitions have now been rewritten to use the new format introduced with the March 2021 Home Assistant release. NOTE: You might need to do a Hard Refresh of your browser to see the new Services UI.
FIXED: When using the switches or service to change recording mode for a camera, the recording settings where reset to default values. This is now fixed, so the settings you do in the App are not modfied by activating the Service or Recording mode switches.
Hey, Sorry missed your post. Here’s my automation, I think it’s the same thing @kentoe posted, but mine is using the doorbell as a trigger, not motion.
alias: doorbell thumbnail
description: ''
trigger:
- platform: state
entity_id: binary_sensor.doorbell_doorbell
from: 'off'
to: 'on'
condition: []
action:
- service: notify.staff
data:
message: Someone rang the doorbell
title: Office Doorbell
data:
image: /api/camera_proxy/camera.doorbell
actions:
- action: URI
title: View in HA
uri: lovelace/cameras
- action: URI
title: View in Protect
uri: 'app://com.ubnt.unifi.protect'
mode: parallel
max: 10
First of all kudos @briis for making a great custom component. Thank you!
Secondly, have anyone found a solution or a work around to the super annoying delayed live stream? I have a delay of around 20 seconds. As far as I see:
I did not have the problem with Unifi Video Edit: maybe this was because I used mpeg streams from blue iris to cast to the chrome casts and google hubs I have… However, I used the cameras in the Lovelace user interface.
Disabling the stream component does not make any difference
The cameras in the Frigate component does not have the same delay inside the Frigate view. However when I put the same (??) camera in a picture-entity, I get a delay.
Thank you for your answer. As far as I understand, RTSP2WebRTC gives you page/view in Home assistant where you may view your streams near real time. This works very well. It does not however provide you with a stream that you may recast real time to a chrome cast. I an at least unable to find any, but please correct me if I am wrong.
I was already am able to view the streams real time using the Frigate component (strongly recommended). I am however, not able to cast them to a chrome cast.
Since I found no other solution, I have set them up in Blue Iris again and cast the mjpg-stream from BI. This works without delay at all. I do still want to find a better solution than that, so all tips are appreciated.
Hi, new to this component as of yesterday… So, is there a way to differentiate between smart detections and actual motion events in Home Assistant? I have some motion zones set up so that my Unifi app doesn’t nag me too much, but if I wanted to have Home Assistant notify me instead, it seems that it would be all motion/detections regardless of the zones I have set up…
Check the attribute ‘event_object’ of the motion binary_sensor for your camera(s)
It shows either the smart detection type - person etc - or ‘None Identified’ for motion events.
Great it works for you now.
To complement what @TazUk wrote, you can also set the recording_mode so that it only triggers when there is a smart event. Just set the recording_mode to smart (Switch or Service). This requires you to have G4 series cameras.
So I recently updated some of my automations with this event_score value. But things weren’t working as I’d hoped. Then I realized last night that the event_score, as well as the length of time only fills in AFTER the motion event occurs.
I was hoping to trigger lights with this, but it seems like these attributes may only help for after-the-fact processing?
No. event_score and event_length attributes are populated at the end of the motion event when the binary_sensor returns to ‘off’.
I moved to post-event notifications to take advantage of this additional filtering and the thumbnail generation by Protect (which can take ~5 seconds on my UCK-G2+) because it gives me some enhanced notification filtering required because of the areas covered by several of our cameras. Also this resolves HA’s camera stream latency issues.
I am considering breaking out smart detections from this approach for our G4 bullet though, but it’s not high on my todo list.
Because this integration is pulling a proxied feed from the NVR there will be a delay. There is no RSTP available directly from Unifi cameras so the stream is being created from the NVR, however the other elements like doorbell press or motion sensors work great and nearly real time. Personally I leverage the ipad app for protect for cameras more than the integration if I want real time access to a stream. But for general access to cameras this solution has been really solid and consistent.