homebridge-plugins / homebridge-camera-ffmpeg

Homebridge Plugin Providing FFmpeg-based Camera Support
https://homebridge-plugins.github.io/homebridge-camera-ffmpeg/
Apache License 2.0
1.09k stars 227 forks source link

No Longer Getting Rich Notifications On iOS 13 Beta 5 #332

Closed tarbychark closed 5 years ago

tarbychark commented 5 years ago

My current home hubs are Apple TVs also running tvOS 13 beta 5. Motion notifications still come through, but I’m no longer getting image previews. Let me know if there is any logging you might need.

Yardco commented 5 years ago

Me neither unfortunately...

jankais3r commented 5 years ago

How does one setup these notifications? Is having a camera and motion sensor in the same HomeKit room enough or is the setup more involved?

tarbychark commented 5 years ago

How does one setup these notifications? Is having a camera and motion sensor in the same HomeKit room enough or is the setup more involved?

Yep, if you have a camera in a room with a motion sensor, it will include a still image in the motion notification (or at least it used to in iOS 12).

senseotech commented 5 years ago

I'v actually not been getting rich notifications for the entire duration of iOS13/tvOS13 betas. That said, I got a Circle 2 with active HomeKit support yesterday and its doing rich notifications. I looked at how its set up in HomeKit and it looks like the Camera itself is publishing the motion sensor as an accessory; wonder if some change in iOS 13 is preventing rich notifications if the cam and sensor are just in the same room (aka they need to be grouped together ala the Circle 2 camera.)

tarbychark commented 5 years ago

That sounds like it could definitely be a possibility. I've also been using homebridge-dafang, which uses the cameras themselves as motion sensors, but configured as a separate accessory. Wonder if the dev behind that plugin might be able to solve it by merging them as single accessories, rather than separate?

senseotech commented 5 years ago

That sounds like it could definitely be a possibility. I've also been using homebridge-dafang, which uses the cameras themselves as motion sensors, but configured as a separate accessory. Wonder if the dev behind that plugin might be able to solve it by merging them as single accessories, rather than separate?

To add credence to my suspicion, I just enabled motion alerts on a machine still running Mojave and confirmed that its getting rich notifications with a snapshot when nothing running Catalina/iOS 13 does, but everybody is happy with the Circle 2 device thats got the motion sensor nested inside it.

tarbychark commented 5 years ago

Yep, same here. Mac mini on 10.14.6 still receives them just fine.

iuliusmaximilian commented 5 years ago

+1

iuliusmaximilian commented 5 years ago

@KhaosT Can you please investigate in this really bad one

iuliusmaximilian commented 5 years ago

Can confirm that Rich Notifications are still received on macOS 10.14.6 with tvOS 13.1 public beta and not received on iOS and iPadOS 13.1 public betas.

dkrizic commented 5 years ago

It looks like that the Camera and the Motion Sensor must be in the same device. I have a real Omna which offers exactly this. Now with iOS 13 the Omna continues to send rich notifications. All other combinations where I have a Camera and Motion Sensor (as separate devices) does not work. I get the motion notification, but without a picture. Looks like we need a change in Homebridge that two devices can be combined into one.

ashtonaut commented 5 years ago

Same issue here after updating to iOS 13 on my phone. Still running tvOS 12 on my Apple TV. Motion sensor notifications generated via homebridge-filesensor aren’t rich notifications with a snapshot.

I understand the logic of why this is likely happening - super keen for a fix or workaround that allows us to combine the sensor into the camera within homebridge somehow!

NorthernMan54 commented 5 years ago

My first thought is that this feature gap is a result of tvOS and iPadOS not being updated yet, so am thinking to wait until they are updated. Also I saw a comment saying 13.1 is coming in a week or 2, so maybe it is fixed there.

I’m going to just wait for a few weeks and see where things land, before crafting a workaround for this.

tarbychark commented 5 years ago

Still same issue running latest 13.1 betas on iPhone and iPad as well as 13 GM on both of my Apple TV’s. Looking like a workaround will indeed need to be crafted.

Maxwell70 commented 5 years ago

@KhaosT I confirm, after updating on ios 13 screenshots are not sent! I beg you to solve this problem!

KhaosT commented 5 years ago

It looks like in iOS 13, HomeKit will no longer try to use separate motion sensors in a room to trigger camera notification. In order for notification to appear, the motion sensor service has to be in the same accessory as the camera itself.

Can you guys share what kind of motion sensors are you guys using right now?

tarbychark commented 5 years ago

It looks like in iOS 13, HomeKit will no longer try to use separate motion sensors in a room to trigger camera notification. In order for notification to appear, the motion sensor service has to be in the same accessory as the camera itself.

Can you guys share what kind of motion sensors are you guys using right now?

Right now, I'm using homebridge-dafang for Wyze cameras, which uses the camera's software motion detection to create a motion sensor accessory that communicates using MQTT.

