openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.59k forks source link

[ipcamera] duplicated request to external alarm and warnings #15126

Closed ramunasd closed 9 months ago

ramunasd commented 1 year ago

IpCamera binding with Hikvision produces constant warnings if external alarm feature is not available.

Current Behavior

Log output

00:09:13.859 [TRACE] [ng.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is  :--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 549

<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.1.64</ipAddress>
<ipv6Address>::</ipv6Address>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>24:0f:9b:bc:1d:19</macAddress>
<channelID>1</channelID>
<dateTime>2023-06-20T00:09:13+03:00</dateTime>
<activePostCount>1</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
<channelName>Camera 01</channelName>
</EventNotificationAlert>
:
00:09:19.572 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.64:80/ISAPI/System/IO/inputs/1/status
00:09:19.583 [TRACE] [mera.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.1.64:80/ISAPI/System/IO/inputs/1/status
00:09:19.583 [TRACE] [ng.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is  :<!DOCTYPE html>
<html><head><title>Document Error: Unauthorized</title></head>
<body><h2>Access Error: 401 -- Unauthorized</h2>
<p>Authentication Error</p>
</body>
</html>
:
00:09:19.595 [WARN ] [.ipcamera.internal.MyNettyAuthHandler] - 403 Forbidden: Check camera setup or has the camera activated the illegal login lock?
00:09:19.600 [TRACE] [ng.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is  :<?xml version="1.0" encoding="UTF-8"?><ResponseStatus version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<requestURL></requestURL>
<statusCode>4</statusCode>
<statusString>Invalid Operation</statusString>
<subStatusCode>invalidOperation</subStatusCode>
</ResponseStatus>
:
00:09:24.099 [TRACE] [ng.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is  :--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 549

<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>192.168.1.64</ipAddress>

Your Environment

Endpoint /ISAPI/System/IO/inputs/ shows no sign of any input device:

<?xml version="1.0" encoding="UTF-8"?>
<IOInputPortList version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
</IOInputPortList>
Skinah commented 10 months ago

I just had a PR get merged that may fix this. It will be 4.2 milestone 1 or in any of the daily snapshots so you can download the jar from the jfrog server. Can you test and see if it is solved?

Skinah commented 9 months ago

This PR is a possible fix https://github.com/openhab/openhab-addons/pull/16081