I thought I would try the below in order to see if I could get the Kitchen Camera to display the Kitchen Alex Display when motion is detected. Here is the code:
@anixan, I think you are asking for help in the wrong place. The Unifi component simply creates camera entities that you can stream. As far as HA is concerns itās just another camera. You would probably get MUCH better feedback asking the question in an Alexa related thread (especially one that deals with streaming cameras).
I would help if I could, but like a lot of others in this thread, I do not use Alexa.
@anixan, there is currently no clear way to do what you want. Many of us are looking for the same thing. consider the monoclecam.com skill in alexa. I have been using monocle with voice commands to launch the camera on a show device for a couple of years and it works great. Please remember that there is limited local exposure to the alexa show, so integrating with an alexa skill is your best bet.
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.