I also have a couple Phillips motion sensors in rooms with cameras.

dkrizic commented 5 years ago

I have:

A perfect solution would be to be able to combine devices into one device even if they are from different plugins.

iuliusmaximilian commented 5 years ago

I am on iOS 13.1 and iPadOS 13.1 and tvOS 13 - no rich notifications for this circumstance anymore :-(

ashtonaut commented 5 years ago

@KhaosT

my cameras are running through homebridge-camera-ffmpeg.

My motion sensors are all using homebridge-filesensor.

I have one motion sensor and one camera in each room.

Thanks for looking into this!

phralh commented 5 years ago

Hue and IKEA trådfri sensors through homebride-hue. Support for triggering motion with mqtt would be nice.

Maxwell70 commented 5 years ago

It looks like in iOS 13, HomeKit will no longer try to use separate motion sensors in a room to trigger camera notification. In order for notification to appear, the motion sensor service has to be in the same accessory as the camera itself.

Can you guys share what kind of motion sensors are you guys using right now?

I use motion sensors Aqara through the plugin homebridge-mi-aqara. Probably need once in our plugin to embed the motion sensor with the camera.

NorthernMan54 commented 5 years ago

I was thinking of 2 potential approaches for merging a motion sensor from another plugin into a camera accessory.

First perform some hackery on hap-nodejs and have it merge a motion sensor service object into a camera accessory. Not sure if this was feasible as I haven’t looked into it yet, also would require the camera accessory and motion sensor plugin to be in the same homebridge instance.

Second approach, have the existing camera-ffmpeg plugin perform a proxy function for existing motion sensor accessories and merge it into the camera. And for the proxy code, could reuse some of the code from my homebridge-Alexa plugin which already does device discovery and control.

Any other thoughts on approaches to resolve? Personally I thought this would have caused more noise outside of this community, which I haven’t noticed yet.

PS all this would be limited to motion sensors and cameras exposed thru homebridge / hap-nodejs, native HomeKit devices would not work

NorthernMan54 commented 5 years ago

Approach 3, in the existing camera-ffmpeg plugin add a dummy motion sensor and switch, and have the switch trigger the motion sensor on/off. Then use an automation to turn on/off the switch when the real motion sensor sees motion.

This seems the easiest. Any thoughts from everyone else?

iuliusmaximilian commented 5 years ago

@NorthernMan54 I like your a3 by a generic solution that gives a lot of capabilities on top. If we go this route, there is for instance the flexibility to bring in logic in the automation like combining 2 motion sensors to one event or check dedicated rules before triggering the event. But we have to double check timing behavior.

tarbychark commented 5 years ago

Looking forward to whatever option you boys decide to move forward with. Wish I was skilled enough to assist.

BadgerBadgerAndFox commented 5 years ago

Confirmed as not working also on iOS 13.1 Beta 4 I'm running 1 camera in "homebridge-camera-ffmpeg" with the RTSP feed from Synology Surveillance Station. Motion sensor is provided from "homebridge-sss-platform".

I'm also feeding a further 5 cameras from Unifi Protect using "homebridge-unifi-protect2". Motion sensors for the Unifi cameras are provided by "homebridge-unifi-protect-motion-sensors".

Homebridge is running in Docker container from oznu/homebridge on the Synology DiskStation.

Each camera has the same display name as the associated motion sensor and is located in the same room in HomeKit, and as with others the rich notifications worked prior to iOS 13.x

@KhaosT Let me know if there is anything else i can provide to assist.

NorthernMan54 commented 5 years ago

Alpha code for my approach #3 is here

https://github.com/NorthernMan54/homebridge-camera-ffmpeg/commit/a29948e21ffdecbb8ab99d46a0c6f5123fd6fc7c#diff-168726dbe96b3ce427e7fedce31bb0bc

The change only applies to index.js

Please note my repo has some other things I'm working on to improve WyzeCam RTSP feeds, and google photo uploading so please don't install my repo as it will not work for you.

NorthernMan54 commented 5 years ago

And a quick test was a success, but need to work thru some variable scope issues. ( I have 2 cameras, and I walked in front of the first and the second triggered)

iuliusmaximilian commented 5 years ago

Great, thanks for sharing !! Having 9 cameras and 11 PIR so better I wait right ?

RomanGz commented 5 years ago

FWIW, I use camera-ffmpgeg & homebridge-web-motion. I have a separate process monitoring my Hikvision cameras for events & makes the http calls to web-motion listeners.

ashtonaut commented 5 years ago

@NorthernMan54 thanks for giving this some attention! I’m also surprised there hadn’t been more widespread grumbling.

I don’t know if I’m competent enough to test your alpha solution, but I’m happy to test and report back if given some instructions on what and how to test. I have 4 cameras with 4 homebridge-filesensor motion detectors, simple setup with a single camera and single motion detector in each ‘room’.

NorthernMan54 commented 5 years ago

A couple of screenshots from my poc code, looks good so far. In the notification screen you can an example of not working and working.

B4CC23B8-BE6B-417B-8BAA-A952A894E4E2 EBEF8D75-34D5-47B2-B02C-77D33D450EF7

tarbychark commented 5 years ago

Great progress so far!

iuliusmaximilian commented 5 years ago

Just tested by replacing the index.js (only). The result is all cameras now have a switch and a motion sensor and enabling the switch manually sends rich notifications. As described above, atm. from the wrong camera.

NorthernMan54 commented 5 years ago

Beta code for this is Pull Request #355

@KhaosT Take a look and see what you think

Last step would be updating the README with the new functionality

NorthernMan54 commented 5 years ago

Fixed multiple camera’s as well

5CEB8E8E-E961-4A8A-AEE8-68E7F3E992FA

fennec622 commented 5 years ago

Thanks i try and it's ok

Now how can i do for active motion detect, try to add mqtt

RomanGz commented 5 years ago

Last step would be updating the README with the new functionality

Perhaps a config parameter for motion reset timer? Looks like it's fixed to 5sec.

Maxwell70 commented 5 years ago

@KhaosT Strongly waiting for the plugin update! Thanks a lot!

ashtonaut commented 5 years ago

@NorthernMan54 for those of us keen to try this in advance of an official merge, can you please help out with what I need to do? Is it as simple as replacing a couple of files within the homebridge install or config? Cheers

NorthernMan54 commented 5 years ago

@ashtonaut Just replace the index.js from my patch into your environment and restart homebridge, then add the required automation rules in the home app

@rgazaryants I spent a fair bit of time thinking about this, and originally required a second automation rule to turn it off. But after playing with it for a bit realized that you only needed the "On" or "Motion" trigger and how long it stayed on was meaning less for the workaround. So I hardcoded 5 seconds, so that it stayed ON long enough to notice, but also reset fast enough that you motion sensor could trigger it again ( if needed ).

@fennec622 Sorry can't help with the MQTT bit

fennec622 commented 5 years ago

@NorthernMan54 thanks, you how do you active motion detect ?

NorthernMan54 commented 5 years ago

Just create an automation rule for when your real motion detects something to turn on the switch with the same name as your camera

Sent from my iPad

On Sep 25, 2019, at 11:14 PM, fennec622 notifications@github.com wrote:

@NorthernMan54 thanks, you how do you active motion detect ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

tarbychark commented 5 years ago

@NorthernMan54 thanks, you how do you active motion detect ?

IMG_0043

IMG_0044

RomanGz commented 5 years ago

Thanks to @NorthernMan54 for laying the groundwork.

I wanted to go a little bit into a different direction, and hacked in homebridge-web-motion without adding its own motion sensors. I know enough JS to cause damage, so I probably did some hacky things.

https://github.com/RomeyRome206/homebridge-camera-ffmpeg/commit/d3b188c28d5744ba66544b7ea151d55b4f650d59

It works the same as with the web-motion plugin. You basically trigger motion on/off with sending a GET request to like: http://172.16.0.9:2000/sidew/motionDetected/1 & http://172.16.0.9:2000/sidew/motionDetected/0 for off

http://172.16.0.9:2000/front_door/motionDetected/1 & http://172.16.0.9:2000/front_door/motionDetected/0

In the case of front_door, My camera is named "Front Door" in ffmpeg config. For the sake of simple URLs, the camera name is converted to lower case, and spaces replaced with underscores. Any special characters in the name will likely break it.

Some extra config for the json:

"platform": "Camera-ffmpeg",
  "autoResetMotion": true,
  "autoResetDelay": 15,
  "motionPort": 2000,
  "cameras": [
    {
...
...
roe1974 commented 5 years ago

is it not possible to just group the motion sensor and the camera to one group ? Perhaps to ad a parameter in the config.json for the "real" motion sensor ? Sorry i am not fit in JS, just an idea ;-)

Richard

BadgerBadgerAndFox commented 5 years ago

@NorthernMan54 You sir are a legend! Dropped in the current code from your pull request and it works great!. I alos injected your changes into the index.js for hjdhjd/homebridge-unifi-protect2 and it works in there as well! Now all my cameras get rich notifications again. Would you be able to submit your pull request to homebridge-unifi-protect2 as well?

NorthernMan54 commented 5 years ago

@BadgerBadgerAndFox There is no magic about pull requests, you can submit your changes to the index.js for homebridge-unifi-protect2 directly. ( on the github website, just edit the file and it will create a pull request for you )

@roe1974 not feasible as each motion sensor has a unique work around

ScharV commented 5 years ago

@NorthernMan54 I saw that you forked homebridge-dafang for a while. Would it be possible to get a solution for the rich motion problem on this plugin to?