maciej-or / hikvision_next

Home Assistant integration for Hikvision NVRs and IP cameras
117 stars 23 forks source link

Detect motion no working #131

Closed pepsonEL closed 1 month ago

pepsonEL commented 11 months ago

Hi. I have NVR model DS-7616NXI-K2 with FW 4.76.005 and i have connected 7 cameras. Cameras detect motion and record. But in your integration detect is no reconized. Still show no detect....on binary sensor.

george-oniceag commented 11 months ago

I have the same problem with: DS-7608NI-K2/8P Firmware: V4.74.200

TolianIPB commented 11 months ago

I have the same problem with: DS-7608NI-K2/8P Firmware: V4.74.205 build 230712

pepsonEL commented 11 months ago

Any update ?

maciej-or commented 11 months ago

Apparently NVR sends notification in unexpected format, it might be related to firmware version, please share log as described here: https://github.com/maciej-or/hikvision_next#reporting-issues It will be enough to paste everything after line: --- Incoming event notification ---

pepsonEL commented 11 months ago

I send and email.... but no response.... i am from poland.... and also write on FB on Home Assistant group... maybe contact with me it will be better to share logs.

maciej-or commented 11 months ago

@pepsonEL The best place for discussing this integration is here. Each post is available to the community and can be a helpful tip or guide for others as well.

pepsonEL commented 11 months ago

ok but logs has many address about my network. I dont want share it public.

pepsonEL commented 10 months ago

and ?

pepsonEL commented 10 months ago

and any news.,.... can you help us ?

maciej-or commented 10 months ago

I have no access to K2 devices, so logs are only way to help me with eventual fix. If you afraid to publish your ips you can easily replace them in the log before send. Consider using pastebin.com which has handy features like burn after read and expiration time.

pepsonEL commented 10 months ago

But please send me step by step how get loga gor you.

maciej-or commented 10 months ago

https://github.com/maciej-or/hikvision_next#reporting-issues after restart HA, trigger an event and send me all after line: --- Incoming event notification ---

It's not straightforward but I believe you will manage that

pepsonEL commented 10 months ago

After restart i dont see it

--- Incoming event notification ---

pepsonEL commented 10 months ago

https://github.com/maciej-or/hikvision_next#reporting-issues after restart HA, trigger an event and send me all after line: --- Incoming event notification ---

It's not straightforward but I believe you will manage that

Looks i get this logs: https://pastebin.com/ZxRwfTfV

maciej-or commented 10 months ago

awesome, did you trigger motion event? I can't see incoming notification in the log.

pepsonEL commented 10 months ago

yes on cameras in your integration i have enbable: Intrusion Detection Line Crossing Detection Motion Detection Video Loss Detection

By web GUI NVR Hikvision i have enable it and my camera on NVR record by motion detect.

maciej-or commented 10 months ago

I've checked your logs, Alarm server is configured properly but Home Assistant does not receive notifications from NVR. Do you get notifications in HikConnect mobile app? If not please check Notify Surveillance Center option for the event.

pepsonEL commented 10 months ago

In mobile app also no recive notification. I check Notify Surveillance Center and get you info.

pepsonEL commented 10 months ago

But please tell me where i can enable it ? I can not find this option....

maciej-or commented 10 months ago

Oh man, you haven't read this f* manual ;)

image
pepsonEL commented 10 months ago

I dont have it.... I have only send to IVMS-4200 image

maciej-or commented 10 months ago

wow, really interesting, maybe your device doesn't support that. Anyway you could try IVMS-4200. What your device manual says about using HikConnect app?

This is my UI in polish: image

pepsonEL commented 10 months ago

I have add my NVR to app HikConnect and works ok.

And what you have model NVR with which FW version ? And for you works motion detection ok and show it in HA ?

HAHAHAHA I see that manual for my NVR also show in alarm that one option should be: Notify Surveillance Center Again i think that HikVision is stuppid devices and with many bugs.... Still this is show and i see. New device is not true that better,

maciej-or commented 10 months ago

I own this one https://www.hikvision.com/en/products/IP-Products/Network-Video-Recorders/Pro-Series/ds-7608nxi-i2-8p-s with the latest FW. From my experience HikVision has very inconsistent software. It looks like different teams are working on the software for individual models, and yet others are working on documentation. It's a shame because it's good hardware, and weak software is wasting its potential.

pepsonEL commented 10 months ago

You have this model select as EOL on HikVision ?

pepsonEL commented 10 months ago

Activated send to IVMS4200 nothing change. Still no show motion in HA

maciej-or commented 10 months ago

My NVR became EOL last year. It seems you device doesn't support notification way used by this integration. Sorry.

pepsonEL commented 10 months ago

But other user has the same problem.... not only me.... other user in this thread ex has model DS-7608NI-K2/8P and also has problem..... In my opinion problem is in integration.

maciej-or commented 10 months ago

the error submitted in #132 occurs after --- Incoming event notification --- Initially I thought your issue is the same but you confirmed the log does not contain that line. Most likely fw on K2 devices has sth changed.

