fwestenberg / reolink_dev

Home Assistant Reolink addon
MIT License
550 stars 102 forks source link

Motion detection not working with NVR #100

Open cob94440 opened 3 years ago

cob94440 commented 3 years ago

There seems to be some problems yet. 1st every entity created are named like the 1st one. But this isn't annoying as entity has right naming 2nd every entity except first are assigned with the channel number. Again not really a probblem.

The most effective probleme is motion detection that work only on first camera Others are triggered when 1st camera is triggered

fwestenberg commented 3 years ago

I will dive into this, can you provide some pictures?

fwestenberg commented 3 years ago

In your configuration.yaml can you change logging to:

logger:
    custom_components.reolink_dev: debug
    reolink: debug

When you trigger motion detection, please post the XML part here please. Don't forget to disable logging afterwards and remove passwords/tokens from the log.

cob94440 commented 3 years ago

reolink integration entity

cob94440 commented 3 years ago

The first pic show 4 same entity. Second pic show camera channel 2

cob94440 commented 3 years ago

Invalid config for [logger]: [custom_components.reolink_dev] is an invalid option for [logger]. Check: logger->logger->custom_components.reolink_dev. (See /config/configuration.yaml, line 43).

cob94440 commented 3 years ago

logger

cob94440 commented 3 years ago

i modified : logger: logs: custom_components.reolink_dev: debug reolink: debug

cob94440 commented 3 years ago

unavailable

cob94440 commented 3 years ago

they now show unavailable And ftp is on for channel 2,3 and 4 althought it s not on. I can't desactivate it

cob94440 commented 3 years ago

sub

fwestenberg commented 3 years ago

Thanks for all pictures. This really helps. When triggering motion, do you see anything like an XML for in the log? You should find it when clicking the button "Show full log" on the log screen.

cob94440 commented 3 years ago

I can't access log its running out of memory unfortunately

fwestenberg commented 3 years ago

Can you download the latest file from custom_components (download zip) and manually test if naming is OK now? For the motion some more work is needed I'm afraid. The logs may be accessible from the terminal, like:

sudo docker logs homeassistant --tail=500

cob94440 commented 3 years ago

unexpected error when i try to add a camera after deleting

cob94440 commented 3 years ago

debugging

fwestenberg commented 3 years ago

Thanks, I just updated the config_flow.py. Can you check it?

emericklaw commented 3 years ago

This may also help.

Added first camera 'Front' all appears fine.

Added second camera 'Back' and you can see it references 'Front' and 'Back2'.

https://i.imgur.com/tylpu9l.png

fwestenberg commented 3 years ago

I found this error also. Should be fixed if you update base.py. Do you have a motion xml from the log already?

cob94440 commented 3 years ago

naming is good now with latest updates in config flow and base

cob94440 commented 3 years ago

Logger: custom_components.reolink_dev.base Source: custom_components/reolink_dev/base.py:157 Integration: Reolink IP camera (documentation, issues) First occurred: 21:15:26 (1 occurrences) Last logged: 21:15:26

Host 10.0.0.36 error renewing the Reolink subscription

cob94440 commented 3 years ago

i have this error in log

cob94440 commented 3 years ago

still no motion. i can activate and deactivate ftp on channel 1. on other channel it seems on but i can't disable And on my nvr its disabled

fwestenberg commented 3 years ago

i modified : logger: logs: custom_components.reolink_dev: debug reolink: debug

This looks good. Is there any XML in the log when you trigger motion? Every camera got it's own webhook, and own subscription. So if you have 5 camera's there should be 5 renew messages in the log (or 4 errors and 1 succes in example).

RikyUnreal commented 3 years ago

Hi all, I also own a RLN8-410-E NVR, and I have the same motion detection issue (I upgraded from 0.7, with manual platform configuration, to 0.9, with configuration>integrations>add integration>Reolink IP camera procedure).

I added each cameras connected to the NVR, the preview on lovelace interface works, but the icon on cameras stream is always idle and the motion sensors are always clear

fwestenberg commented 3 years ago

@RikyUnreal @cob94440 I can really only fix this with logging like my previous post. So the motion detection XML from your log. I expect only 1 motion sensor works now.

RikyUnreal commented 3 years ago

Ok @fwestenberg I'm not a super-geek so be patient. I try to activate logging e search for XML file. Stand by.

fwestenberg commented 3 years ago

You can recognize the XML by the tag: <IsMotion> in the body. Somewere near the end of the XML.

RikyUnreal commented 3 years ago

Ok @fwestenberg, logger added, but I can't find anything.

Have I to check the logs (see picture) or somewhere else? 0001

fwestenberg commented 3 years ago

Yes, click the button "Load full Home Assistant log"

RikyUnreal commented 3 years ago

Ok, huge amount of lines. Any keyword to search?

