diff --git a/custom_components/hikvision_next/__init__.py b/custom_components/hikvision_next/__init__.py index 695a44e..4c6a61e 100644 --- a/custom_components/hikvision_next/__init__.py +++ b/custom_components/hikvision_next/__init__.py @@ -57,7 +57,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: HikvisionConfigEntry) -> except ISAPIUnauthorizedError as ex: raise ConfigEntryAuthFailed from ex except Exception as ex: # pylint: disable=broad-except - msg = f"Cannot initialize {DOMAIN} {device.host}. Error: {ex.message}\n" + msg = f"Cannot initialize {DOMAIN} {device.host}. Error: {ex}\n" _LOGGER.error(msg + traceback.format_exc()) raise ConfigEntryNotReady(msg) from ex diff --git a/custom_components/hikvision_next/diagnostics.py b/custom_components/hikvision_next/diagnostics.py index 5252a5e..11d0381 100644 --- a/custom_components/hikvision_next/diagnostics.py +++ b/custom_components/hikvision_next/diagnostics.py @@ -89,6 +89,7 @@ async def _async_get_diagnostics( "Event/triggers", "Event/triggers/scenechangedetection-1", "Event/notification/httpHosts", + "Streaming/channels", ] for endpoint in endpoints: diff --git a/custom_components/hikvision_next/isapi/const.py b/custom_components/hikvision_next/isapi/const.py index 944da06..b3571ed 100644 --- a/custom_components/hikvision_next/isapi/const.py +++ b/custom_components/hikvision_next/isapi/const.py @@ -81,6 +81,7 @@ EVENTS_ALTERNATE_ID = { "vmd": "motiondetection", + "thermometry": "motiondetection", "shelteralarm": "tamperdetection", "VMDHumanVehicle": "motiondetection", } diff --git a/custom_components/hikvision_next/isapi/isapi.py b/custom_components/hikvision_next/isapi/isapi.py index 51dac46..33a7921 100644 --- a/custom_components/hikvision_next/isapi/isapi.py +++ b/custom_components/hikvision_next/isapi/isapi.py @@ -130,20 +130,34 @@ async def get_cameras(self): """Get camera objects for all connected cameras.""" if not self.device_info.is_nvr: - # Get single IP camera - self.cameras.append( - IPCamera( - id=1, - name=self.device_info.name, + # Fetch the list of streaming channels (cameras), can be multiple for thermal cameras for example + streaming_channels = await self.request(GET, "Streaming/channels") + streaming_channel_list = deep_get(streaming_channels, "StreamingChannelList.StreamingChannel", []) + + channel_ids = set() + for streaming_channel in streaming_channel_list: + channel_id = int(deep_get(streaming_channel, "Video.videoInputChannelID", 1)) + channel_ids.add(channel_id) + + for channel_id in sorted(channel_ids): + # Determine camera name + if len(channel_ids) > 1: + camera_name = f"{self.device_info.name} - Channel {channel_id}" + else: + camera_name = self.device_info.name + + camera = IPCamera( + id=channel_id, + name=camera_name, model=self.device_info.model, serial_no=self.device_info.serial_no, firmware=self.device_info.firmware, - input_port=1, + input_port=channel_id, connection_type=CONNECTION_TYPE_DIRECT, ip_addr=self.device_info.ip_address, - streams=await self.get_camera_streams(1), + streams=await self.get_camera_streams(channel_id), ) - ) + self.cameras.append(camera) else: # Get analog and digital cameras attached to NVR if self.capabilities.support_digital_cameras > 0: diff --git a/tests/fixtures/ISAPI/EventNotificationAlert/ipc_thermometry_motiondetection.xml b/tests/fixtures/ISAPI/EventNotificationAlert/ipc_thermometry_motiondetection.xml new file mode 100644 index 0000000..e317f5b --- /dev/null +++ b/tests/fixtures/ISAPI/EventNotificationAlert/ipc_thermometry_motiondetection.xml @@ -0,0 +1,14 @@ + + 1.0.0.255 + 8123 + HTTP + a6:60:9e:f8:01:09 + 2 + 2 + 2024-11-13T20:20:52+01:00 + 1 + VMD + active + Motion alarm + Camera 02 + \ No newline at end of file diff --git a/tests/fixtures/devices/DS-2CD2146G2-ISU.json b/tests/fixtures/devices/DS-2CD2146G2-ISU.json index e63ce3f..9ba8af3 100644 --- a/tests/fixtures/devices/DS-2CD2146G2-ISU.json +++ b/tests/fixtures/devices/DS-2CD2146G2-ISU.json @@ -1767,6 +1767,167 @@ "isSupportTargetMultiSelect": "true" } } + }, + "Streaming/channels": { + "response": { + "StreamingChannelList": { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "StreamingChannel": [ + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "101", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8860" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18860" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "3840", + "videoResolutionHeight": "2160", + "videoQualityControlType": "VBR", + "constantBitRate": "12288", + "fixedQuality": "100", + "vbrUpperCap": "12288", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "Main", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main", + "SmartCodec": { + "enabled": "false" + } + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + }, + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "102", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8866" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18866" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "640", + "videoResolutionHeight": "360", + "videoQualityControlType": "VBR", + "constantBitRate": "256", + "fixedQuality": "60", + "vbrUpperCap": "256", + "vbrLowerCap": "32", + "maxFrameRate": "1000", + "keyFrameInterval": "4000", + "snapShotImageType": "JPEG", + "H264Profile": "Baseline", + "GovLength": "40", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + ] + } + } } } } diff --git a/tests/fixtures/devices/DS-2CD2346G2-ISU.json b/tests/fixtures/devices/DS-2CD2346G2-ISU.json index e8733d0..89be735 100644 --- a/tests/fixtures/devices/DS-2CD2346G2-ISU.json +++ b/tests/fixtures/devices/DS-2CD2346G2-ISU.json @@ -1783,6 +1783,167 @@ "sensitivityLevel": "30" } } + }, + "Streaming/channels": { + "response": { + "StreamingChannelList": { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "StreamingChannel": [ + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "101", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8860" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18860" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "3840", + "videoResolutionHeight": "2160", + "videoQualityControlType": "VBR", + "constantBitRate": "12288", + "fixedQuality": "100", + "vbrUpperCap": "12288", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "Main", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main", + "SmartCodec": { + "enabled": "false" + } + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + }, + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "102", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8866" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18866" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "640", + "videoResolutionHeight": "360", + "videoQualityControlType": "VBR", + "constantBitRate": "256", + "fixedQuality": "60", + "vbrUpperCap": "256", + "vbrLowerCap": "32", + "maxFrameRate": "1000", + "keyFrameInterval": "4000", + "snapShotImageType": "JPEG", + "H264Profile": "Baseline", + "GovLength": "40", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + ] + } + } } } } diff --git a/tests/fixtures/devices/DS-2CD2386G2-IU.json b/tests/fixtures/devices/DS-2CD2386G2-IU.json index 2924213..806a7de 100644 --- a/tests/fixtures/devices/DS-2CD2386G2-IU.json +++ b/tests/fixtures/devices/DS-2CD2386G2-IU.json @@ -1662,6 +1662,167 @@ } } } + }, + "Streaming/channels": { + "response": { + "StreamingChannelList": { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "StreamingChannel": [ + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "101", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8860" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18860" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "3840", + "videoResolutionHeight": "2160", + "videoQualityControlType": "VBR", + "constantBitRate": "12288", + "fixedQuality": "100", + "vbrUpperCap": "12288", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "Main", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main", + "SmartCodec": { + "enabled": "false" + } + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + }, + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "102", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8866" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18866" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "640", + "videoResolutionHeight": "360", + "videoQualityControlType": "VBR", + "constantBitRate": "256", + "fixedQuality": "60", + "vbrUpperCap": "256", + "vbrLowerCap": "32", + "maxFrameRate": "1000", + "keyFrameInterval": "4000", + "snapShotImageType": "JPEG", + "H264Profile": "Baseline", + "GovLength": "40", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + ] + } + } } } } diff --git a/tests/fixtures/devices/DS-2CD2443G0-IW.json b/tests/fixtures/devices/DS-2CD2443G0-IW.json index 42e3f0d..ec3965c 100644 --- a/tests/fixtures/devices/DS-2CD2443G0-IW.json +++ b/tests/fixtures/devices/DS-2CD2443G0-IW.json @@ -1069,6 +1069,167 @@ "name": "PIR Alarm" } } + }, + "Streaming/channels": { + "response": { + "StreamingChannelList": { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "StreamingChannel": [ + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "101", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8860" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18860" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "3840", + "videoResolutionHeight": "2160", + "videoQualityControlType": "VBR", + "constantBitRate": "12288", + "fixedQuality": "100", + "vbrUpperCap": "12288", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "Main", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main", + "SmartCodec": { + "enabled": "false" + } + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + }, + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "102", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8866" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18866" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "640", + "videoResolutionHeight": "360", + "videoQualityControlType": "VBR", + "constantBitRate": "256", + "fixedQuality": "60", + "vbrUpperCap": "256", + "vbrLowerCap": "32", + "maxFrameRate": "1000", + "keyFrameInterval": "4000", + "snapShotImageType": "JPEG", + "H264Profile": "Baseline", + "GovLength": "40", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + ] + } + } } } } diff --git a/tests/fixtures/devices/DS-2CD2532F-IWS.json b/tests/fixtures/devices/DS-2CD2532F-IWS.json index 43bfbd9..077a27d 100644 --- a/tests/fixtures/devices/DS-2CD2532F-IWS.json +++ b/tests/fixtures/devices/DS-2CD2532F-IWS.json @@ -1216,6 +1216,167 @@ }, "WLAlarm/PIR": { "status_code": 403 + }, + "Streaming/channels": { + "response": { + "StreamingChannelList": { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "StreamingChannel": [ + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "101", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8860" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18860" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "3840", + "videoResolutionHeight": "2160", + "videoQualityControlType": "VBR", + "constantBitRate": "12288", + "fixedQuality": "100", + "vbrUpperCap": "12288", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "Main", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main", + "SmartCodec": { + "enabled": "false" + } + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + }, + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "102", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8866" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18866" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "640", + "videoResolutionHeight": "360", + "videoQualityControlType": "VBR", + "constantBitRate": "256", + "fixedQuality": "60", + "vbrUpperCap": "256", + "vbrLowerCap": "32", + "maxFrameRate": "1000", + "keyFrameInterval": "4000", + "snapShotImageType": "JPEG", + "H264Profile": "Baseline", + "GovLength": "40", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + ] + } + } } } } diff --git a/tests/fixtures/devices/DS-2CD2T46G2-ISU.json b/tests/fixtures/devices/DS-2CD2T46G2-ISU.json index 86c5657..7df37ee 100644 --- a/tests/fixtures/devices/DS-2CD2T46G2-ISU.json +++ b/tests/fixtures/devices/DS-2CD2T46G2-ISU.json @@ -1783,6 +1783,167 @@ "sensitivityLevel": "70" } } + }, + "Streaming/channels": { + "response": { + "StreamingChannelList": { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "StreamingChannel": [ + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "101", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8860" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18860" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "3840", + "videoResolutionHeight": "2160", + "videoQualityControlType": "VBR", + "constantBitRate": "12288", + "fixedQuality": "100", + "vbrUpperCap": "12288", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "Main", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main", + "SmartCodec": { + "enabled": "false" + } + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + }, + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "102", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8866" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18866" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "640", + "videoResolutionHeight": "360", + "videoQualityControlType": "VBR", + "constantBitRate": "256", + "fixedQuality": "60", + "vbrUpperCap": "256", + "vbrLowerCap": "32", + "maxFrameRate": "1000", + "keyFrameInterval": "4000", + "snapShotImageType": "JPEG", + "H264Profile": "Baseline", + "GovLength": "40", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + ] + } + } } } } diff --git a/tests/fixtures/devices/DS-2CD2T86G2-ISU.json b/tests/fixtures/devices/DS-2CD2T86G2-ISU.json index 5ad7dee..6d2cf5d 100644 --- a/tests/fixtures/devices/DS-2CD2T86G2-ISU.json +++ b/tests/fixtures/devices/DS-2CD2T86G2-ISU.json @@ -1774,6 +1774,167 @@ "sensitivityLevel": "30" } } + }, + "Streaming/channels": { + "response": { + "StreamingChannelList": { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "StreamingChannel": [ + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "101", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8860" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18860" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "3840", + "videoResolutionHeight": "2160", + "videoQualityControlType": "VBR", + "constantBitRate": "12288", + "fixedQuality": "100", + "vbrUpperCap": "12288", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "Main", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main", + "SmartCodec": { + "enabled": "false" + } + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + }, + { + "@version": "2.0", + "@xmlns": "http://www.hikvision.com/ver20/XMLSchema", + "id": "102", + "channelName": "yard", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + }, + { + "streamingTransport": "SRTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "0.0.0.0", + "videoDestPortNo": "8866" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18866" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "640", + "videoResolutionHeight": "360", + "videoQualityControlType": "VBR", + "constantBitRate": "256", + "fixedQuality": "60", + "vbrUpperCap": "256", + "vbrLowerCap": "32", + "maxFrameRate": "1000", + "keyFrameInterval": "4000", + "snapShotImageType": "JPEG", + "H264Profile": "Baseline", + "GovLength": "40", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "H265Profile": "Main" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + ] + } + } } } } diff --git a/tests/fixtures/devices/DS-2TD1228-2-QA.json b/tests/fixtures/devices/DS-2TD1228-2-QA.json new file mode 100644 index 0000000..fbf6031 --- /dev/null +++ b/tests/fixtures/devices/DS-2TD1228-2-QA.json @@ -0,0 +1,1717 @@ +{ + "data": { + "ISAPI": { + "System/deviceInfo": { + "response": { + "DeviceInfo": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "deviceName": "Camera", + "manufacturer": null, + "deviceID": "xxxxxxxxxxxxxxxxxxx", + "deviceDescription": "IPCamera", + "deviceLocation": "hangzhou", + "systemContact": "Hikvision.China", + "model": "DS-2TD1228-2-QA", + "serialNumber": "DS-2TD1228-2/QA/xxxxxxxxxxxxxxxxxx", + "macAddress": "a6:60:9e:f8:01:09", + "firmwareVersion": "V5.5.98", + "firmwareReleasedDate": "build 240726", + "encoderVersion": "V7.3", + "encoderReleasedDate": "build 240621", + "bootVersion": "V1.3.4", + "bootReleasedDate": "100316", + "hardwareVersion": "0x0", + "deviceType": "IPCamera", + "telecontrolID": "88", + "supportBeep": "false", + "supportVideoLoss": "false", + "bootTime": "2024-10-13T19:43:27+01:00" + } + } + }, + "System/capabilities": { + "response": { + "DeviceCap": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "isSupportDeviceInfo": "true", + "SysCap": { + "isSupportDst": "true", + "NetworkCap": { + "isSupportWireless": "false", + "isSupportPPPoE": "true", + "isSupportBond": "false", + "isSupport802_1x": "true", + "isSupportNtp": "true", + "isSupportFtp": "true", + "isSupportUpnp": "true", + "isSupportDdns": "true", + "isSupportHttps": "true", + "SnmpCap": { + "isSupport": "true" + }, + "isSupportExtNetCfg": "true", + "isSupportIPFilter": "true", + "isSupportSSH": "true", + "isSupportEZVIZ": "true", + "isSupportTrafficMonitor": "false", + "isSupportEhome": "true", + "isSupportWirelessDial": "false", + "isSupportWirelessServer": "false", + "isWirelessMutexWithWirelessServer": "false", + "isSupportMACFilter": "true", + "isSupportIntegrate": "true", + "isSupportPlatformAccess": "true", + "isSupportWebSocket": "true", + "isSupportWebSocketS": "true", + "isSupportVideoImgDB": "false", + "isSupportEventDataOverWebSocket": { + "@opt": "true,false", + "#text": "false" + }, + "isSupportGRIDServer": "false", + "isSupportGRIDInfo": "false", + "isSupportEZVIZUnbind": "false", + "isSupportModbusAccess": "true", + "isSupportModbusTestSubordinateStatus": "true", + "isSupportGetModbusAndRegisterMap": "true" + }, + "IOCap": { + "IOInputPortNums": "1", + "IOOutputPortNums": "1", + "isSupportStrobeLamp": "false", + "isSupportWebDisplayAlarmStatus": "true" + }, + "SerialCap": { + "rs485PortNums": "1", + "supportRS232Config": "true", + "rs422PortNums": "0", + "rs232PortNums": "1" + }, + "VideoCap": { + "videoInputPortNums": "0", + "videoOutputPortNums": "0", + "isSupportHeatmap": "false", + "isSupportCounting": "false", + "isSupportMotionDetection": "true", + "isSupportTamperDetection": "true", + "isSupportPicture": "true", + "isSupportPrivacyMask": "true", + "OSDLanguage": { + "@opt": "GBK,EUC-KR", + "#text": "GBK" + }, + "isSupportMenuStatus": "false" + }, + "AudioCap": { + "audioInputNums": "1", + "audioOutputNums": "1" + }, + "isSupportCustomAlarmHTTPParams": "true", + "isSupportTestCustomAlarmHTTP": "true", + "isSupportMetadata": "true", + "isSupportSubscribeEvent": "true", + "isSupportDiagnosedData": "true", + "isSupportGettingWorkingStatus": "true", + "isSupportTimeCap": "true", + "isSupportThermalStreamData": "true" + }, + "voicetalkNums": "1", + "isSupportSnapshot": "true", + "SecurityCap": { + "supportUserNums": "32", + "userBondIpNums": "0", + "userBondMacNums": "0", + "isSupCertificate": "true", + "issupIllegalLoginLock": "true", + "isSupportOnlineUser": "true", + "isSupportAnonymous": "false", + "isSupportStreamEncryption": "false", + "securityVersion": { + "@opt": "1", + "#text": "1" + }, + "keyIterateNum": "100", + "isSupportUserCheck": "true", + "isSupportSecurityQuestionConfig": "false", + "SecurityLimits": { + "LoginPasswordLenLimit": { + "@min": "1", + "@max": "16" + }, + "SecurityAnswerLenLimit": { + "@min": "1", + "@max": "128" + } + }, + "RSAKeyLength": { + "@opt": "1024,2048", + "@def": "2048", + "#text": "2048" + }, + "isSupportONVIFUserManagement": "true", + "WebCertificateCap": { + "CertificateType": { + "@opt": "digest,digest/basic", + "#text": "digest/basic" + }, + "SecurityAlgorithm": { + "algorithmType": { + "@opt": "MD5,SHA256,MD5/SHA256", + "#text": "MD5" + } + } + }, + "isSupportConfigFileImport": "true", + "isSupportConfigFileExport": "true", + "cfgFileSecretKeyLenLimit": { + "@min": "1", + "@max": "16", + "#text": "16" + }, + "isIrreversible": "true", + "salt": "xxxxxxxxxxxxxx", + "isSupportSIPCertificatesManagement": "false", + "isSupportRTSPCertificate": "true", + "isSupportGB35114Certificate": "false", + "maxIllegalLoginTimes": { + "@min": "3", + "@max": "20", + "@def": "5", + "#text": "5" + }, + "maxIllegalLoginLockTime": { + "@min": "1", + "@max": "120", + "@def": "30", + "#text": "30" + }, + "SecurityAdvanced": { + "noOperationEnabled": "true", + "noOperationTime": { + "@min": "1", + "@max": "60", + "@def": "10", + "#text": "10" + } + }, + "LoginLinkNum": { + "maxLinkNum": { + "@min": "1", + "@max": "128", + "@def": "50", + "#text": "50" + } + }, + "isSupportDeviceCertificatesManagement": "true", + "isSupportDeviceSelfSignCertExport": "true", + "isSupportCCClientCertificate": "true", + "isSupportCertificateCustomID": "true", + "isSupportEncryptCertificate": "true" + }, + "EventCap": { + "isSupportHDFull": "true", + "isSupportHDError": "true", + "isSupportNicBroken": "true", + "isSupportIpConflict": "true", + "isSupportIllAccess": "true", + "isSupportViException": "false", + "isSupportViMismatch": "false", + "isSupportRecordException": "false", + "isSupportTriggerFocus": "false", + "isSupportMotionDetection": "true", + "isSupportVideoLoss": "false", + "isSupportTamperDetection": "true", + "isSupportFireDetection": "true", + "isSupportPersonDensityDetection": "false", + "isSupportFaceThermometry": "false", + "isSupportVoltageInstable": "false", + "isSupportCertificateRevocation": ["true", "true"], + "isSupportPTLocking": "false", + "isSupportLowCoolerLifeEvent": "false", + "isSupportGreyScaleAlarm": "false", + "isSupportWasteGasDetection": "false", + "RegionScheduleCap": { + "isSupportPersonDensityDetection": "false" + }, + "isSupportThermalCalibrationFileException": "false", + "isSupportTemperatureIntervalMeasurement": "false", + "isSupportThermalVehicleDetection": "false", + "isSupportObstacleAvoidanceAlarm": "false", + "isSupportMixedTargetDetection": "false", + "isSupportInsulatorDetection": "false" + }, + "RacmCap": { + "nasNums": "8", + "pictureSearchType": { + "@opt": "CMR,MOTION,ALARM,scenechangedetection,HEOP" + }, + "recordSearchType": { + "@opt": "CMR,MOTION,ALARM,EDR,ALARMANDMOTION,AllEvent,AudioDetection,scenechangedetection" + }, + "SecurityLog": { + "isSupportSecurityLog": "true", + "isSupportLogServer": "true", + "isSupportLogServerTest": "true", + "SecurityLogTypeList": { + "SecurityLogType": [ + { + "primaryType": "All", + "secondaryType": { + "@opt": "all" + } + }, + { + "primaryType": "Operation", + "secondaryType": { + "@opt": "all,alarmSmsSend,callOnline,devicePowerOff,devicePowerOn,deviceRecycle,localAddIpc,localAddNas,localUserManagement,localCfgSecurity,localCfgNetwork,localCfgTime,localCfgPara,localCtrlPtz,localDelIpc,localDelNas,localDial,localDialParaSet,localDialScheduleSet,localDownloadCfgFile,localDownloadCountingFile,localDownloadHeatMapFile,localDownloadPicFile,localDownloadRecFile,localExportBlackWhiteListFile,localExportIpcCfg,localFormatDisk,localHdTest,localImportBlackWhiteListFile,localImportIpcCfg,localIpcUpgrade,localLock,localLockFile,localLogOut,localLogin,localManulAlarm,localPin,localPlayByFile,localPlayByTime,localResetPasswd,localSetIpc,localSetNas,localSetSIPServer,localSetSnmp,localSmsRead,localSmsSearch,localSmsSend,localSpareOperate,localStartPicRec,localStartRec,localStopPicRec,localStopRec,localTagOperation,localUnlock,localUnlockFile,localUpdate,localUploadCfgFile,localWhitelistSet,platOper,remoteAddIpc,remoteAddNas,remoteArm,remotecfgauditpolicy,remoteUserManagement,remoteCfgSecurity,remoteCfgNetwork,remoteCfgTime,remoteCfgPara,remoteCreateCloudStoragePool,remoteCtrlPtz,remoteDelHdisk,remoteDelIpc,remoteDelNas,remoteDeleteCloudStoragePool,remoteDeletePic,remoteDeleteRecord,remoteDialConnect,remoteDialDisconn,remoteDialParaSet,remoteDialScheduleSet,remoteDisArm,remoteDisableCloudStorage,remoteDownloadCfgFile,remoteDownloadRecFile,remoteEnableCloudStorage,remoteExportBlackWhiteListFile,remoteExportIpcCfg,remoteFormatHd,remoteGetParaSecurity,remoteGetParaNetwork,remoteGetPara,remoteGetStatus,remoteImportBlackWhiteListFile,VcaLibRestore,remoteImportIpcCfg,remoteLoadHdisk,remoteLockFile,remoteLogin,remoteLogout,remoteManulAlarm,remoteModCloudStorageParam,remoteModCloudStorageVolume,remotePicBackUp,remotePin,remotePlayByFile,remotePlayByTime,remotePowerOff,remotePowerRecycle,remoteSetIpc,remoteSetNas,remoteSetSIPServer,remoteSetSnmp,remoteSmsRead,remoteSmsSearch,remoteSmsSend,remoteSpareOperate,remoteStartPicRec,remoteStartRec,remoteStartTransChan,remoteStopPicRec,remoteStopRec,remoteStopTransChan,remoteTagOperation,remoteUnloadHdisk,remoteUnlockFile,remoteUpgrade,remoteUploadCfgFile,remoteWhitelistSet,remotelIpcUpgrade,smsControl,smsRecv,startVoiceTalk,stopAbnormal,stopVoiceTalk,localSetDeviceActive,localParamSimpleDefault,localParamFactoryDefault,remoteSetDeviceActive,remoteParamSimpleDefault,remoteParamFactoryDefault,localWPSLink,remoteWPSLink,localResetLoginPassWord,remoteResetLoginPassWord,localfaceBaseCreate,localfaceBaseModify,localfaceBaseDelete,localfaceDataAppend,localfaceDataEdit,localfaceDataDelete,localVcaAnalysisConfig,remotefaceBaseCreate,remotefaceBaseModify,remotefaceBaseDelete,remotefaceDataAppend,remotefaceDataEdit,remotefaceDataDelete,remoteVcaAnalysisConfig,localClusterNetworkConfig,localClusterAddDevice,localClusterDelDevice,remoteClusterNetworkConfig,remoteClusterAddDevice,remoteClusterDelDevice,localSetPoeWorkMode,remoteSetPoeWorkMode,localClusterModeConfig,remoteClusterModeConfig,localIOTCfgFileInput,localIOTCfgFileOutput,localIOTAdd,localIOTDelete,localIOTSet,remoteIOTCfgFileInput,remoteIOTCfgFileOutput,remoteIOTAdd,remoteIOTDelete,remoteIOTSet,localCheckTime,remoteCheckTime,remoteFaceContrastTask,unlockSession,terminateHttp,terminateHttps,terminateSSH,selfTest" + } + }, + { + "primaryType": "Event", + "secondaryType": { + "@opt": "all,anrRecordException,dialException,hdError,hdFull,illlegealAccess,ipConflict,ipcDisconnect,ipcIpConfilict,ipcmCrash,netBroken,poePowerException,recordError,recordOverFLow,spareException,startIpcMasException,uploadDataCsException,viAndResMismatch,videoException,videoFormatMismatch,videoLost,syncIPCPasswd,ezvizOffline,SDCardAbnormal,SDCardDamage,plateAbnormal,abnormalPort,POC,vcaCameraAngleAnomaly,dataDiskError,intelligentSystemRunningError,facesnapResolutionOverflow,SMDResolutionOverflow,clusterConfigFailed,clusterStorFullException,clusterOfflineNodeException,clusterRecordCycleException,clusterIPCTransferException,vcaSenceException,ClusterDeviceOffline,clusterDisasterToleranceExcept,clusterVersionException,getSubStreamFailure,locked,hddSHMDetectException,safetyHelmetException,faceModelException,validateCert,establishSecSession,replayAttacks,ntpCheckTime,lowAuditLogStorage,httpConnect,httpsConnect,sshConnect,httpDisconnect,httpsDisconnect,sshDisconnect" + } + }, + { + "primaryType": "Other", + "secondaryType": { + "@opt": "all" + } + } + ] + } + } + }, + "PTZCtrlCap": { + "isSupportPatrols": "false", + "isSupportCombinedPath": "false" + }, + "SmartCap": { + "isSupportROI": "true", + "isSupportFaceDetect": "false", + "isSupportIntelliTrace": "false", + "isSupportFieldDetection": "false", + "isSupportDefocusDetection": "false", + "isSupportAudioDetection": "true", + "isSupportSceneChangeDetection": "true", + "isSupportLineDetection": "false", + "isSupportRegionEntrance": "false", + "isSupportRegionExiting": "false", + "isSupportLoitering": "false", + "isSupportGroup": "false", + "isSupportRapidMove": "false", + "isSupportParking": "false", + "isSupportUnattendedBaggage": "false", + "isSupportAttendedBaggage": "false", + "isSupportShipsDetection": "false" + }, + "WLAlarmCap": { + "isSupportTeleControl": "false", + "isSupportPIR": "false", + "isSupportWLSensors": "false", + "isSupportCallHelp": "false" + }, + "TestCap": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "isSupportFTPTest": "true", + "isSupportPingTest": "true", + "isSupportNTPTest": "true", + "isSupportNASTest": "true", + "isSupportEmailTest": "true" + }, + "isSupportRealtimeTempHumi": "true", + "isSupportGIS": "false", + "isSupportCompass": "false", + "ImageMiscCap": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "isSupportDPC": "true" + }, + "isSupportRtspOverHTTPS": "true", + "ThermalCap": { + "isSupportFireDetection": "true", + "FireDetection": { + "supportChan": { + "@opt": "chan2" + } + }, + "isSupportThermometry": "true", + "isSupportRealtimeThermometry": "true", + "isSupportThermIntell": "true", + "isSupportThermometrySchedule": "true", + "isSupportPower": "false", + "isSupportRealtimeTempHumi": "true", + "isSupportFireShieldMask": "true", + "isSupportThermometryMode": "true", + "isSupportThermalPip": "true", + "isSupportThermalIntelRuleDisplay": "true", + "AlgVersionInfo": { + "thermometryAlgName": { + "@min": "1", + "@max": "128" + }, + "fireAlgName": { + "@min": "1", + "@max": "128" + } + }, + "isSupportThermalStreamParam": "true", + "isSupportClickToThermometry": "true", + "isSupportThermometryHistorySearch": "false", + "isSupportThermometryShieldMask": "true", + "isSupportTemperatureCorrection": "false", + "isSupportBurningPrevention": "false", + "isSupportJpegPicWithAppendData": "true", + "isSupportRealTimethermometryForHTTP": "true" + }, + "isSupportCurrentLock": "false", + "isSupportPlayback": "true", + "isSupportChannelEventCap": "true", + "isSupportChannelEventListCap": "true", + "OpenPlatformCap": { + "isSupportOpenPlatform": "false" + }, + "IOTCap": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "supportChannelNum": { + "@opt": "2", + "#text": "2" + }, + "startChannelNo": "1", + "isSupportlinkageChannelsSearch": "false" + }, + "isSupportImageCap": "true", + "isSupportCalibrationFile": "true", + "isSupportDisplayTrajectory": "true", + "Maximumsuperpositiontime": { + "@opt": "5,10,20,30", + "#text": "10" + }, + "isSupportUnitConfig": "true", + "isSupportActiveMulticast": "true", + "isSupportDiscoveryMode": "true", + "isSupportPictureServer": "true", + "isSupportDevStatus": "true", + "isSupportSnapshotAsync": "true", + "isSupportRemoveStorage": "false", + "isSupportPTModulePowerCfg": "false", + "isSupportDelayedReboot": "false", + "isSupportAutoMaintenance": "true", + "isSupportDiagnosedDataParameter": "true", + "isSupportISUPHttpPassthrough": "true", + "isSupportKeyFunctionList": "false", + "isSupportKeyValueList": "false", + "isSupportMenuFunctionList": "false", + "isSupportImageVignettingOptimizeParams": "false", + "isSupportDisplayThermometryFirePrevention": "true" + } + } + }, + "System/IO/inputs/1/status": { + "response": { + "IOPortStatus": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "ioPortID": "1", + "ioPortType": "input", + "ioState": "inactive" + } + } + }, + "System/IO/outputs/1/status": { + "response": { + "IOPortStatus": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "ioPortID": "1", + "ioPortType": "output", + "ioState": "inactive" + } + } + }, + "System/Holidays": { + "error": { + "__type": "", + "repr": "ISAPIForbiddenError('http://1.2.3.4/ISAPI/System/Holidays')" + } + }, + "System/Video/inputs/channels": { + "response": { + "VideoInputChannelList": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "VideoInputChannel": [ + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "1", + "inputPort": "1", + "name": "Camera 01", + "videoFormat": "PAL" + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "2", + "inputPort": "2", + "name": "Camera 02", + "videoFormat": "PAL" + } + ] + } + } + }, + "ContentMgmt/InputProxy/channels": { + "error": { + "__type": "", + "repr": "ISAPIForbiddenError('http://1.2.3.4/ISAPI/ContentMgmt/InputProxy/channels')" + } + }, + "ContentMgmt/Storage": { + "response": { + "storage": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "hddList": { + "@version": "1.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "@size": "8", + "hdd": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "1", + "hddName": "hdde", + "hddPath": null, + "hddType": "SATA", + "status": "ok", + "capacity": "244480", + "freeSpace": "156928", + "property": "RW", + "formatType": { + "@opt": "EXT4", + "#text": "EXT4" + }, + "Encryption": { + "passwordLen": { + "@min": "6", + "@max": "64" + }, + "encryptionStatus": { + "@opt": "unencrypted,encrypted,verfyFailed", + "#text": "encrypted" + }, + "encryptFormatType": { + "@opt": "FAT32,EXT4", + "#text": "EXT4" + } + } + } + }, + "nasList": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "supportMountType": { + "@opt": "NFS,SMB/CIFS" + }, + "authentication": { + "@opt": "SMB/CIFS" + } + }, + "workMode": "quota", + "posInfoStoragingEnabled": "true" + } + } + }, + "Security/adminAccesses": { + "response": { + "AdminAccessProtocolList": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "AdminAccessProtocol": [ + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "1", + "enabled": "true", + "protocol": "HTTP", + "portNo": "80" + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "2", + "enabled": "true", + "protocol": "HTTPS", + "redirectToHttps": "false", + "portNo": "443", + "TLS1_1Enable": "false", + "TLS1_2Enable": "true" + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "3", + "protocol": "DEV_MANAGE", + "portNo": "8000" + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "4", + "enabled": "true", + "protocol": "RTSP", + "portNo": "554" + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "5", + "enabled": "true", + "protocol": "WebSocket", + "portNo": "7681" + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "6", + "enabled": "true", + "protocol": "WebSocketS", + "portNo": "7682" + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "8", + "enabled": "true", + "protocol": "SRTP", + "portNo": "322" + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "9", + "enabled": "true", + "protocol": "modbusTCP", + "portNo": "502" + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "10", + "enabled": "true", + "protocol": "Bonjour" + } + ] + } + } + }, + "Event/triggers": { + "response": { + "EventNotification": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "EventTriggerList": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "EventTrigger": [ + { + "id": "IO-1", + "eventType": "IO", + "eventDescription": "IO Event trigger Information", + "inputIOPortID": "1", + "EventTriggerNotificationList": null + }, + { + "id": "VMD-1", + "eventType": "VMD", + "eventDescription": "VMD Event trigger Information", + "EventTriggerNotificationList": { + "EventTriggerNotification": [ + { + "id": "record-1", + "notificationMethod": "record", + "notificationRecurrence": "beginning", + "videoInputID": "1" + }, + { + "id": "beep", + "notificationMethod": "beep", + "notificationRecurrence": "beginning" + }, + { + "id": "center", + "notificationMethod": "center", + "notificationRecurrence": "beginning" + } + ] + } + }, + { + "id": "tamper-1", + "eventType": "tamperdetection", + "eventDescription": "shelteralarm Event trigger Information", + "EventTriggerNotificationList": null + }, + { + "id": "diskfull", + "eventType": "diskfull", + "eventDescription": "exception Information", + "EventTriggerNotificationList": null + }, + { + "id": "diskerror", + "eventType": "diskerror", + "eventDescription": "exception Information", + "EventTriggerNotificationList": { + "EventTriggerNotification": { + "id": "beep", + "notificationMethod": "beep", + "notificationRecurrence": "beginning" + } + } + }, + { + "id": "nicbroken", + "eventType": "nicbroken", + "eventDescription": "exception Information", + "EventTriggerNotificationList": null + }, + { + "id": "ipconflict", + "eventType": "ipconflict", + "eventDescription": "exception Information", + "EventTriggerNotificationList": null + }, + { + "id": "illaccess", + "eventType": "illaccess", + "eventDescription": "exception Information", + "EventTriggerNotificationList": null + }, + { + "id": "badvideo", + "eventType": "badvideo", + "eventDescription": "exception Information", + "EventTriggerNotificationList": null + }, + { + "id": "audioexception-1", + "eventType": "audioexception", + "eventDescription": "audioexception Event trigger Information", + "EventTriggerNotificationList": null + }, + { + "id": "thermometry-2", + "eventType": "thermometry", + "eventDescription": "thermometry Event trigger Information", + "videoInputChannelID": "2", + "dynVideoInputChannelID": "2", + "EventTriggerNotificationList": { + "EventTriggerNotification": { + "id": "center", + "notificationMethod": "center", + "notificationRecurrence": "beginning" + } + } + } + ] + } + } + } + }, + "Event/triggers/scenechangedetection-1": { + "response": { + "EventTrigger": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "scenechangedetection-1", + "eventType": "scenechangedetection", + "eventDescription": "scenechangedetection Event trigger Information", + "EventTriggerNotificationList": null + } + } + }, + "Event/notification/httpHosts": { + "response": { + "HttpHostNotificationList": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "HttpHostNotification": [ + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "1", + "url": "/api/hikvision", + "protocolType": "HTTP", + "parameterFormatType": "XML", + "addressingFormatType": "ipaddress", + "ipAddress": "1.0.0.182", + "portNo": "8123", + "userName": null, + "httpAuthenticationMethod": "none" + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "2", + "url": "/", + "protocolType": "HTTP", + "parameterFormatType": "XML", + "addressingFormatType": "ipaddress", + "ipAddress": "0.0.0.0", + "portNo": "80", + "userName": null, + "httpAuthenticationMethod": "none" + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "3", + "url": "/", + "protocolType": "HTTP", + "parameterFormatType": "XML", + "addressingFormatType": "ipaddress", + "ipAddress": "0.0.0.0", + "portNo": "80", + "userName": null, + "httpAuthenticationMethod": "none" + } + ] + } + } + }, + "Streaming/channels/101": { + "response": { + "StreamingChannel": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "101", + "channelName": "Camera 01", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "239.0.0.1", + "videoDestPortNo": "8860", + "audioDestPortNo": "8862" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18860", + "SRTPAudioDestPortNo": "18862" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.265", + "videoScanType": "progressive", + "videoResolutionWidth": "1920", + "videoResolutionHeight": "1080", + "videoQualityControlType": "VBR", + "constantBitRate": "3072", + "fixedQuality": "60", + "vbrUpperCap": "3072", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "IntelligentInfoDisplayMethod": "non-player" + }, + "Audio": { + "enabled": "true", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + } + }, + "Streaming/channels/102": { + "response": { + "StreamingChannel": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "102", + "channelName": "Camera 01", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "239.0.0.1", + "videoDestPortNo": "8866", + "audioDestPortNo": "8868" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18866", + "SRTPAudioDestPortNo": "18868" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "704", + "videoResolutionHeight": "576", + "videoQualityControlType": "VBR", + "constantBitRate": "1024", + "fixedQuality": "60", + "vbrUpperCap": "1024", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "Main", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "IntelligentInfoDisplayMethod": "non-player" + }, + "Audio": { + "enabled": "true", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + } + }, + "Streaming/channels/103": { + "response": { + "StreamingChannel": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "103", + "channelName": "Camera 01", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "239.0.0.1", + "videoDestPortNo": "8860", + "audioDestPortNo": "8862" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18860", + "SRTPAudioDestPortNo": "18862" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.265", + "videoScanType": "progressive", + "videoResolutionWidth": "1920", + "videoResolutionHeight": "1080", + "videoQualityControlType": "VBR", + "constantBitRate": "3072", + "fixedQuality": "60", + "vbrUpperCap": "3072", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "IntelligentInfoDisplayMethod": "non-player" + }, + "Audio": { + "enabled": "true", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + } + }, + "Streaming/channels/104": { + "response": { + "StreamingChannel": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "104", + "channelName": "Camera 01", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "239.0.0.1", + "videoDestPortNo": "8860", + "audioDestPortNo": "8862" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18860", + "SRTPAudioDestPortNo": "18862" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.265", + "videoScanType": "progressive", + "videoResolutionWidth": "1920", + "videoResolutionHeight": "1080", + "videoQualityControlType": "VBR", + "constantBitRate": "3072", + "fixedQuality": "60", + "vbrUpperCap": "3072", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "IntelligentInfoDisplayMethod": "non-player" + }, + "Audio": { + "enabled": "true", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + } + }, + "Streaming/channels/201": { + "response": { + "StreamingChannel": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "201", + "channelName": "Camera 02", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "239.0.0.1", + "videoDestPortNo": "8878", + "audioDestPortNo": "8880" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18878", + "SRTPAudioDestPortNo": "18880" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "2", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "640", + "videoResolutionHeight": "512", + "videoQualityControlType": "CBR", + "constantBitRate": "2048", + "fixedQuality": "60", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "High", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "IntelligentInfoDisplayMethod": "non-player" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + } + }, + "Streaming/channels/202": { + "response": { + "StreamingChannel": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "202", + "channelName": "Camera 02", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "239.0.0.1", + "videoDestPortNo": "8884", + "audioDestPortNo": "8886" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18884", + "SRTPAudioDestPortNo": "18886" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "2", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "320", + "videoResolutionHeight": "240", + "videoQualityControlType": "CBR", + "constantBitRate": "1024", + "fixedQuality": "60", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "Main", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "IntelligentInfoDisplayMethod": "non-player" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + } + }, + "Streaming/channels/203": { + "response": { + "StreamingChannel": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "203", + "channelName": "Camera 02", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "239.0.0.1", + "videoDestPortNo": "8878", + "audioDestPortNo": "8880" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18878", + "SRTPAudioDestPortNo": "18880" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "2", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "640", + "videoResolutionHeight": "512", + "videoQualityControlType": "CBR", + "constantBitRate": "2048", + "fixedQuality": "60", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "High", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "IntelligentInfoDisplayMethod": "non-player" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + } + }, + "Streaming/channels/204": { + "response": { + "StreamingChannel": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "204", + "channelName": "Camera 02", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "239.0.0.1", + "videoDestPortNo": "8878", + "audioDestPortNo": "8880" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18878", + "SRTPAudioDestPortNo": "18880" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "2", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "640", + "videoResolutionHeight": "512", + "videoQualityControlType": "CBR", + "constantBitRate": "2048", + "fixedQuality": "60", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "High", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "IntelligentInfoDisplayMethod": "non-player" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + } + }, + "System/Video/inputs/channels/2/motionDetection": { + "response": { + "MotionDetection": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "enabled": "true", + "enableHighlight": "true", + "samplingInterval": "2", + "startTriggerTime": "500", + "endTriggerTime": "500", + "regionType": "grid", + "Grid": { + "rowGranularity": "18", + "columnGranularity": "22" + }, + "MotionDetectionLayout": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "sensitivityLevel": "20", + "layout": { + "gridMap": "0000000000000000000000e00000f0fffffefffffefffffefffffefffffefffffefffffefffffefffffefffffefffffefffffefffffe" + } + } + } + } + }, + "Streaming/channels": { + "response": { + "StreamingChannelList": { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "StreamingChannel": [ + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "101", + "channelName": "Camera 01", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "239.0.0.1", + "videoDestPortNo": "8860", + "audioDestPortNo": "8862" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18860", + "SRTPAudioDestPortNo": "18862" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.265", + "videoScanType": "progressive", + "videoResolutionWidth": "1920", + "videoResolutionHeight": "1080", + "videoQualityControlType": "VBR", + "constantBitRate": "3072", + "fixedQuality": "60", + "vbrUpperCap": "3072", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "IntelligentInfoDisplayMethod": "non-player" + }, + "Audio": { + "enabled": "true", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "102", + "channelName": "Camera 01", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "239.0.0.1", + "videoDestPortNo": "8866", + "audioDestPortNo": "8868" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18866", + "SRTPAudioDestPortNo": "18868" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "1", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "704", + "videoResolutionHeight": "576", + "videoQualityControlType": "VBR", + "constantBitRate": "1024", + "fixedQuality": "60", + "vbrUpperCap": "1024", + "vbrLowerCap": "32", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "Main", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "IntelligentInfoDisplayMethod": "non-player" + }, + "Audio": { + "enabled": "true", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "201", + "channelName": "Camera 02", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "239.0.0.1", + "videoDestPortNo": "8878", + "audioDestPortNo": "8880" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18878", + "SRTPAudioDestPortNo": "18880" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "2", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "640", + "videoResolutionHeight": "512", + "videoQualityControlType": "CBR", + "constantBitRate": "2048", + "fixedQuality": "60", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "High", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "IntelligentInfoDisplayMethod": "non-player" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + }, + { + "@version": "2.0", + "@xmlns": "http://www.isapi.org/ver20/XMLSchema", + "id": "202", + "channelName": "Camera 02", + "enabled": "true", + "Transport": { + "maxPacketSize": "1000", + "ControlProtocolList": { + "ControlProtocol": [ + { + "streamingTransport": "RTSP" + }, + { + "streamingTransport": "HTTP" + }, + { + "streamingTransport": "SHTTP" + } + ] + }, + "Unicast": { + "enabled": "true", + "rtpTransportType": "RTP/TCP" + }, + "Multicast": { + "enabled": "true", + "destIPAddress": "239.0.0.1", + "videoDestPortNo": "8884", + "audioDestPortNo": "8886" + }, + "Security": { + "enabled": "true", + "certificateType": "digest", + "SecurityAlgorithm": { + "algorithmType": "MD5" + } + }, + "SRTPMulticast": { + "SRTPVideoDestPortNo": "18884", + "SRTPAudioDestPortNo": "18886" + } + }, + "Video": { + "enabled": "true", + "videoInputChannelID": "2", + "videoCodecType": "H.264", + "videoScanType": "progressive", + "videoResolutionWidth": "320", + "videoResolutionHeight": "240", + "videoQualityControlType": "CBR", + "constantBitRate": "1024", + "fixedQuality": "60", + "maxFrameRate": "2500", + "keyFrameInterval": "2000", + "snapShotImageType": "JPEG", + "H264Profile": "Main", + "GovLength": "50", + "SVC": { + "enabled": "false" + }, + "PacketType": ["PS", "RTP"], + "smoothing": "50", + "IntelligentInfoDisplayMethod": "non-player" + }, + "Audio": { + "enabled": "false", + "audioInputChannelID": "1", + "audioCompressionType": "G.711ulaw" + } + } + ] + } + } + } + } + } +} diff --git a/tests/test_camera.py b/tests/test_camera.py index e58d63a..8ed790b 100644 --- a/tests/test_camera.py +++ b/tests/test_camera.py @@ -7,6 +7,7 @@ from homeassistant.const import STATE_IDLE from homeassistant.components.camera.helper import get_camera_from_entity_id from homeassistant.components.camera import DOMAIN as CAMERA_DOMAIN +from custom_components.hikvision_next.hikvision_device import HikvisionDevice from pytest_homeassistant_custom_component.common import MockConfigEntry from tests.conftest import load_fixture from tests.conftest import TEST_HOST @@ -124,3 +125,12 @@ async def test_camera_stream_info(hass: HomeAssistant, init_integration: MockCon stream_url = await camera_entity.stream_source() assert stream_url == f"rtsp://u1:%2A%2A%2A@1.0.0.255:{data['rtsp_port']}/Streaming/channels/101" + +@pytest.mark.parametrize("init_integration", ["DS-2TD1228-2-QA"], indirect=True) +async def test_camera_multichannel(hass: HomeAssistant, init_integration: MockConfigEntry) -> None: + entry = init_integration + + device: HikvisionDevice = entry.runtime_data + assert len(device.cameras) == 2 # video channel + thermal channel + assert device.cameras[0].input_port == 1 + assert device.cameras[1].input_port == 2 diff --git a/tests/test_init.py b/tests/test_init.py index aa39eb1..80f45bd 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -7,27 +7,27 @@ from custom_components.hikvision_next.hikvision_device import HikvisionDevice from pytest_homeassistant_custom_component.common import MockConfigEntry from homeassistant.config_entries import ConfigEntryState + from tests.conftest import TEST_CONFIG, TEST_CONFIG_WITH_ALARM_SERVER, TEST_CONFIG_OUTSIDE_NETWORK -@pytest.mark.parametrize( - "init_integration", - [ - "DS-7608NXI-I2", - "DS-2CD2386G2-IU", - "DS-2CD2146G2-ISU", - "DS-2CD2443G0-IW", - "DS-2CD2532F-IWS", - "DS-2CD2346G2-ISU", - "DS-2CD2T46G2-ISU", - "DS-2CD2T86G2-ISU", - "DS-7616NI-K2", - "DS-7616NI-Q2", - "DS-7732NI-M4", - "iDS-7204HUHI-M1", - ], - indirect=True, -) +@pytest.mark.parametrize("init_integration", +[ + "DS-7608NXI-I2", + "DS-2CD2386G2-IU", + "DS-2CD2146G2-ISU", + "DS-2CD2443G0-IW", + "DS-2CD2532F-IWS", + "DS-2TD1228-2-QA", + "DS-2CD2346G2-ISU", + "DS-2CD2T46G2-ISU", + "DS-2CD2T86G2-ISU", + "DS-7616NI-K2", + "DS-7616NI-Q2", + "DS-7732NI-M4", + "iDS-7204HUHI-M1" +], indirect=True) + async def test_basic_init(hass: HomeAssistant, init_integration: MockConfigEntry) -> None: """Test a successful setup entry.""" diff --git a/tests/test_notifications.py b/tests/test_notifications.py index 8da7497..5336e87 100644 --- a/tests/test_notifications.py +++ b/tests/test_notifications.py @@ -80,6 +80,26 @@ async def test_ipc_intrusion_detection_alert( assert sensor.state == STATE_ON +@pytest.mark.parametrize("init_integration", ["DS-2TD1228-2-QA"], indirect=True) +async def test_ipc_motion_detection_on_thermometry_channel_alert( + hass: HomeAssistant, init_integration: MockConfigEntry, +) -> None: + """Test incoming motion detection event alert on thermometry channel from ip multi channel camera.""" + + entity_id = "binary_sensor.ds_2td1228_2_qa_xxxxxxxxxxxxxxxxxx_2_motiondetection" + + assert (sensor := hass.states.get(entity_id)) + assert sensor.state == STATE_OFF + + view = EventNotificationsView(hass) + mock_request = mock_event_notification("ipc_thermometry_motiondetection") + response = await view.post(mock_request) + + assert response.status == HTTPStatus.OK + assert (sensor := hass.states.get(entity_id)) + assert sensor.state == STATE_ON + + @pytest.mark.parametrize("init_integration", ["DS-2CD2146G2-ISU"], indirect=True) async def test_field_detection_alert( hass: HomeAssistant, init_integration: MockConfigEntry,