Open stalakerob opened 5 years ago
Are you comfortable editing the pyhik package files to add some more debugging info?
In the hikvision.py file i'd like you to change line 497 from:
_LOGGING.warning('XML parse error in stream.')
to this:
_LOGGING.warning('XML parse error in stream: %s', err)
That will output the actual parse error which should help track down the problem.
OK. Done. This is the new output, getting no element found ...
-- Logs begin at Tue 2019-09-10 23:52:01 CEST. -- Sep 12 17:25:04 raspi4 hass[20100]: 2019-09-12 17:25:04 DEBUG (SyncWorker_10) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Line_Crossing, Options - Ignore: None, Delay: None Sep 12 17:25:04 raspi4 hass[20100]: 2019-09-12 17:25:04 DEBUG (SyncWorker_10) [pyhik.hikvision] Added update callback to <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Line Crossing: off>> on cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 Sep 12 17:25:04 raspi4 hass[20100]: 2019-09-12 17:25:04 DEBUG (SyncWorker_10) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Field_Detection, Options - Ignore: None, Delay: None Sep 12 17:25:04 raspi4 hass[20100]: 2019-09-12 17:25:04 DEBUG (SyncWorker_10) [pyhik.hikvision] Added update callback to <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Field Detection: off>> on cea94000-fb96-11b3-8260-686dbc63f0a1.Field Detection.1 Sep 12 17:25:04 raspi4 hass[20100]: 2019-09-12 17:25:04 DEBUG (SyncWorker_10) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Face_Detection, Options - Ignore: True, Delay: 0 Sep 12 17:25:04 raspi4 hass[20100]: 2019-09-12 17:25:04 DEBUG (SyncWorker_10) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Unattended_Baggage, Options - Ignore: True, Delay: 0 Sep 12 17:25:04 raspi4 hass[20100]: 2019-09-12 17:25:04 DEBUG (SyncWorker_10) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Attended_Baggage, Options - Ignore: True, Delay: 0 Sep 12 17:25:04 raspi4 hass[20100]: 2019-09-12 17:25:04 DEBUG (SyncWorker_10) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Scene_Change_Detection, Options - Ignore: True, Delay: 0 Sep 12 17:25:13 raspi4 hass[20100]: 2019-09-12 17:25:13 DEBUG (Thread-8) [pyhik.hikvision] Stream Thread Started: HikVision, cea94000-fb96-11b3-8260-686dbc63f0a1 Sep 12 17:25:13 raspi4 hass[20100]: 2019-09-12 17:25:13 DEBUG (Thread-8) [pyhik.hikvision] HikVision Connection Successful. Sep 12 17:26:05 raspi4 hass[20100]: 2019-09-12 17:26:05 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Line Crossing, [True, 1, 1, datetime.datetime(2019, 9, 12, 17, 26, 5, 815395)] Sep 12 17:26:05 raspi4 hass[20100]: 2019-09-12 17:26:05 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Line Crossing: on>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 Sep 12 17:26:05 raspi4 hass[20100]: 2019-09-12 17:26:05 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 Sep 12 17:26:09 raspi4 hass[20100]: 2019-09-12 17:26:09 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 3154 Sep 12 17:26:10 raspi4 hass[20100]: 2019-09-12 17:26:10 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 3154 Sep 12 17:26:10 raspi4 hass[20100]: 2019-09-12 17:26:10 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Line Crossing, [False, 1, 9, datetime.datetime(2019, 9, 12, 17, 26, 10, 69000)] Sep 12 17:26:10 raspi4 hass[20100]: 2019-09-12 17:26:10 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Line Crossing: off>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 Sep 12 17:26:10 raspi4 hass[20100]: 2019-09-12 17:26:10 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 Sep 12 17:26:10 raspi4 hass[20100]: 2019-09-12 17:26:10 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Motion, [True, 1, 10, datetime.datetime(2019, 9, 12, 17, 26, 10, 661063)] Sep 12 17:26:10 raspi4 hass[20100]: 2019-09-12 17:26:10 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Motion: on>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1 Sep 12 17:26:10 raspi4 hass[20100]: 2019-09-12 17:26:10 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1 Sep 12 17:26:11 raspi4 hass[20100]: 2019-09-12 17:26:11 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Field Detection, [True, 1, 12, datetime.datetime(2019, 9, 12, 17, 26, 11, 576723)] Sep 12 17:26:11 raspi4 hass[20100]: 2019-09-12 17:26:11 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Field Detection: on>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Field Detection.1 Sep 12 17:26:11 raspi4 hass[20100]: 2019-09-12 17:26:11 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Field Detection.1 Sep 12 17:26:15 raspi4 hass[20100]: 2019-09-12 17:26:15 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Field Detection, [False, 1, 21, datetime.datetime(2019, 9, 12, 17, 26, 15, 770369)] Sep 12 17:26:15 raspi4 hass[20100]: 2019-09-12 17:26:15 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Field Detection: off>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Field Detection.1 Sep 12 17:26:15 raspi4 hass[20100]: 2019-09-12 17:26:15 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Field Detection.1 Sep 12 17:26:20 raspi4 hass[20100]: 2019-09-12 17:26:20 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 11016 Sep 12 17:26:21 raspi4 hass[20100]: 2019-09-12 17:26:21 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 3156 Sep 12 17:26:22 raspi4 hass[20100]: 2019-09-12 17:26:22 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 3156 Sep 12 17:26:23 raspi4 hass[20100]: 2019-09-12 17:26:23 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 3156 Sep 12 17:26:24 raspi4 hass[20100]: 2019-09-12 17:26:24 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 3156 Sep 12 17:26:24 raspi4 hass[20100]: 2019-09-12 17:26:24 DEBUG (Thread-8) [pyhik.hikvision] Updating stale event Motion on CH(1) Sep 12 17:26:24 raspi4 hass[20100]: 2019-09-12 17:26:24 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Motion, [False, 1, 19, datetime.datetime(2019, 9, 12, 17, 26, 24, 199565)] Sep 12 17:26:24 raspi4 hass[20100]: 2019-09-12 17:26:24 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Motion: off>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1 Sep 12 17:26:24 raspi4 hass[20100]: 2019-09-12 17:26:24 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1 Sep 12 17:26:38 raspi4 hass[20100]: 2019-09-12 17:26:38 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 8646
Ok, not as helpful as i'd hoped. Can you add a new logging line under that one? This should log the collected XML so I can see what is getting collected incorrectly.
_LOGGING.debug(parse_string)
Lot's of data now:
2019-09-12 17:48:20 WARNING (MainThread) [homeassistant.components.http.auth] legacy_api_password support has been enabled. 2019-09-12 17:48:22 DEBUG (SyncWorker_11) [pyhik.hikvision] pyHik 0.2.3 initializing new hikvision device at: http://192.168.1.201 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [pyhik.hikvision] Basic authentication failed. Using digest. 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [pyhik.hikvision] Using Namespace: http://www.hikvision.com/ver20/XMLSchema 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [pyhik.hikvision] Processed cea94000-fb96-11b3-8260-686dbc63f0a1 as CAM Device. 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [pyhik.hikvision] Found events: {'VMD': [1], 'tamperdetection': [1], 'diskfull': [1], 'diskerror': [1], 'illaccess': [1], 'linedetection': [1], 'fielddetection': [1], 'facedetection': [1], 'unattendedBaggage': [1], 'attendedBaggage': [1], 'scenechangedetection': [1]} 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [pyhik.hikvision] Initialized Dictionary: {'Motion': [[False, 1, 0, datetime.datetime(2019, 9, 12, 17, 48, 23, 102815)]], 'Tamper Detection': [[False, 1, 0, datetime.datetime(2019, 9, 12, 17, 48, 23, 102830)]], 'Disk Full': [[False, 1, 0, datetime.datetime(2019, 9, 12, 17, 48, 23, 102837)]], 'Disk Error': [[False, 1, 0, datetime.datetime(2019, 9, 12, 17, 48, 23, 102843)]], 'Illegal Access': [[False, 1, 0, datetime.datetime(2019, 9, 12, 17, 48, 23, 102849)]], 'Line Crossing': [[False, 1, 0, datetime.datetime(2019, 9, 12, 17, 48, 23, 102855)]], 'Field Detection': [[False, 1, 0, datetime.datetime(2019, 9, 12, 17, 48, 23, 102861)]], 'Face Detection': [[False, 1, 0, datetime.datetime(2019, 9, 12, 17, 48, 23, 102867)]], 'Unattended Baggage': [[False, 1, 0, datetime.datetime(2019, 9, 12, 17, 48, 23, 102873)]], 'Attended Baggage': [[False, 1, 0, datetime.datetime(2019, 9, 12, 17, 48, 23, 102879)]], 'Scene Change Detection': [[False, 1, 0, datetime.datetime(2019, 9, 12, 17, 48, 23, 103093)]]} 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Motion, Options - Ignore: None, Delay: None 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [pyhik.hikvision] Added update callback to <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Motion: off>> on cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Tamper_Detection, Options - Ignore: True, Delay: 0 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Disk_Full, Options - Ignore: True, Delay: 0 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Disk_Error, Options - Ignore: True, Delay: 0 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Illegal_Access, Options - Ignore: True, Delay: 0 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Line_Crossing, Options - Ignore: None, Delay: None 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [pyhik.hikvision] Added update callback to <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Line Crossing: off>> on cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Field_Detection, Options - Ignore: None, Delay: None 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [pyhik.hikvision] Added update callback to <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Field Detection: off>> on cea94000-fb96-11b3-8260-686dbc63f0a1.Field Detection.1 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Face_Detection, Options - Ignore: True, Delay: 0 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Unattended_Baggage, Options - Ignore: True, Delay: 0 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Attended_Baggage, Options - Ignore: True, Delay: 0 2019-09-12 17:48:23 DEBUG (SyncWorker_11) [homeassistant.components.hikvision.binary_sensor] Entity: Hikvision_Cam - Scene_Change_Detection, Options - Ignore: True, Delay: 0 2019-09-12 17:48:32 DEBUG (Thread-8) [pyhik.hikvision] Stream Thread Started: HikVision, cea94000-fb96-11b3-8260-686dbc63f0a1 2019-09-12 17:48:32 DEBUG (Thread-8) [pyhik.hikvision] HikVision Connection Successful. 2019-09-12 17:50:20 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Line Crossing, [True, 1, 1, datetime.datetime(2019, 9, 12, 17, 50, 20, 415989)] 2019-09-12 17:50:20 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Line Crossing: on>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 2019-09-12 17:50:20 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 2019-09-12 17:50:21 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 3154 2019-09-12 17:50:21 DEBUG (Thread-8) [pyhik.hikvision] <EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:20+01:00</dateTime><activePostCount>3</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>75</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>241</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>988</positionY></RegionCoordinates><RegionCoordinates><positionX>241</positionX><positionY>988</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>4</regionID><sensitivityLevel>25</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>217</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>437</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>437</positionX><positionY>138</positionY></RegionCoordinates><RegionCoordinates><positionX>217</positionX>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 1256<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:20+01:00</dateTime><activePostCount>4</activePostCount><eventType>linedetection</eventType><eventState>active</eventState><eventDescription>linedetection alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>100</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>327</positionX><positionY>991</positionY></RegionCoordinates><RegionCoordinates><positionX>217</positionX><positionY>376</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry></DetectionRegionList><channelName></channelName><Extensions version="1.0" xmlns="urn:psialliance-org"><serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143</serialNumber><eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">IO&&DS-2CD2045FWD-I20190608AAWRD27854143,2019-09-12T17:50:20+01:00,1.0</eventPush></Extensions></EventNotificationAlert> 2019-09-12 17:50:22 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 3154 2019-09-12 17:50:22 DEBUG (Thread-8) [pyhik.hikvision] <EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:21+01:00</dateTime><activePostCount>5</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>75</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>241</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>988</positionY></RegionCoordinates><RegionCoordinates><positionX>241</positionX><positionY>988</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>4</regionID><sensitivityLevel>25</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>217</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>437</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>437</positionX><positionY>138</positionY></RegionCoordinates><RegionCoordinates><positionX>217</positionX>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 1256<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:21+01:00</dateTime><activePostCount>6</activePostCount><eventType>linedetection</eventType><eventState>active</eventState><eventDescription>linedetection alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>100</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>327</positionX><positionY>991</positionY></RegionCoordinates><RegionCoordinates><positionX>217</positionX><positionY>376</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry></DetectionRegionList><channelName></channelName><Extensions version="1.0" xmlns="urn:psialliance-org"><serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143</serialNumber><eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">IO&&DS-2CD2045FWD-I20190608AAWRD27854143,2019-09-12T17:50:21+01:00,1.0</eventPush></Extensions></EventNotificationAlert> 2019-09-12 17:50:22 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Motion, [True, 1, 7, datetime.datetime(2019, 9, 12, 17, 50, 22, 828314)] 2019-09-12 17:50:22 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Motion: on>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1 2019-09-12 17:50:22 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1 2019-09-12 17:50:24 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Line Crossing, [False, 1, 11, datetime.datetime(2019, 9, 12, 17, 50, 24, 648712)] 2019-09-12 17:50:24 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Line Crossing: off>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 2019-09-12 17:50:24 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 2019-09-12 17:50:26 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Field Detection, [True, 1, 14, datetime.datetime(2019, 9, 12, 17, 50, 26, 455823)] 2019-09-12 17:50:26 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Field Detection: on>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Field Detection.1 2019-09-12 17:50:26 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Field Detection.1 2019-09-12 17:50:30 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Field Detection, [False, 1, 23, datetime.datetime(2019, 9, 12, 17, 50, 30, 359947)] 2019-09-12 17:50:30 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Field Detection: off>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Field Detection.1 2019-09-12 17:50:30 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Field Detection.1 2019-09-12 17:50:34 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Line Crossing, [True, 1, 29, datetime.datetime(2019, 9, 12, 17, 50, 34, 584910)] 2019-09-12 17:50:34 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Line Crossing: on>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 2019-09-12 17:50:34 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 2019-09-12 17:50:36 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 3156 2019-09-12 17:50:36 DEBUG (Thread-8) [pyhik.hikvision] <EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:35+01:00</dateTime><activePostCount>32</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>75</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>241</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>988</positionY></RegionCoordinates><RegionCoordinates><positionX>241</positionX><positionY>988</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>4</regionID><sensitivityLevel>25</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>217</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>437</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>437</positionX><positionY>138</positionY></RegionCoordinates><RegionCoordinates><positionX>217</positionX>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 1257<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:35+01:00</dateTime><activePostCount>33</activePostCount><eventType>linedetection</eventType><eventState>active</eventState><eventDescription>linedetection alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>100</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>327</positionX><positionY>991</positionY></RegionCoordinates><RegionCoordinates><positionX>217</positionX><positionY>376</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry></DetectionRegionList><channelName></channelName><Extensions version="1.0" xmlns="urn:psialliance-org"><serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143</serialNumber><eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">IO&&DS-2CD2045FWD-I20190608AAWRD27854143,2019-09-12T17:50:35+01:00,1.0</eventPush></Extensions></EventNotificationAlert> 2019-09-12 17:50:37 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 3156 2019-09-12 17:50:37 DEBUG (Thread-8) [pyhik.hikvision] <EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:36+01:00</dateTime><activePostCount>34</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>75</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>241</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>988</positionY></RegionCoordinates><RegionCoordinates><positionX>241</positionX><positionY>988</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>4</regionID><sensitivityLevel>25</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>217</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>437</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>437</positionX><positionY>138</positionY></RegionCoordinates><RegionCoordinates><positionX>217</positionX>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 1257<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:36+01:00</dateTime><activePostCount>35</activePostCount><eventType>linedetection</eventType><eventState>active</eventState><eventDescription>linedetection alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>100</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>327</positionX><positionY>991</positionY></RegionCoordinates><RegionCoordinates><positionX>217</positionX><positionY>376</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry></DetectionRegionList><channelName></channelName><Extensions version="1.0" xmlns="urn:psialliance-org"><serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143</serialNumber><eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">IO&&DS-2CD2045FWD-I20190608AAWRD27854143,2019-09-12T17:50:36+01:00,1.0</eventPush></Extensions></EventNotificationAlert> 2019-09-12 17:50:38 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 3156 2019-09-12 17:50:38 DEBUG (Thread-8) [pyhik.hikvision] <EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:37+01:00</dateTime><activePostCount>36</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>75</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>241</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>988</positionY></RegionCoordinates><RegionCoordinates><positionX>241</positionX><positionY>988</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>3</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>739</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>997</positionY></RegionCoordinates><RegionCoordinates><positionX>739</positionX>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 1257<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:37+01:00</dateTime><activePostCount>37</activePostCount><eventType>linedetection</eventType><eventState>active</eventState><eventDescription>linedetection alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>100</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>327</positionX><positionY>991</positionY></RegionCoordinates><RegionCoordinates><positionX>217</positionX><positionY>376</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry></DetectionRegionList><channelName></channelName><Extensions version="1.0" xmlns="urn:psialliance-org"><serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143</serialNumber><eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">IO&&DS-2CD2045FWD-I20190608AAWRD27854143,2019-09-12T17:50:37+01:00,1.0</eventPush></Extensions></EventNotificationAlert> 2019-09-12 17:50:39 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 3156 2019-09-12 17:50:39 DEBUG (Thread-8) [pyhik.hikvision] <EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:38+01:00</dateTime><activePostCount>38</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>75</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>241</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>988</positionY></RegionCoordinates><RegionCoordinates><positionX>241</positionX><positionY>988</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 1257<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:38+01:00</dateTime><activePostCount>39</activePostCount><eventType>linedetection</eventType><eventState>active</eventState><eventDescription>linedetection alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>100</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>327</positionX><positionY>991</positionY></RegionCoordinates><RegionCoordinates><positionX>217</positionX><positionY>376</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry></DetectionRegionList><channelName></channelName><Extensions version="1.0" xmlns="urn:psialliance-org"><serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143</serialNumber><eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">IO&&DS-2CD2045FWD-I20190608AAWRD27854143,2019-09-12T17:50:38+01:00,1.0</eventPush></Extensions></EventNotificationAlert> 2019-09-12 17:50:39 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Line Crossing, [False, 1, 40, datetime.datetime(2019, 9, 12, 17, 50, 39, 393610)] 2019-09-12 17:50:39 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Line Crossing: off>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 2019-09-12 17:50:39 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Line Crossing.1 2019-09-12 17:50:52 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: no element found: line 1, column 8646 2019-09-12 17:50:52 DEBUG (Thread-8) [pyhik.hikvision] <EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:39+01:00</dateTime><activePostCount>41</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>75</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>241</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>988</positionY></RegionCoordinates><RegionCoordinates><positionX>241</positionX><positionY>988</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 2037<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:40+01:00</dateTime><activePostCount>42</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>75</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>241</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>988</positionY></RegionCoordinates><RegionCoordinates><positionX>241</positionX><positionY>988</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 2037<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:41+01:00</dateTime><activePostCount>43</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>75</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>241</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>988</positionY></RegionCoordinates><RegionCoordinates><positionX>241</positionX><positionY>988</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 2037<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:42+01:00</dateTime><activePostCount>44</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>1</regionID><sensitivityLevel>75</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>241</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>133</positionY></RegionCoordinates><RegionCoordinates><positionX>730</positionX><positionY>988</positionY></RegionCoordinates><RegionCoordinates><positionX>241</positionX><positionY>988</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 821<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:50:42+01:00</dateTime><activePostCount>45</activePostCount><eventType>VMD</eventType><eventState>inactive</eventState><eventDescription>Motion alarm</eventDescription><channelName></channelName><Extensions version="1.0" xmlns="urn:psialliance-org"><serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143</serialNumber><eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143,2019-09-12T17:50:42+01:00,0,1.0</eventPush></Extensions></EventNotificationAlert> 2019-09-12 17:51:02 DEBUG (Thread-8) [pyhik.hikvision] Updating stale event Motion on CH(1) 2019-09-12 17:51:02 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Motion, [False, 1, 30, datetime.datetime(2019, 9, 12, 17, 51, 2, 540428)] 2019-09-12 17:51:02 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Motion: off>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1 2019-09-12 17:51:02 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1 2019-09-12 17:51:57 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Motion, [True, 1, 46, datetime.datetime(2019, 9, 12, 17, 51, 57, 190553)] 2019-09-12 17:51:57 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Motion: on>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1 2019-09-12 17:51:57 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1 2019-09-12 17:51:58 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: mismatched tag: line 1, column 1887 2019-09-12 17:51:58 DEBUG (Thread-8) [pyhik.hikvision] <EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:51:57+01:00</dateTime><activePostCount>47</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>3</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>739</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>997</positionY></RegionCoordinates><RegionCoordinates><positionX>739</positionX><positionY>997</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX></Extensions>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 1976<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:51:58+01:00</dateTime><activePostCount>48</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX><positionY>994</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry></DetectionRegionList><channelName></channelName><Extensions version="1.0" xmlns="urn:psialliance-org"><serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143</serialNumber><eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143,2019-09-12T17:51:58+01:00,0,1.0</eventPush></Extensions></EventNotificationAlert> 2019-09-12 17:52:14 WARNING (Thread-8) [pyhik.hikvision] XML parse error in stream: mismatched tag: line 1, column 1887 2019-09-12 17:52:14 DEBUG (Thread-8) [pyhik.hikvision] <EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:51:59+01:00</dateTime><activePostCount>49</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>3</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>739</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>997</positionY></RegionCoordinates><RegionCoordinates><positionX>739</positionX><positionY>997</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX></Extensions>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 2048<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:52:00+01:00</dateTime><activePostCount>50</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>3</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>739</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>997</positionY></RegionCoordinates><RegionCoordinates><positionX>739</positionX><positionY>997</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX></Extensions>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 2048<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:52:01+01:00</dateTime><activePostCount>51</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>3</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>739</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>997</positionY></RegionCoordinates><RegionCoordinates><positionX>739</positionX><positionY>997</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX></Extensions>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 2048<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:52:02+01:00</dateTime><activePostCount>52</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>3</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>739</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>997</positionY></RegionCoordinates><RegionCoordinates><positionX>739</positionX><positionY>997</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX></Extensions>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 2048<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:52:03+01:00</dateTime><activePostCount>53</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>3</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>739</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>997</positionY></RegionCoordinates><RegionCoordinates><positionX>739</positionX><positionY>997</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX></Extensions>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 2048<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:52:04+01:00</dateTime><activePostCount>54</activePostCount><eventType>VMD</eventType><eventState>active</eventState><eventDescription>Motion alarm</eventDescription><DetectionRegionList><DetectionRegionEntry><regionID>2</regionID><sensitivityLevel>50</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>0</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>0</positionY></RegionCoordinates><RegionCoordinates><positionX>240</positionX><positionY>990</positionY></RegionCoordinates><RegionCoordinates><positionX>0</positionX><positionY>990</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>3</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>739</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>2</positionY></RegionCoordinates><RegionCoordinates><positionX>997</positionX><positionY>997</positionY></RegionCoordinates><RegionCoordinates><positionX>739</positionX><positionY>997</positionY></RegionCoordinates></RegionCoordinatesList></DetectionRegionEntry><DetectionRegionEntry><regionID>5</regionID><sensitivityLevel>20</sensitivityLevel><RegionCoordinatesList><RegionCoordinates><positionX>4</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>211</positionY></RegionCoordinates><RegionCoordinates><positionX>236</positionX><positionY>994</positionY></RegionCoordinates><RegionCoordinates><positionX>4</positionX></Extensions>--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 821<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress><portNo>80</portNo><protocol>HTTP</protocol><macAddress>68:6d:bc:63:f0:a1</macAddress><channelID>1</channelID><dateTime>2019-09-12T17:52:04+01:00</dateTime><activePostCount>55</activePostCount><eventType>VMD</eventType><eventState>inactive</eventState><eventDescription>Motion alarm</eventDescription><channelName></channelName><Extensions version="1.0" xmlns="urn:psialliance-org"><serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143</serialNumber><eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143,2019-09-12T17:52:04+01:00,0,1.0</eventPush></Extensions></EventNotificationAlert> 2019-09-12 17:52:24 DEBUG (Thread-8) [pyhik.hikvision] Updating stale event Motion on CH(1) 2019-09-12 17:52:24 DEBUG (Thread-8) [pyhik.hikvision] HikVision Update: Motion, [False, 1, 46, datetime.datetime(2019, 9, 12, 17, 52, 24, 229161)] 2019-09-12 17:52:24 DEBUG (Thread-8) [pyhik.hikvision] Update callback <bound method HikvisionBinarySensor._update_callback of <Entity Hikvision_Cam Motion: off>> for sensor cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1 2019-09-12 17:52:24 DEBUG (Thread-8) [homeassistant.components.hikvision.binary_sensor] Callback signal from: cea94000-fb96-11b3-8260-686dbc63f0a1.Motion.1
Ok, I see the issue, the question is why is it happening and is it something we can fix. For whatever reason messages are getting jumbled together and closing tags aren't being inserted properly.
If you look at the snippet below from you log you can see a rogue --boundaryContent
message inserted into the XML before the proper closing tag is transmitted.
Best way to troubleshoot further is to run a curl on your event stream and see if the XML is actually being transmitted through that way or if pyhik is processing it incorrectly.
curl -u USER:PASS http://YOURCAMIP/ISAPI/Event/notification/alertStream
Log snippet:
<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>68:6d:bc:63:f0:a1</macAddress>
<channelID>1</channelID>
<dateTime>2019-09-12T17:50:37+01:00</dateTime>
<activePostCount>36</activePostCount>
<eventType>VMD</eventType>
<eventState>active</eventState>
<eventDescription>Motion alarm</eventDescription>
<DetectionRegionList><DetectionRegionEntry>
<regionID>1</regionID>
<sensitivityLevel>75</sensitivityLevel>
<RegionCoordinatesList>
<RegionCoordinates>
<positionX>241</positionX>
<positionY>133</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>730</positionX>
<positionY>133</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>730</positionX>
<positionY>988</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>241</positionX>
<positionY>988</positionY>
</RegionCoordinates>
</RegionCoordinatesList>
</DetectionRegionEntry>
<DetectionRegionEntry>
<regionID>2</regionID>
<sensitivityLevel>50</sensitivityLevel>
<RegionCoordinatesList>
<RegionCoordinates>
<positionX>0</positionX>
<positionY>0</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>240</positionX>
<positionY>0</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>240</positionX>
<positionY>990</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>0</positionX>
<positionY>990</positionY>
</RegionCoordinates>
</RegionCoordinatesList>
</DetectionRegionEntry>
<DetectionRegionEntry>
<regionID>3</regionID>
<sensitivityLevel>20</sensitivityLevel>
<RegionCoordinatesList><RegionCoordinates>
<positionX>739</positionX>
<positionY>2</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>997</positionX>
<positionY>2</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>997</positionX>
<positionY>997</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>739</positionX>
--boundaryContent-Type: application/xml; charset="UTF-8"Content-Length: 1257
<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><ipAddress>192.168.1.201</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>68:6d:bc:63:f0:a1</macAddress>
<channelID>1</channelID>
<dateTime>2019-09-12T17:50:37+01:00</dateTime>
<activePostCount>37</activePostCount>
<eventType>linedetection</eventType>
<eventState>active</eventState>
<eventDescription>linedetection alarm</eventDescription>
<DetectionRegionList>
<DetectionRegionEntry>
<regionID>1</regionID>
<sensitivityLevel>100</sensitivityLevel>
<RegionCoordinatesList>
<RegionCoordinates>
<positionX>327</positionX>
<positionY>991</positionY>
</RegionCoordinates>
<RegionCoordinates>
<positionX>217</positionX>
<positionY>376</positionY>
</RegionCoordinates>
</RegionCoordinatesList>
</DetectionRegionEntry>
</DetectionRegionList>
<channelName></channelName>
<Extensions version="1.0" xmlns="urn:psialliance-org">
<serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2045FWD-I20190608AAWRD27854143</serialNumber>
<eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">IO&&DS-2CD2045FWD-I20190608AAWRD27854143,2019-09-12T17:50:37+01:00,1.0</eventPush>
</Extensions>
</EventNotificationAlert>
Can it be that one alarm message is interrupted by another? I have different motion alarms configured and it can happen that multiple of those are triggered almost simultanously.
Executing the curl command returns this:
<!DOCTYPE html>
Authentication Error
I'm sure though that USER:PASS is correct.
I'm guessing you have digest rather than basic authentication enabled in the camera. Give this syntax a try:
curl --anyauth --user USER:PASS http://YOURCAMIP/ISAPI/Event/notification/alertStream
That works. Content-Type: application/xml; charset="UTF-8" Content-Length: 839
--boundary Content-Type: application/xml; charset="UTF-8" Content-Length: 839
--boundary Content-Type: application/xml; charset="UTF-8" Content-Length: 839
--boundary Content-Type: application/xml; charset="UTF-8" Content-Length: 839
That didn't properly work. Using file. pyhik.log
Let that run for a little while, 5-10minutes, then post the log again. In that snippet everything looks OK.
Ok, that log shows the same jumbling of messages so the feed is coming that way from the camera. That being said there isn't much the library can do beyond what it's already doing, discard the bad data and keep on processing.
It seems like most of the overlap cases are a linedetection event interrupting a motion event. Maybe try playing with your camera settings to mitigate that happening?
How does pyHik handle this case currently? Are both events discarded? An alternative could be that pyHik restarts event processing when the interrupting event arrives and discards the interrupted event; Does that make sense?
At the moment both events are discarded since the event string is only cleared after an ending event is found. A simple fix would be to clear the event string when a start event is found.
You can test this by adding the below after line 485: https://github.com/mezz64/pyHik/blob/dfc0cee72ec1eb2c73a6dd2598e8727ed137179a/pyhik/hikvision.py#L485
parse_string = ""
If it works for you i'll implement the edit and increase the version.
In the meantime I observed the following: I had expert mode turned on for motion detection and defined multiple (4) areas with different sensitivity. That leads to a pretty long data stream when it triggers which is sometimes interrupted by another event as we know. When turning expert mode off, the data stream for that event is much shorter. I've tested with expert mode off for a while and did not see any jumbled messages any more and therefore no XML parse errors either. So that could be the solution for those who do not need expert mode. For those who need expert mode your proposed code change above might be a workaround. I'll have a look at it later today or tomorrow and let you know if it works. Thanks, Robert
Clarifying question: you mean changing the 2 lines starting at #485:
start_event = True
parse_string += str_line
to the following 3 lines?
start_event = True
parse_string = ""
parse_string += str_line
I don't think this has to do with events interrupting each other, you will notice it only occurs on the really long event messages, looks like there is a cutoff where any lines which don't fit within the message limit (probably 2048 characters) just get dropped.
It looks like enough data is there you could attempt to parse the unfinished event data but it's far from ideal, the best way would be figuring how to reduce the RegionCoordinates tags from the camera, if that is even possible?
I added a change to the recently release 0.2.4 version that will at least catch the last event when they get jumbled together. I'll leave this issue open for now since that's only a partial fix.
I have a Hikvision DS-2CD2045FWD-I cam with firmware V5.6.0 build 190507. I'm getting XML parse errors. The cam is hardwired using a powerline connection. The connection is pretty stable providing ~ 75Mbit/s. I'm also using Hikvision's iVMS-4500 app on my Android smartphone. That way I can compare results. During testing I'm receiving all motion triggers on the phone and also pyHik receives them but generates lots of XML parse errors.