Closed generalinq closed 2 years ago
What version are you currently on? Can you also share your dahua model?
So you get notifications through this app, then it stops working after a period of time? Does the DMSS app still continue to give you notifications when this app stops giving you notifications?
Thanks Kushagharahi,
Correct, I get notifications from this plugin perfectly, then after a certain amount of time, it just suddenly stops working. I am going to keep the debug open all night to see if I notice anything in the logs. The DMSS app keeps working without any issue all the time. I also keep getting notifications for other things from other plugins like my Ring Doorbell (if that helps at all). Once I restart HomeBridge, everything starts working again (I don't think I tried disabling and re-enabling the plugin to see if that would also make it start working again).
HomeBridge version: 1.3.8 Dahua Alerts Plugin version: 1.2.0
Dahua Cameras: IPC-HDW5442TM-ASE Dahua NVR: NVR-5216-16P-4KS2E
Here's what the log looks like when it's working and detecting motion: [12/15/2021, 8:51:53 PM] [dahua-alerts] Motion for Front Door Dahua posted to homebridge-camera-ffmpeg, received { error: false, message: 'Motion switched on.', cooldownActive: false } [12/15/2021, 8:52:01 PM] [dahua-alerts] Reset motion for Front Door Dahua posted to homebridge-camera-ffmpeg, received { error: false, message: 'Motion switched off.' }
I haven't tried testing the HTTP calls on the ffmpeg plugin side to see if I can still trigger motion with http calls made to the url when it is in this state. http://hostname:port/motion?Camera%20Name and reset: http://hostname:port/motion/reset?Camera%20Name
I think those are just info level logs. There should be some debug logs in between those. Make sure you have debug logs enabled
You should see something like this before those logs
[12/15/2021, 11:11:19 PM] [dahua-alerts] Response recieved on host: <snip>: -- myboundary
Content-Type: text/plain
Content-Length:37
Code=VideoMotion;action=Start;index=0
I would also like you to try and pay attention to the DMSS app to triple check that you still get motion notifications when the dahua alerts stops sending motion notifications
Hopefully there will be some debug logs when notifications stop that will shed some light on this issue
In the meantime I will do some research about your system
Thanks
My bad, I thought I had enabled debug in HomeBridge but I didn't.
One other point worth mentioning which I overlooking is that I had altered the dahua.js to match the 'Code' I had configured on my camera which is the SMD code. I then realized that this plugin doesn't support it. Even when using this code, I still get the alerts working (just not consistently). I have not actually tested using the 'VideoMotion' which I will do. I will also get the debug logs for the below when it stops working. I had to restart it this morning and its working again.
[12/16/2021, 11:38:07 AM] [dahua-alerts] Response recieved on host: 192.168.30.6: --myboundary Content-Type: text/plain Content-Length:283
Code=SmartMotionHuman;action=Stop;index=1;data={ "LocaleTime" : "2021-12-16 11:38:10", "RegionName" : [ "Region1" ], "UTC" : 1639672690.0, "WindowId" : [ 0 ], "object" : [ { "HumamID" : 707271, "Rect" : [ 888, 1880, 1984, 5432 ] } ] }
[12/16/2021, 11:38:07 AM] [dahua-alerts] Video Motion Ended on index: 1, mapped to camera Front Door Dahua [12/16/2021, 11:38:07 AM] [Camera FFmpeg] [Front Door Dahua] Switch motion detect off. [12/16/2021, 11:38:07 AM] [dahua-alerts] Reset motion for Front Door Dahua posted to homebridge-camera-ffmpeg, received { error: false, message: 'Motion switched off.' }
Edit Update: I confirmed that the DMSS app is absolutely sending the alerts all the time without issue. This includes the times that the plugin does not. I am still waiting for it to fail :)
Hi
Updated the plugin's dahua.js back to original to ensure that it was using the Code=VideoMotion (output shown below). I'm experiencing the same behaviour. Do I also need to disable the SMD on the camera itself? The only reason I ask is because it does actually work for a predetermined amount of time as is. It works perfectly and then for some reason decides to stop. I notice the daily backup happening and I'm not yet certain if that is related to this issue. It appears in the instance below that the last motion received from the plugin happened just prior to the backup. I will disable the backup and report back again.
[12/18/2021, 1:35:53 AM] [dahua-alerts] Motion for Driveway Dahua posted to homebridge-camera-ffmpeg, received { error: false, message: 'Motion switched on.', cooldownActive: false } [12/18/2021, 1:35:53 AM] [Camera FFmpeg] [Driveway Dahua] Switch motion detect on. [12/18/2021, 1:35:54 AM] [Camera FFmpeg] [Driveway Dahua] Snapshot requested: 640 x 360 [12/18/2021, 1:35:54 AM] [Camera FFmpeg] [Driveway Dahua] Snapshot command: ffmpeg -rtsp_transport tcp -i rtsp://xxxxxx:xxxxxx@192.168.30.6:554/cam/realmonitor?channel=1&subtype=1 -frames:v 1 -f image2 - -hide_banner -loglevel error [12/18/2021, 1:35:57 AM] [Camera FFmpeg] [Driveway Dahua] Fetching snapshot took 2.717 seconds. [12/18/2021, 1:35:57 AM] [Camera FFmpeg] [Driveway Dahua] Sending snapshot: 640 x 360 [12/18/2021, 1:35:57 AM] [Camera FFmpeg] [Driveway Dahua] Resize command: ffmpeg -i pipe: -frames:v 1 -filter:v scale='min(640,iw)':'min(360,ih)':force_original_aspect_ratio=decrease -f image2 - [12/18/2021, 1:35:58 AM] [dahua-alerts] Response recieved on host: 192.168.30.6: --myboundary Content-Type: text/plain Content-Length:254
Code=VideoMotion;action=Stop;index=0;data={ "Id" : [ 0 ], "LocaleTime" : "2021-12-18 01:35:56", "MachineName" : "XXXXXXXXX", "Name" : "DRIVEWAY", "RegionName" : [ "Region1" ], "SmartMotionEnable" : true, "UTC" : 1639809356.0 }
[12/18/2021, 1:35:58 AM] [dahua-alerts] Video Motion Ended on index: 0, mapped to camera Driveway Dahua [12/18/2021, 1:35:58 AM] [Camera FFmpeg] [Driveway Dahua] Switch motion detect off. [12/18/2021, 1:35:58 AM] [dahua-alerts] Reset motion for Driveway Dahua posted to homebridge-camera-ffmpeg, received { error: false, message: 'Motion switched off.' } [12/18/2021, 2:42:06 AM] [Homebridge UI] Running scheduled instance backup... [12/18/2021, 2:42:06 AM] [Homebridge UI] Creating temporary backup archive at /tmp/homebridge-backup-0CHPbc/homebridge-backup-0EE383A36D2E.tar.gz
Have everything set to use VideoMotion only (on my Camera, NVR, and in the plugin).
Last night was the last successful alert at 6:50pm. This morning, not working again. If I restart HomeBridge, it will start working again but I shouldn't have to do that. Have no idea what else to troubleshoot at this point. All my DMSS notifications still work.
[12/19/2021, 6:50:47 PM] [dahua-alerts] Motion for Front Door Dahua posted to homebridge-camera-ffmpeg, received { error: false, message: 'Motion switched on.', cooldownActive: false } [12/19/2021, 6:50:48 PM] [Camera FFmpeg] [Front Door Dahua] Snapshot requested: 1280 x 720 [12/19/2021, 6:50:48 PM] [Camera FFmpeg] [Front Door Dahua] Snapshot command: ffmpeg -rtsp_transport tcp -i rtsp://xxxxx:xxxxxx@192.168.30.6:554/cam/realmonitor?channel=2&subtype=1 -frames:v 1 -f image2 - -hide_banner -loglevel error [12/19/2021, 6:50:50 PM] [Camera FFmpeg] [Front Door Dahua] Fetching snapshot took 2.266 seconds. [12/19/2021, 6:50:50 PM] [Camera FFmpeg] [Front Door Dahua] Sending snapshot: 1280 x 720 [12/19/2021, 6:50:50 PM] [Camera FFmpeg] [Front Door Dahua] Resize command: ffmpeg -i pipe: -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease -f image2 - [12/19/2021, 6:50:54 PM] [dahua-alerts] Response recieved on host: 192.168.30.6: --myboundary Content-Type: text/plain Content-Length:258
Code=VideoMotion;action=Stop;index=1;data={ "Id" : [ 0 ], "LocaleTime" : "2021-12-19 18:50:54", "MachineName" : "XXXXXXXXX", "Name" : "FRONT PORCH", "RegionName" : [ "Region1" ], "SmartMotionEnable" : false, "UTC" : 1639957854.0 }
[12/19/2021, 6:50:54 PM] [dahua-alerts] Video Motion Ended on index: 1, mapped to camera Front Door Dahua [12/19/2021, 6:50:54 PM] [Camera FFmpeg] [Front Door Dahua] Switch motion detect off. [12/19/2021, 6:50:54 PM] [dahua-alerts] Reset motion for Front Door Dahua posted to homebridge-camera-ffmpeg, received { error: false, message: 'Motion switched off.' }
I have my HomeBridge docker container restarting daily via a cron. I wanted to see if that had an effect on the plugin. Unfortunately that didn't make a difference. I was thinking it may have been related to the nightly backup (which I also disabled).
Hey there, I unfortunately can not support (as I do not have the hardware to test with) anything besides the stock code. If you want help debugging, please revert to the original code (no smart alerts)
Hi
I already did revert it to original code as mentioned above. I appreciate your help but so far everything I have tried has not worked. I wish this worked. My DMSS works all the time with regards to notification.
Smart Notifications have to be off on your camera for this plugin to pick them up
I put the code back to original, disabled smartmotion on the camera. It picks the motion up successfully with the smartmotion enabled or disabled. The differences appear to be exactly the same - it will stop randomly after some time and the plug-in stops sending alerts until I restart HomeBridge. At the same time I continue to get alerts from DMSS. I ran out of options to try. I thought maybe some timeout option but I can’t see why it would timeout for the plug-in but not DMSS.
Ok thank you for trying the original code, I appreciate the effort you have put in trying to debug this issue.
I understand that DMSS app works at all times. I just want to sanity check some settings. Could you check if by chance if there is a schedule set on the video motion screen?
I thought maybe some timeout option
I think checking for timeout options is a good idea as well. I don't know what screen that might be on. DMSS app might be doing some other method of checking for alarms
I have my HomeBridge docker container restarting daily via a cron. I wanted to see if that had an effect on the plugin. Unfortunately that didn't make a difference.
If the cron job restarting homebridge doesn't enable alerts after the container is restarted, doesn't that point to the problem being with the machine hosting homebridge/docker?
What is the difference between you restarting homebridge and the docker cron job that restarts it?
I think checking for timeout options is a good idea as well. I don't know what screen that might be on. DMSS app might be doing some other method of checking for alarms
Thanks, I attached the screenshot of the schedule below.
If the cron job restarting homebridge doesn't enable alerts after the container is restarted, doesn't that point to the problem being with the machine hosting homebridge/docker?
What is the difference between you restarting homebridge and the docker cron job that restarts it?
I wasn't sure if it was HomeBridge, the plugin or my camera settings somewhere. Because while all my other plugins have no issue so I wasn't really thinking that the container was the issue. That's the part I was also confused about. Whenever it stopped sending me alerts, I would manually restart it as soon as I noticed it stopped working (typically in the morning when I wake up and notice it but has also stopped working in the late evening). Each time I would check the logs and see absolutely nothing getting generated. I would restart and it would instantly work again. My ffmeg plugin during this time keeps working and sending me snapshots in Home app on my phone. I also validate that my ring and other apps are still working fine.
So I naturally thought that the cron would do the trick and help in narrowing down the issue but it didn't seem to make a difference which threw me off. I was hoping to see some error connecting to the NVR or something that would indicate an issue. I can't seem to find any timeout options but I will keep searching.
When it works, it works perfectly. I love this plugin -- honestly. I just wish I can figure out what's going on.
Hi all
Not sure what changed but it just started working for me. I disabled the plug-in for months and decided to enable it today and it just started working. Please kindly close this. Thanks.
Hi
Anyone experience the motion alerts stop working after X amount of time? I haven't yet discovered the exact amount of time but it seems at least a few hours. I enable debug on the logs in both this plugin and in the ffmeg and I don't see any motion alert at all. My other plugins are sending me alerts properly in HomeBridge and I my cameras are sending me alerts properly in the native DMSS app - not through HomeKit unfortunately. Typically I will have it working perfectly in the morning and by end of day it stops working (or working in the evening and not working the next morning). The reason I think the issue is with this plugin and not ffmpeg is because I don't see any 'motion' at all being detected from this plugin which I usually see as the first step in the flow.
Dahua Alert json: { "host": "192.168.30.6", "user": "xxx", "pass": "xxx", "homebridgeCameraFfmpegHttpPort": 8088, "useHttp": false, "cameras": [ { "index": 0, "cameraName": "Driveway Dahua" }, { "index": 1, "cameraName": "Front Door Dahua" }, { "index": 2, "cameraName": "Side Door Dahua" }, { "index": 3, "cameraName": "Back Yard Dahua" } ], "platform": "dahua-alerts" }
Suggestions? Thanks.