NRCHKB / node-red-contrib-homekit-bridged

Node-RED Contribution - HomeKit Bridged : Node-RED nodes to simulate Apple HomeKit devices.
https://nrchkb.github.io
MIT License
416 stars 52 forks source link

Help with doorbell rich notifications #302

Closed crxporter closed 4 years ago

crxporter commented 4 years ago

Sorry for reviewing an old threat, but I am struggling with the rich notifications as described by others in this thread. I have a working camera in Homekit that streams just fine. I have added a doorbell service which also works fine, i.e. I get a notification when I send a {"ProgramableSwitchEvent":0} to the doorbell service. However I only get the notification, no image from the camera and now other options. When I click the notification it just takes me to the home app.

Interesting thing is that I had it working at some point, but when I made some changes it stopped working and now it won't come back...

What I have done/tried so far:

No matter how I set it up each item individually works, i.e. I can stream video from the camera and I get regular notifications from the doorbell. But no matter what I do I cannot get the rich notifications.

I was starting to consider whether Apple have made some breaking changes in a recent iOS update. Are there anybody with more experience to share or have this working in the latest iOS version?

Originally posted by @mtjoernelund in https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/38#issuecomment-658305953

crxporter commented 4 years ago

@mtjoernelund let's start a new issue for this!

So - I have this working great. It's been up and running for a while, I feel well qualified to help.

Can you share a bit of information:

From there I recommend the following when setting this up (this works for me): 1- use only one camera per bridge. My doorbell bridge has 3 services: camera (parent), motion (linked), doorbell (linked) 2- The service where you send {"ProgrammableSwitchEvent":0} should be "Doorbell" service 3- make sure the camera is assigned to a room in Home app with another accessory or two

In your issue I see you have just one m in "Programmable" perhaps that's the issue? I'll know better if you can share your flow (or screenshots of your node setup if you have information to redact)

crxporter commented 4 years ago

For reference, here are my 3 doorbell services:

Screen Shot 2020-07-14 at 12 37 47 PM Screen Shot 2020-07-14 at 12 38 05 PM Screen Shot 2020-07-14 at 12 38 17 PM

mtjoernelund commented 4 years ago

To answer the question:

  1. NodeRed ver 1.0.3
  2. NRCHKB just updated from 1.1.1 to 1.1.2
  3. NodeRed is running on a Raspberry Pi B3. The cam is an ESP32-cam and it is the only cam I have in HomeKit. My home hub is an ATV 4K.

Both cam and doorbell is added to a room that in addition to these two services also has a single light and a door sensor (not through NodeRed). The missing m is not the issue, that was only a typo here in the issue, not copied from the actual flow. I will screenshot the nodes once I am back at my computer.

mtjoernelund commented 4 years ago

Screenshots of the flow: Skærmbillede 2020-07-15 kl  07 31 21 Skærmbillede 2020-07-15 kl  07 31 55 Skærmbillede 2020-07-15 kl  07 32 21

crxporter commented 4 years ago

First glance shows both the doorbell and the camera are set as parent service. Try switching the doorbell to a linked service connected to the camera.

mtjoernelund commented 4 years ago

Result is the same. Tried both doorbell as parent and cam as linked, and the opposite cam as parent and doorbell as linked.

crxporter commented 4 years ago

If I were you I would try the following , in this order:

1- delete the camera and bell nodes 2- deploy and restart node red 3- create brand new camera node, with a new bridge 4- create a new bell node which is linked to the new camera 5- deploy 6- add the new bridge to home app

mtjoernelund commented 4 years ago

I'll try that and post the result.

Just looking at NodeRed logs I also have another suspicion that I want to look into. It seems that the stream from the ESP cam is not exactly stabile. Got an error from NodeRed debug log upon just opening the home app on my phone, which prompts the cam to update its still. Maybe that could contribute to the issue.

mishakim commented 4 years ago

Just as some FYI, as I've been struggling with this for some time, even when it works, the picture doesn't always come through in the notification. At the moment, I'm running my doorbell and camera through homebridge rather than node-red, due to some issues I had with ffmpeg. But both in homebridge and when I had it working here, I'd get pictures only about 1/3 of the time when the doorbell notification came through, and half of those are garbled scan lines. That's running on a raspberryPi 2B, not even a 3, so I suspect it's a matter of processing power, but it could also be the responsiveness of the camera itself (a Wyze cam v2). The point is, even if it works, you may need more hardware performance to make it work well.

crxporter commented 4 years ago

@mishakim

I'm not sure if it's a hardware issue or not. I'm running my cameras currently on a pi 4 and rich notifications work great every time. If I recall, when I was running on a pi zero w with the official pi camera, rich notifications worked great there as well.

Do you have a good (and easily available) still image source which is different from the streaming source? Preferably a jpg file for this. You'd want to fill that into the "still image source" field. This is what's normally used for the quick rich notification - since it's quicker. For me I get the still then if I click the notification it kicks over to streaming.

mishakim commented 4 years ago

That makes sense - the Wyze cam doesn't have a still image URL, so I have to use FFMPEG to grab a still from the live stream. I could add that as a step in my flow before forwarding the doorbell press to the camera service rather than pulling it live in the camera config. But then I'd have to manage that to keep the still refreshed for the home app tile view. I'll wait on that till I get a better camera (the wize is inside, looking through the door, and blinded by glare half the day anyway)

NorthernMan54 commented 4 years ago

@mishakim To workaround some of the issues with the WYZE Cam and RTSP Firmware I ended up caching 1 minute of video from the camera on a RAM Drive on my RPI, then just grab either a snapshot frame or a video clip as needed. It required some bash scripting and other things but was a fairly decent workaround