pepsonEL commented 10 months ago

Can you do something ?

alexander-tomov commented 10 months ago

Hello, I have the following device: Device Model DS-7616NXI-K2 Firmware Version V4.75.005 build 230630

I also experience the issue described here "Cannot process incomming event."

alexander-tomov commented 10 months ago

My user, I use in your integration has these permissions:

Screenshot 2024-01-30 at 0 41 19

These are the logs I see:

2024-01-30 00:33:26.867 WARNING (MainThread) [custom_components.hikvision_next.isapi] Unexpected exception | Cannot fetch state for io | Client error '403 Forbidden' for url 'http://10.0.4.2/ISAPI/System/IO/inputs/801'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403
2024-01-30 00:33:26.920 WARNING (MainThread) [custom_components.hikvision_next.isapi] Unexpected exception | Cannot fetch state for io | Client error '403 Forbidden' for url 'http://10.0.4.2/ISAPI/System/IO/inputs/901'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403
2024-01-30 00:33:26.959 WARNING (MainThread) [custom_components.hikvision_next.isapi] Unexpected exception | Cannot fetch state for io | Client error '403 Forbidden' for url 'http://10.0.4.2/ISAPI/System/IO/inputs/1001'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403
2024-01-30 00:33:26.996 DEBUG (MainThread) [custom_components.hikvision_next.isapi] http://10.0.4.2/ISAPI/System/IO/outputs/1/status {'IOPortStatus': {'@version': '1.0', '@xmlns': 'http://www.hikvision.com/ver20/XMLSchema', 'ioPortID': '1', 'ioPortType': 'output', 'ioState': 'inactive'}}
2024-01-30 00:33:27.036 DEBUG (MainThread) [custom_components.hikvision_next.isapi] http://10.0.4.2/ISAPI/ContentMgmt/Storage [{'hdd': {'@version': '1.0', '@xmlns': 'http://www.hikvision.com/ver20/XMLSchema', 'id': '1', 'hddName': 'hdd1', 'hddPath': None, 'hddType': 'SATA', 'status': 'ok', 'capacity': '1907729', 'freeSpace': '0', 'property': 'RW'}}]
2024-01-30 00:33:27.036 DEBUG (MainThread) [custom_components.hikvision_next.coordinator] Finished fetching hikvision_next data in 3.950 seconds (success: True)
2024-01-30 00:33:30.315 DEBUG (MainThread) [custom_components.hikvision_next.notifications] --- Incoming event notification ---
2024-01-30 00:33:30.316 DEBUG (MainThread) [custom_components.hikvision_next.notifications] Source: 10.0.0.1
2024-01-30 00:33:30.316 DEBUG (MainThread) [custom_components.hikvision_next.notifications] request headers: <CIMultiDictProxy('Host': '10.0.0.2', 'User-Agent': 'HTTP_USER_AGENT', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'ZH-cn;zh;q=0.5', 'Accept-Charset': 'gb2312,utf8;q=0.7,*;q=0.7', 'Authorization': 'Basic Og==', 'Content-Type': 'application/xml; charset="UTF-8"', 'Content-Length': '598', 'Connection': 'Keep-Alive')>
2024-01-30 00:33:30.316 DEBUG (MainThread) [custom_components.hikvision_next.notifications] alert info: <?xml version="1.0" encoding="UTF-8" ?>
<EventNotificationAlert version="1.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>10.0.4.2</ipAddress>
<portNo>80</portNo>
<protocolType>HTTP</protocolType>
<macAddress>**:**:**:**:**:**</macAddress>
<dynChannelID>3</dynChannelID>
<channelID>3</channelID>
<dateTime>2024-01-30T00:33:28+02:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>VMD</eventType>
<eventState>active</eventState>
<eventDescription>Motion alarm</eventDescription>
<channelName>DVOR2</channelName>
<targetType>vehicle</targetType>
</EventNotificationAlert>

2024-01-30 00:33:30.317 DEBUG (MainThread) [custom_components.hikvision_next.notifications] Alert: AlertInfo(channel_id=3, io_port_id=0, event_id='motiondetection', device_serial_no=None, mac='**:**:**:**:**:**')
2024-01-30 00:33:30.322 WARNING (MainThread) [custom_components.hikvision_next.notifications] Cannot process incoming event 'NoneType' object has no attribute 'device_info'
alexander-tomov commented 10 months ago

Anything else I can help?

maciej-or commented 10 months ago

thanks @alexander-tomov this is all I need, it will help to fix that issue

pepsonEL commented 7 months ago

Any news about this fix ?

RomanovVIII commented 3 months ago

Good afternoon. I do not have a binary motion sensor of the cameras. The cameras are connected to NVR - DS-N208P(C). The cameras themselves work. motion detection in HIK Connect works. In Home Assistant - no.
Everything worked properly before. The problem is for the last 2-3 weeks. I tried reinstalling the integration. Tried installing the previous integration - 16. Still nothing works. What can I do?