fwestenberg commented 3 years ago

Like I said: IsMotion

RikyUnreal commented 3 years ago

I found this pattern repeating about every minute 2020-12-18 10:01:29 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 0.443 seconds 2020-12-18 10:01:29 DEBUG (MainThread) [reolink.subscription_manager] Host XXX.XXX.XXX.XXX should renew in: 898 seconds... 2020-12-18 10:01:29 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 0.614 seconds 2020-12-18 10:01:29 DEBUG (MainThread) [reolink.subscription_manager] Host XXX.XXX.XXX.XXX should renew in: 898 seconds... 2020-12-18 10:01:29 DEBUG (MainThread) [custom_components.reolink_dev] Finished fetching reolink data in 0.643 seconds 2020-12-18 10:01:29 DEBUG (MainThread) [reolink.subscription_manager] Host XXX.XXX.XXX.XXX should renew in: 898 seconds...

no returns for isMotion

fwestenberg commented 3 years ago

Do you have 3 camera's configured? In fact this looks OK to me, no renewing errors. So all sessions are still active. Perhaps try to trigger the camera's one by one and see if some camera responds?

RikyUnreal commented 3 years ago

At the moment yes, 3 cameras. I have a one of this camera in front of me, and I'm waving :D camera

fwestenberg commented 3 years ago

This is convincing! What about the other cams?

RikyUnreal commented 3 years ago

External cameras.... stand by triggering...

RikyUnreal commented 3 years ago

Still no errors.

Picture On top: Home Assistant History of my camera3 sensor, and it is always clear. On bottom: The timeline taken from my NVR interface, and you can see the motion triggers (blue bars).

sensor

RikyUnreal commented 3 years ago

Just update my NVR (RLN8-410-E) to 20120701 firmware https://support.reolink.com/hc/en-us/articles/900003949986-12-20-2020-Firmware-for-Reolink-RLN4-410-RLN8-410-RLN8-410-E-and-RLN16-410-H3MB02-

Got a couple of new errors

1) Host 192.168.xxx.xxx error renewing the Reolink subscription 12:28:23 PM – Reolink IP camera (ERROR) - message first occurred at 12:23:54 PM and shows up 13 times Logger: custom_components.reolink_dev.base Source: custom_components/reolink_dev/base.py:139 Integration: Reolink IP camera (documentation, issues)

2) Unable to remove unknown service reolink_dev/ptz_control 12:27:56 PM – core.py (WARNING) Logger: homeassistant.core Source: core.py:1331

Motion sensors are no more always Clear, but Unavailable

EDIT/UPDATE 1) The log is still increasing the number of occurrences

2) I don't see the error 2 anymore.

fwestenberg commented 3 years ago

Can you please update to v0.10 and let me know your experiences? Thanks!

RikyUnreal commented 3 years ago

0.10 installed (I simply ran the update from HACS panel). Same "renewing the Reolink subscription" error.

Logger: custom_components.reolink_dev.base
Source: custom_components/reolink_dev/base.py:188

Motion sensors are Unavailable

cob94440 commented 3 years ago

Logger: custom_components.reolink_dev.base Source: custom_components/reolink_dev/base.py:188 Integration: Reolink IP camera (documentation, issues) First occurred: 17:36:13 (8 occurrences) Last logged: 17:42:54

Host 10.0.0.36 error renewing the Reolink subscription

cob94440 commented 3 years ago

And motion seems detected on 3 of my 4 Last is unavailable. But motion stays detected

fwestenberg commented 3 years ago

So you are on v 0.10 now? You mean is has improved a bit or? Can you show your option settings (of the HA Integration)

cob94440 commented 3 years ago

Capture Capture2 Capture3

cob94440 commented 3 years ago

Yes i'm on 0.10

cob94440 commented 3 years ago

Ftp is disabled on my nvr. On last pic you see it on and i can't disable

Motion is unavailable for 1 and detected for others but never go clear

cob94440 commented 3 years ago

Still the same issues. How can we help?

fwestenberg commented 3 years ago

First, thanks for offering to help!

  1. Are the other switches working? And with NVR, can you enable/disable FTP per camera, or only ALL on/off?
  2. When does the motion go to detected? Is this directly after adding the camera, or at the first motion detection?
  3. Is there anything in your log, regarding motion detection (when logging set to debug)?
RikyUnreal commented 3 years ago

I cheer for you :D

cob94440 commented 3 years ago
  1. i can enable or disable sound and video recording for each camera. ftp is disabled for camera 1 and i can enable or disable it. for my 3 other camera it shows enable (but i haven't enabled for any camera) and i'm unable to disabled.
  2. i do not delete camera anymore. sometimes after a restart camera number 1,2,3 or4 has motion unavailable.
  3. Others have motion detected but i m not already sure it's real.