Shaquu commented 4 years ago

@mtjoernelund what is current status for that ticket?

mtjoernelund commented 4 years ago

I seem to have some issues with my ESP cam. I think I need to have those figured out before doing more work on this. Alternatively I need to invest in another cam. As soon as I have a more reliable video source I will revert to this.

Shaquu commented 4 years ago

@mtjoernelund how are we here?

mtjoernelund commented 4 years ago

Sorry for the delay, have been struggling getting my cam source at a stable level, but I think I have finally succeeded with that.

I tried the approach outlined by crxporter, i.e.:

  1. Create a new bridge
  2. Add the cam to that bridge as a parent service
  3. Add a doorbell linked to the cam This seem to have done the trick and I now get rich notifications including option to control lights from the room in which the doorbell is placed in HomeKit. Whether it was adding to a separate bridge or the fact that my cam starts streaming much(!!) faster in HomeKit now I don't know, but tend to think that it was adding as a separate bridge that did the trick.
crxporter commented 4 years ago

Excellent news! Does your rich notification work properly now? Based on this discussion it seems like quick camera performance is necessary for the rich notification.

mtjoernelund commented 4 years ago

Excellent news! Does your rich notification work properly now?

Yes, works perfectly.

Based on this discussion it seems like quick camera performance is necessary for the rich notification.

As I said, I am not sure if it is the improved cam performance or just the fact that I followed your recommendation and put the cam and the doorbell on its own separate bridge. Now that I know that this works, I might try moving it back to the main bridge and see if it still works. Will report back when I have had the chance to test.

But for now I can confirm, separate bridge, cam control as parent, doorbell as linked service, with a reasonably fast camera works perfectly for this.

crxporter commented 4 years ago

Great! I’m going to close this one out. Feel free to continue discussing this topic here - or open a new issue if you have a new question

Thanks!

Graefer commented 3 years ago

@crxporter: I am just trying to get rich notification. I do not need a video stream but rather just a snapshot image from my Unifi G3. Do I need to install ffmpeg nevertheless or can I use http://ipcam/snap.jpeg?

crxporter commented 3 years ago

@Graefer yes you will still need ffmpeg. It's still used to pull the image into the homekit world.

Not sure why you don't want to add the stream, it's pretty simple on a G3 cam

Graefer commented 3 years ago

I tried to avoid to get into trouble by installing ffmpeg. Now i tried it - and find myself in trouble. I used your instructions (CameraRTPStreamManagement https://github.com/NRCHKB/node-red-contrib-homekit-bridged/wiki/CameraRTPStreamManagement#-unifi-protect) and got errors concerning reference to atomic. Found a solution (https://stackoverflow.com/questions/62374298/ffmpeg-installation-on-raspberry-pi-zero-w-undefined-references-to-atomic) and added --extra-libs=-latomic :

sudo ./configure --extra-libs=-latomic --prefix=/usr/local --enable-shared --enable-static At least I got no erros during the installation. Please see my NRCHKBnode configuration in the following post.

I can see the camera icon in Homekit, but no video. Any suggestion? Thanks a lot Tobias

Am 27.07.2021 um 16:38 Uhr schrieb crxporter @.***>:

@Graefer https://github.com/Graefer yes you will still need ffmpeg. It's still used to pull the image into the homekit world.

Not sure why you don't want to add the stream, it's pretty simple on a G3 cam

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/302#issuecomment-887568610, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGG5I6CCQOFF5CYLTGFX43DTZ3AFDANCNFSM4OZXPWKQ.

Graefer commented 3 years ago
Bildschirmfoto 2021-08-03 um 20 18 52 Bildschirmfoto 2021-08-03 um 20 19 20
crxporter commented 3 years ago

@Graefer if you have some time to work on this, I'd recommend joining us on discord. We can focus on your issues and assist live.

Link: https://discord.gg/uvYac5u

stockfisch commented 2 years ago

Hi, sorry for bringing up this old topic. Is there a way to suppress/ disable the notification to my mobile devices? Background: I capture the ring button press from my Nuki Opener, and want to play a chime on my HomePods. I already get a notification from the Nuki Bridge, so I don't want additional notification from HomeKit.

Thanks Dirk

GogoVega commented 2 years ago

Hi, Have you tried disabling them from Home.app? In Home settings => Camera and doorbells => Doorbell notification.

pfeifix commented 5 months ago

Hello,

currently I am using a Shelly 1 device running the Mongoose firmware configured as a stateless button doorbell (old-style "not supported" accessory type). However I would like to benefit from rich notifications so I am considering moving over to homebridge-camera-ffmpeg.

I have a HKSV camera and a door lock configured to the same room in the Home App.

Is it possible to configure homebridge-camera-ffmpeg in a way that I get rich notifications from the doorbell service which - when clicked - open up the existing HKSV camera's live view together with the door unlock button?

If I understand it correctly the "normal" configuration would include a separate URL to a RTSP stream. As my camera (Logitech Circle View) does not provide one, is it OK to omit this setting and the door bell rich notification produced by the plugin would automatically redirect me to this camera's live stream when all accessories are placed in the same room?

mishakim commented 5 months ago

That question would be better directed to that project, not this one, but it hasn't been updated in years. These days I think Scripted or homebridge-Camera-UI are the more current projects for what you want. They both have good documentation and communities.

What you describe is how it used to work, with a non-camera doorbell and a real HomeKit camera in the same room, HomeKit would combine them. I don't know if that works now with a quasi-HomeKit doorbell missing the camera feed and a real non-doorbell camera.