home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.69k stars 30.44k forks source link

Reolink NVR not triggering AI sensors #89351

Closed SonomaGTS closed 1 year ago

SonomaGTS commented 1 year ago

The problem

AI binary sensors not updated by push and sporadically working on poll. Getting same behavior on two seperate NVR's with various cameras attached.

N3MB01 (v3.2.0.218) RLC-510A RLC-510Av2 RLC-520Av2

N2MB02(v3.2.0.218) RLC-810A RLC-842A RLC-510WA

These are both on seperate HA OS setups at different locations.

What version of Home Assistant Core has the issue?

2023.3.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Reolink IP NVR/camera

Link to integration documentation on our website

https://www.home-assistant.io/integrations/reolink/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-03-07 16:30:10.767 WARNING (MainThread) [reolink_aio.api] Reolink ONVIF event 'Motion' data contained invalid channel 'VideoSourceToken', issuing poll instead
2023-03-07 16:30:10.841 WARNING (MainThread) [reolink_aio.api] Reolink ONVIF event 'Motion' does not contain channel

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @starkillerog, mind taking a look at this issue as it has been labeled with an integration (reolink) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `reolink` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign reolink` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


reolink documentation reolink source (message by IssueLinks)

starkillerOG commented 1 year ago

@SonomaGTS this is caused by a firmware bug in the NVR, see https://www.home-assistant.io/integrations/reolink/#reolink-firmware-limitations

Please wait patiently for a new NVR firmware release, ask Reolink support for beta NVR firmware v3.0.0.211_23011204 (that has some other bugs), or ask Reolink support when the new NVR firmware will be released.

If you appreciate the reolink integration and want to support its development, please consider sponsering the upstream library.

SonomaGTS commented 1 year ago

Please wait patiently for a new NVR firmware release, ask Reolink support for beta NVR firmware v3.0.0.211_23011204 (that has some other bugs), or ask Reolink support when the new NVR firmware will be released.

I don't understand. As stated i'm on v3.2.0.218. I had just gone through a few weeks ago updating both NVR's and cameras with the most recent firmware that wasn't even available on the reolink firmware page because one of my cameras was a v2 version that wasn't listed.

starkillerOG commented 1 year ago

@SonomaGTS firmware v3.2.0.218 does not include the fix, v3.0.0.211_23011204 is a beta firmware version, Beta firmware always has 3.0.0, you need to look at the date 23011204, meaning it was build on January 12th 2023 and is a recent beta firmware.

SonomaGTS commented 1 year ago

firmware v3.2.0.218 does not include the fix, v3.0.0.211_23011204 is a beta firmware version, Beta firmware always has 3.0.0, you need to look at the date 23011204, meaning it was build on January 12th 2023 and is a recent beta firmware.

Thank you for clearing that up. While trying research a solution on my own I was under the assumption that reference was referring to just an older firmware that comes preinstalled on the NVR and what was beta then is just "updated" firmware now.

robertc65 commented 1 year ago

I just got a Reolink RLC-510A a few days ago. I don't have an NVR, it's plugged into my switch. When I 1st installed the home assistant integration It received a motion and person alert. I never worked again after that until I uninstalled and reinstalled the integration. It then worked once again and then it didn't. The camera has firmware v3.1.0.801_22010700 installed. There is newer version listed on the reolink site (v3.1.0.951_22041567) but when I try to install it it tells me the file format in incorrect. Does this issue apply to cameras as well or just the NVR. Thank in you in advance.

SonomaGTS commented 1 year ago

The camera has firmware v3.1.0.801_22010700 installed. There is newer version listed on the reolink site (v3.1.0.951_22041567) but when I try to install it it tells me the file format in incorrect.

Check and see if it is in fact an RLC-510Av2 and not a RLC-510A. I ran into that issue as I got a v2 variant as a replacement to a camera that died on me. The website does not currently offer the v2 variant firmware and it does require a seperate firmware than the non-v2 variant. I had to contact Reolink for them to send me the firmware for the camera.

robertc65 commented 1 year ago

The camera has firmware v3.1.0.801_22010700 installed. There is newer version listed on the reolink site (v3.1.0.951_22041567) but when I try to install it it tells me the file format in incorrect.

Check and see if it is in fact an RLC-510Av2 and not a RLC-510A. I ran into that issue as I got a v2 variant as a replacement to a camera that died on me. The website does not currently offer the v2 variant firmware and it does require a seperate firmware than the non-v2 variant. I had to contact Reolink for them to send me the firmware for the camera.

@SonomaGTS thanks for the quick response. I looks to be a 510A. Does this mean I should request the beta firmware from Reolink?

SonomaGTS commented 1 year ago

thanks for the quick response. I looks to be a 510A. Does this mean I should request the beta firmware from Reolink?

That I don't know. I was just trying to help with the file format error you posted about.

starkillerOG commented 1 year ago

@robertc65 did you unpack the .zip file that you download form the reolink dowload center? You fist have to unzip the file and then upload the .pak file inside the zip.

SonomaGTS commented 1 year ago

@starkillerOG So for the last couple of days I been testing the behavior of the v3.2.0 firmware and I have noticed that when an object size is set for a camera there is no push for the event. However when an object size is not set for the ai it seems events are pushed but not consistently. These are events on non index "0" cameras when the index "0" camera has no motion, they happen too frequently to be polled events as well. So I am curious if maybe the newer firmware might have the Beta fixes but since I don't run the Beta firmware i am unsure of what the actual behavior is like and what is actually expected.

starkillerOG commented 1 year ago

@SonomaGTS I have debuged firmware v3.2.0.218 and Reolink firmware engineers also confirmed to me that the ONVIF fixes are not present in that firmware. You will have to wait or use beta firmware.

robertc65 commented 1 year ago

Thank you @SonomaGTS for spending so much of your time following up with Reolink in trying to get this working. I did unzip the firmware package before trying to apply it. After extracting I was left a .pak file. It sounds like however, this version does not include the fix.

robertc65 commented 1 year ago

One thing I thought of. My setup consists of a single camera connected to my switch. In the Reolink App it shows index 1. since this is the only camera, is there a way to force it to index zero?.

starkillerOG commented 1 year ago

Reolink released NVR firmware V3.3.0 which includes the ONVIF fixes. HomeAssistant 2023.4 will prompt users to update to that firmware and has additional fixes regarding ONVIF pushes. It schould work a lot better. The beta is already out and you can try that. Release will be coming wednesday April 5th.

closing this now. If you still experiance any problems when on HA 2023.4 (beta), please open a new issue.

starkillerOG commented 1 year ago

If you appreciate the reolink integration and want to support its development, please consider sponsering the upstream library.

starkillerOG commented 1 year ago

@home-assistant close

DIYtechie commented 1 year ago

The AI sensors also do not work on my RLN8-410 (N2MB02), Config Version v3.0.0.0, Firmware Version v3.3.0.226_23031644. My cameras RLC 520A are all updated to the latest firmware.

My Home Assistant server is running 2023.4.2 Supervisor 2023.04.0 Operating System 9.5

The streams work via the integration and the AI sensors can be polled via the api manually, but has never worked using this integration.

starkillerOG commented 1 year ago

@DIYtechie Could you enable debug logging under Settings->Devices & Services->Reolink integration overflow menu (three vertical dots)->Enable debug logging, Then restart Home Assitant, wait for 5 minutes, disable debug logging and post the log here.

DIYtechie commented 1 year ago

@DIYtechie Could you enable debug logging under Settings->Devices & Services->Reolink integration overflow menu (three vertical dots)->Enable debug logging, Then restart Home Assitant, wait for 5 minutes, disable debug logging and post the log here.

Just enabled debugging and restarted 5 minutes ago. I would like to share all relevants parts of the log, but it seems to contain token information. Is the below enough / usefull?

2023-04-10 21:10:30.891 DEBUG (MainThread) [reolink_aio.api] sending chunks 41:65 of total 65 requests
2023-04-10 21:10:30.891 DEBUG (MainThread) [reolink_aio.api] Reolink NVR RLN8-410/192.168.1.140:443::send() HTTP Request params =
{'token': 'blablablablabla'}
2023-04-10 21:10:30.891 DEBUG (MainThread) [reolink_aio.api] Reolink NVR RLN8-410/192.168.1.140:443::send() HTTP Request body =
[{'cmd': 'GetMdAlarm', 'action': 0, 'param': {'channel': 2}}, {'cmd': 'GetIsp', 'action': 0, 'param': {'channel': 3}}, {'cmd': 'GetEvents', 'action': 0, 'param': {'channel': 3}}, {'cmd': 'GetIrLights', 'action': 0, 'param': {'channel': 3}}, {'cmd': 'GetAudioCfg', 'action': 0, 'param': {'channel': 3}}, {'cmd': 'GetBuzzerAlarmV20', 'action': 0, 'param': {'channel': 3}}, {'cmd': 'GetEmailV20', 'action': 0, 'param': {'channel': 3}}, {'cmd': 'GetPushV20', 'action': 0, 'param': {'channel': 3}}, {'cmd': 'GetFtpV20', 'action': 0, 'param': {'channel': 3}}, {'cmd': 'GetRecV20', 'action': 0, 'param': {'channel': 3}}, {'cmd': 'GetAudioAlarmV20', 'action': 0, 'param': {'channel': 3}}, {'cmd': 'GetMdAlarm', 'action': 0, 'param': {'channel': 3}}, {'cmd': 'GetAiAlarm', 'action': 0, 'param': {'channel': 3, 'ai_type': 'people'}}, {'cmd': 'GetAiAlarm', 'action': 0, 'param': {'channel': 3, 'ai_type': 'vehicle'}}, {'cmd': 'GetIsp', 'action': 0, 'param': {'channel': 4}}, {'cmd': 'GetEvents', 'action': 0, 'param': {'channel': 4}}, {'cmd': 'GetIrLights', 'action': 0, 'param': {'channel': 4}}, {'cmd': 'GetAudioCfg', 'action': 0, 'param': {'channel': 4}}, {'cmd': 'GetBuzzerAlarmV20', 'action': 0, 'param': {'channel': 4}}, {'cmd': 'GetEmailV20', 'action': 0, 'param': {'channel': 4}}, {'cmd': 'GetPushV20', 'action': 0, 'param': {'channel': 4}}, {'cmd': 'GetFtpV20', 'action': 0, 'param': {'channel': 4}}, {'cmd': 'GetRecV20', 'action': 0, 'param': {'channel': 4}}, {'cmd': 'GetAudioAlarmV20', 'action': 0, 'param': {'channel': 4}}, {'cmd': 'GetMdAlarm', 'action': 0, 'param': {'channel': 4}}]

2023-04-10 21:10:31.149 DEBUG (MainThread) [reolink_aio.api] Reolink NVR RLN8-410/192.168.1.140:443::send() HTTP Response status = 200, content-type = (text/html).
2023-04-10 21:10:31.149 DEBUG (MainThread) [reolink_aio.api.data] Reolink NVR RLN8-410/192.168.1.140:443::send() HTTP Response data:
[
   {
      "cmd" : "GetMdAlarm",
      "code" : 0,
      "value" : {
         "MdAlarm" : {
            "channel" : 2,
            "newSens" : {
               "sens" : [
                  {
                     "beginHour" : 0,
                     "beginMin" : 0,
                     "enable" : 0,
                     "endHour" : 0,
                     "endMin" : 0,
                     "id" : 0,
                     "priority" : 0,
                     "sensitivity" : 0
                  },
                  {
                     "beginHour" : 0,
                     "beginMin" : 0,
                     "enable" : 0,
                     "endHour" : 0,
                     "endMin" : 0,
                     "id" : 1,
                     "priority" : 0,
                     "sensitivity" : 0
                  },
                  {
                     "beginHour" : 0,
                     "beginMin" : 0,
                     "enable" : 0,
                     "endHour" : 0,
                     "endMin" : 0,
                     "id" : 2,
                     "priority" : 0,
                     "sensitivity" : 0
                  },
                  {
                     "beginHour" : 0,
                     "beginMin" : 0,
                     "enable" : 0,
                     "endHour" : 0,
                     "endMin" : 0,
                     "id" : 3,
                     "priority" : 0,
                     "sensitivity" : 0
                  }
               ],
               "sensDef" : 25
            },
            "scope" : {
               "cols" : 80,
               "rows" : 60,
               "table" : "000000000000000011111111111111111110000000000000000000000000000000000000000000000000000000000000111111111111111111100000000000000000000000000000000000000000000000000000000000111111111111111111111000000000000000000000000000000000000000000000000000000001111111111111111111111110000000000000000000000000000000000000000000000000000001111111111111111111111111110000000000000000000000000000000000000000000000001100011111111111111111111111111100000000000000000000000000000000000000000000000011001100001111111111111111111111000000000000000000000000000000000000000000000011110000000001111111111111111111110000000000000000000000000000000000000000000101111100000000011111111111111111111100000000000000000000000000000000000000000000011111000000000111111111111111111111000000000000000000000000000000000000000000000111110000000001111111111111111111100000000000000000000000000000000000000000000000111000000000011111111111111111100000000000000000000000000000000000000000000000001000000000000111111111111111111000000000000000000000000000001100000000000000000000000000000001111111111111111110000000000000000000000011111111110000000111111100000000000000011111111111111111100000000000000000000000011111111111111111111111000000000000001111111111111111111110000000000000000000000000111111111111111111110000000000000011111111111111111111100000000000000000000000000011111111111111111100000000000000111111111111111111111100000000000000000000000000000111111111111111000000000000011111111111111111111111100000000000000000000000000000111111111111110000000000000111111111111111111111111000000000000000000000000000000111111111111100000000000001111111111111111111111111000000000000000000000000000000111111111111000000000000011111111111111111111111111000000000000000000000000000001111111111110000000000001111111111111111111111111111000000000000000000000000000000111111111100000000000011111111111111111111111111111000000000000000000000000000001111111111000000000000111111111111111111111111111111000000000000000000000000000001111111110000000000011111111111111111111111111111111000000000000000000000000000001111111100000000000111111111111111111111111111111110000000000000000000000000000011111111000000000001111111111111111111111111111111110000000000000000000000000000111111110000000000011111111111111111111111111111111100000000000000000000000000000111111100000000001111111111111111111111111111111111000000000000000000000000000001111111000000000011111111111111111111111111111111110000000000000000000000000000011111110000000000111111111111111111111111111111111111000000000000000000000000000111111100000000011111111111111111111111111111111111111000000000000000000000000001111111000000000111111111111111111111111111111111111111000000000000000000000000011111110000000011111111111111111111111111111111111111111000000000000000000000000111111100000000111111111111111111111111111111111111111110000000000000000000000001111111000000001111111111111111111111111111111111111111110000000000000000000000011111110000000011111111111111111111111111111111111111111100000000000000000000000011111100000001111111111111111111111111111111111111111111100000000000000000000000111111000000011111111111111111111111111111111111111111111111000000000000000000001111110000001111111111111111111111111111111111111111111111111000000000000000000111111100000011111111111111111111111111111111111111111111111111110000000000000111111111000000111111111111111111111111111111111111111111111111111111111111111111111111110000011111111111111111111111111111111111111111111111111111111111111111111111111100000111111111111111111111111111111111111111111111111111111111111111111111111111000011111111111111111111111111111111111111111111111111111111111111111111111111110000111111111111111111111111111111111111111111111111111111111111111111111111111100001111111111111111111111111111111111111111111111111111111111111111111111111111000111111111111111111111111111111111111111111111111111111111111111111111111111110001111111111111111111111111111111111111111111111111111111111111111111111111111100011111111111111111111111111111111111111111111111111111111111111111111111111111001111111111111111111111111111111111111111111111111111111111111111111111111111110011111111111111111111111111111111111111111111111111111111111111111111111111111100111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
            },
            "sens" : [
               {
                  "beginHour" : 0,
                  "beginMin" : 0,
                  "endHour" : 6,
                  "endMin" : 0,
                  "id" : 0,
                  "sensitivity" : 16
               },
               {
                  "beginHour" : 6,
                  "beginMin" : 0,
                  "endHour" : 12,
                  "endMin" : 0,
                  "id" : 1,
                  "sensitivity" : 16
               },
               {
                  "beginHour" : 12,
                  "beginMin" : 0,
                  "endHour" : 18,
                  "endMin" : 0,
                  "id" : 2,
                  "sensitivity" : 16
               },
               {
                  "beginHour" : 18,
                  "beginMin" : 0,
                  "endHour" : 23,
                  "endMin" : 59,
                  "id" : 3,
                  "sensitivity" : 16
               }
            ],
            "useNewSens" : 1
         }
      }
   },
   {
      "cmd" : "GetIsp",
      "code" : 0,
      "value" : {
         "Isp" : {
            "antiFlicker" : "50HZ",
            "backLight" : "Off",
            "bd_day" : {
               "bright" : 128,
               "dark" : 128,
               "mode" : "Auto"
            },
            "bd_led_color" : {
               "bright" : 128,
               "dark" : 128,
               "mode" : "Auto"
            },
            "bd_night" : {
               "bright" : 128,
               "dark" : 128,
               "mode" : "Auto"
            },
            "blc" : 128,
            "blueGain" : 128,
            "channel" : 3,
            "constantFrameRate" : 0,
            "dayNight" : "Auto",
            "dayNightThreshold" : 50,
            "drc" : 128,
            "exposure" : "Auto",
            "gain" : {
               "max" : 62,
               "min" : 1
            },
            "mirroring" : 0,
            "nr3d" : 1,
            "redGain" : 128,
            "rotation" : 0,
            "shutter" : {
               "max" : 125,
               "min" : 0
            },
            "thresholdMode" : "default",
            "whiteBalance" : "Auto"
         }
      }
   },
   {
      "cmd" : "GetEvents",
      "code" : 0,
      "value" : {
         "ai" : {
            "dog_cat" : {
               "alarm_state" : 0,
               "support" : 0
            },
            "face" : {
               "alarm_state" : 0,
               "support" : 0
            },
            "people" : {
               "alarm_state" : 0,
               "support" : 1
            },
            "vehicle" : {
               "alarm_state" : 0,
               "support" : 1
            }
         },
         "channel" : 3,
         "md" : {
            "alarm_state" : 0,
            "support" : 1
         },
         "visitor" : {
            "alarm_state" : 0,
            "support" : 0
         }
      }
   },
   {
      "cmd" : "GetIrLights",
      "code" : 0,
      "initial" : {
         "IrLights" : {
            "state" : "Auto"
         }
      },
      "range" : {
         "IrLights" : {
            "state" : [ "Auto", "Off" ]
         }
      },
      "value" : {
         "IrLights" : {
            "state" : "Auto"
         }
      }
   },
   {
      "cmd" : "GetAudioCfg",
      "code" : 0,
      "value" : {
         "AudioCfg" : {
            "visitorLoudspeaker" : 0,
            "volume" : 90
         }
      }
   },
   {
      "cmd" : "GetBuzzerAlarmV20",
      "code" : 0,
      "value" : {
         "Buzzer" : {
            "diskErrorAlert" : 0,
            "diskFullAlert" : 0,
            "enable" : 0,
            "ipConflictAlert" : 0,
            "nvrDisconnectAlert" : 0,
            "schedule" : {
               "channel" : 3,
               "table" : {
                  "AI_PEOPLE" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "AI_VEHICLE" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "MD" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",
                  "VL" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
               }
            },
            "scheduleEnable" : 0
         }
      }
   },
   {
      "cmd" : "GetEmailV20",
      "code" : 0,
      "value" : {
         "Email" : {
            "addr1" : "",
            "addr2" : "",
            "addr3" : "",
            "attachmentType" : 1,
            "diskErrorAlert" : 0,
            "diskFullAlert" : 0,
            "enable" : 0,
            "interval" : "5 Minutes",
            "nickName" : "NVR",
            "password" : "",
            "schedule" : {
               "channel" : 3,
               "table" : {
                  "AI_PEOPLE" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "AI_VEHICLE" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "MD" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",
                  "VL" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
               }
            },
            "scheduleEnable" : 0,
            "smtpPort" : 465,
            "smtpServer" : "smtp.gmail.com",
            "ssl" : 1,
            "supportTextType" : 1,
            "supportVideo" : 1,
            "textType" : 1,
            "userName" : ""
         }
      }
   },
   {
      "cmd" : "GetPushV20",
      "code" : 0,
      "value" : {
         "Push" : {
            "enable" : 0,
            "schedule" : {
               "channel" : 3,
               "table" : {
                  "AI_PEOPLE" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "AI_VEHICLE" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "MD" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
               }
            },
            "scheduleEnable" : 0
         }
      }
   },
   {
      "cmd" : "GetFtpV20",
      "code" : 0,
      "value" : {
         "Ftp" : {
            "anonymous" : 0,
            "autoDir" : 1,
            "bpicSingle" : 0,
            "bvideoSingle" : 0,
            "enable" : 0,
            "interval" : 15,
            "maxSize" : 100,
            "mode" : 0,
            "onlyFtps" : 0,
            "password" : "",
            "picCaptureMode" : 0,
            "picHeight" : 0,
            "picInterval" : 60,
            "picName" : "",
            "picWidth" : 0,
            "port" : 21,
            "remoteDir" : "",
            "schedule" : {
               "channel" : 3,
               "table" : {
                  "AI_PEOPLE" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "AI_VEHICLE" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "MD" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "TIMING" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
               }
            },
            "scheduleEnable" : 0,
            "server" : "",
            "streamType" : 0,
            "userName" : "",
            "videoName" : ""
         }
      }
   },
   {
      "cmd" : "GetRecV20",
      "code" : 0,
      "value" : {
         "Rec" : {
            "enable" : 1,
            "overwrite" : 1,
            "packTime" : "60 Minutes",
            "postRec" : "2 Minutes",
            "preRec" : 1,
            "saveDay" : 7,
            "schedule" : {
               "channel" : 3,
               "table" : {
                  "AI_PEOPLE" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "AI_VEHICLE" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "MD" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "TIMING" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
               }
            },
            "scheduleEnable" : 1
         }
      }
   },
   {
      "cmd" : "GetAudioAlarmV20",
      "code" : 0,
      "value" : {
         "Audio" : {
            "enable" : 0,
            "schedule" : {
               "channel" : 0,
               "table" : {
                  "AI_PEOPLE" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "AI_VEHICLE" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "MD" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
               }
            }
         }
      }
   },
   {
      "cmd" : "GetMdAlarm",
      "code" : 0,
      "value" : {
         "MdAlarm" : {
            "channel" : 3,
            "newSens" : {
               "sens" : [
                  {
                     "beginHour" : 0,
                     "beginMin" : 0,
                     "enable" : 0,
                     "endHour" : 0,
                     "endMin" : 0,
                     "id" : 0,
                     "priority" : 0,
                     "sensitivity" : 0
                  },
                  {
                     "beginHour" : 0,
                     "beginMin" : 0,
                     "enable" : 0,
                     "endHour" : 0,
                     "endMin" : 0,
                     "id" : 1,
                     "priority" : 0,
                     "sensitivity" : 0
                  },
                  {
                     "beginHour" : 0,
                     "beginMin" : 0,
                     "enable" : 0,
                     "endHour" : 0,
                     "endMin" : 0,
                     "id" : 2,
                     "priority" : 0,
                     "sensitivity" : 0
                  },
                  {
                     "beginHour" : 0,
                     "beginMin" : 0,
                     "enable" : 0,
                     "endHour" : 0,
                     "endMin" : 0,
                     "id" : 3,
                     "priority" : 0,
                     "sensitivity" : 0
                  }
               ],
               "sensDef" : 10
            },
            "scope" : {
               "cols" : 80,
               "rows" : 60,
               "table" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
            },
            "sens" : [
               {
                  "beginHour" : 0,
                  "beginMin" : 0,
                  "endHour" : 6,
                  "endMin" : 0,
                  "id" : 0,
                  "sensitivity" : 10
               },
               {
                  "beginHour" : 6,
                  "beginMin" : 0,
                  "endHour" : 12,
                  "endMin" : 0,
                  "id" : 1,
                  "sensitivity" : 10
               },
               {
                  "beginHour" : 12,
                  "beginMin" : 0,
                  "endHour" : 18,
                  "endMin" : 0,
                  "id" : 2,
                  "sensitivity" : 10
               },
               {
                  "beginHour" : 18,
                  "beginMin" : 0,
                  "endHour" : 23,
                  "endMin" : 59,
                  "id" : 3,
                  "sensitivity" : 10
               }
            ],
            "useNewSens" : 1
         }
      }
   },
   {
      "cmd" : "GetAiAlarm",
      "code" : 0,
      "value" : {
         "AiAlarm" : {
            "ai_type" : "people",
            "channel" : 3,
            "max_target_height" : 0.0,
            "max_target_width" : 0.0,
            "min_target_height" : 0.0,
            "min_target_width" : 0.0,
            "scope" : {
               "area" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",
               "cols" : 80,
               "rows" : 60
            },
            "sensitivity" : 60,
            "stay_time" : 0
         }
      }
   },
   {
      "cmd" : "GetAiAlarm",
      "code" : 0,
      "value" : {
         "AiAlarm" : {
            "ai_type" : "vehicle",
            "channel" : 3,
            "max_target_height" : 0.0,
            "max_target_width" : 0.0,
            "min_target_height" : 0.0,
            "min_target_width" : 0.0,
            "scope" : {
               "area" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",
               "cols" : 80,
               "rows" : 60
            },
            "sensitivity" : 60,
            "stay_time" : 0
         }
      }
   },
   {
      "cmd" : "GetIsp",
      "code" : 0,
      "value" : {
         "Isp" : {
            "antiFlicker" : "Off",
            "backLight" : "Off",
            "blc" : 128,
            "blueGain" : 128,
            "channel" : 4,
            "constantFrameRate" : -1,
            "dayNight" : "Auto",
            "drc" : 128,
            "exposure" : "Auto",
            "gain" : {
               "max" : 62,
               "min" : 1
            },
            "mirroring" : 0,
            "nr3d" : 1,
            "redGain" : 128,
            "rotation" : 1,
            "shutter" : {
               "max" : 125,
               "min" : 0
            },
            "whiteBalance" : "Auto"
         }
      }
   },
   {
      "cmd" : "GetEvents",
      "code" : 0,
      "value" : {
         "ai" : {
            "dog_cat" : {
               "alarm_state" : 0,
               "support" : 0
            },
            "face" : {
               "alarm_state" : 0,
               "support" : 0
            },
            "people" : {
               "alarm_state" : 0,
               "support" : 0
            },
            "vehicle" : {
               "alarm_state" : 0,
               "support" : 0
            }
         },
         "channel" : 4,
         "md" : {
            "alarm_state" : 0,
            "support" : 1
         },
         "visitor" : {
            "alarm_state" : 0,
            "support" : 0
         }
      }
   },
   {
      "cmd" : "GetIrLights",
      "code" : 0,
      "initial" : {
         "IrLights" : {
            "state" : "Auto"
         }
      },
      "range" : {
         "IrLights" : {
            "state" : [ "Auto", "Off" ]
         }
      },
      "value" : {
         "IrLights" : {
            "state" : "Auto"
         }
      }
   },
   {
      "cmd" : "GetAudioCfg",
      "code" : 0,
      "value" : {
         "AudioCfg" : {
            "visitorLoudspeaker" : 0,
            "volume" : 0
         }
      }
   },
   {
      "cmd" : "GetBuzzerAlarmV20",
      "code" : 0,
      "value" : {
         "Buzzer" : {
            "diskErrorAlert" : 0,
            "diskFullAlert" : 0,
            "enable" : 0,
            "ipConflictAlert" : 0,
            "nvrDisconnectAlert" : 0,
            "schedule" : {
               "channel" : 4,
               "table" : {
                  "MD" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",
                  "VL" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
               }
            },
            "scheduleEnable" : 0
         }
      }
   },
   {
      "cmd" : "GetEmailV20",
      "code" : 0,
      "value" : {
         "Email" : {
            "addr1" : "",
            "addr2" : "",
            "addr3" : "",
            "attachmentType" : 1,
            "diskErrorAlert" : 0,
            "diskFullAlert" : 0,
            "enable" : 0,
            "interval" : "5 Minutes",
            "nickName" : "NVR",
            "password" : "",
            "schedule" : {
               "channel" : 4,
               "table" : {
                  "MD" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",
                  "VL" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
               }
            },
            "scheduleEnable" : 0,
            "smtpPort" : 465,
            "smtpServer" : "smtp.gmail.com",
            "ssl" : 1,
            "supportTextType" : 1,
            "supportVideo" : 1,
            "textType" : 1,
            "userName" : ""
         }
      }
   },
   {
      "cmd" : "GetPushV20",
      "code" : 0,
      "value" : {
         "Push" : {
            "enable" : 0,
            "schedule" : {
               "channel" : 4,
               "table" : {
                  "MD" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
               }
            },
            "scheduleEnable" : 0
         }
      }
   },
   {
      "cmd" : "GetFtpV20",
      "code" : 0,
      "value" : {
         "Ftp" : {
            "anonymous" : 0,
            "autoDir" : 1,
            "bpicSingle" : 0,
            "bvideoSingle" : 0,
            "enable" : 0,
            "interval" : 15,
            "maxSize" : 100,
            "mode" : 0,
            "onlyFtps" : 0,
            "password" : "",
            "picCaptureMode" : 0,
            "picHeight" : 0,
            "picInterval" : 60,
            "picName" : "",
            "picWidth" : 0,
            "port" : 21,
            "remoteDir" : "",
            "schedule" : {
               "channel" : 4,
               "table" : {
                  "MD" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "TIMING" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
               }
            },
            "scheduleEnable" : 0,
            "server" : "",
            "streamType" : 0,
            "userName" : "",
            "videoName" : ""
         }
      }
   },
   {
      "cmd" : "GetRecV20",
      "code" : 0,
      "value" : {
         "Rec" : {
            "enable" : 1,
            "overwrite" : 1,
            "packTime" : "60 Minutes",
            "postRec" : "2 Minutes",
            "preRec" : 1,
            "saveDay" : 7,
            "schedule" : {
               "channel" : 4,
               "table" : {
                  "MD" : "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                  "TIMING" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
               }
            },
            "scheduleEnable" : 1
         }
      }
   },
   {
      "cmd" : "GetAudioAlarmV20",
      "code" : 0,
      "value" : {
         "Audio" : {
            "enable" : 0,
            "schedule" : {
               "channel" : 0,
               "table" : {
                  "MD" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
               }
            }
         }
      }
   },
   {
      "cmd" : "GetMdAlarm",
      "code" : 0,
      "value" : {
         "MdAlarm" : {
            "channel" : 4,
            "newSens" : {
               "sens" : [
                  {
                     "beginHour" : 0,
                     "beginMin" : 0,
                     "enable" : 0,
                     "endHour" : 0,
                     "endMin" : 0,
                     "id" : 0,
                     "priority" : 0,
                     "sensitivity" : 0
                  },
                  {
                     "beginHour" : 0,
                     "beginMin" : 0,
                     "enable" : 0,
                     "endHour" : 0,
                     "endMin" : 0,
                     "id" : 1,
                     "priority" : 0,
                     "sensitivity" : 0
                  },
                  {
                     "beginHour" : 0,
                     "beginMin" : 0,
                     "enable" : 0,
                     "endHour" : 0,
                     "endMin" : 0,
                     "id" : 2,
                     "priority" : 0,
                     "sensitivity" : 0
                  },
                  {
                     "beginHour" : 0,
                     "beginMin" : 0,
                     "enable" : 0,
                     "endHour" : 0,
                     "endMin" : 0,
                     "id" : 3,
                     "priority" : 0,
                     "sensitivity" : 0
                  }
               ],
               "sensDef" : 10
            },
            "scope" : {
               "cols" : 80,
               "rows" : 60,
               "table" : "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
            },
            "sens" : [
               {
                  "beginHour" : 0,
                  "beginMin" : 0,
                  "endHour" : 6,
                  "endMin" : 0,
                  "id" : 0,
                  "sensitivity" : 10
               },
               {
                  "beginHour" : 6,
                  "beginMin" : 0,
                  "endHour" : 12,
                  "endMin" : 0,
                  "id" : 1,
                  "sensitivity" : 10
               },
               {
                  "beginHour" : 12,
                  "beginMin" : 0,
                  "endHour" : 18,
                  "endMin" : 0,
                  "id" : 2,
                  "sensitivity" : 10
               },
               {
                  "beginHour" : 18,
                  "beginMin" : 0,
                  "endHour" : 23,
                  "endMin" : 59,
                  "id" : 3,
                  "sensitivity" : 10
               }
            ],
            "useNewSens" : 1
         }
      }
   }
]
starkillerOG commented 1 year ago

@DIYtechie no not really, I am looking for specific lines regarding the ONVIF connection, you can send the .log file privately to starkiller.og@gmail.com if you want. Tokens will expire in an hour, so if you wait an hour between debugging and sending the tokens should have already expired anyway.

DIYtechie commented 1 year ago

Just wanted to say that I sent you the log via email as suggested (2 days ago. No rush - just to make sure it did not end up in your spam folder).

starkillerOG commented 1 year ago

@DIYtechie I just looked through your log, the ONVIF events are comming in correctly, so you have everything set up correctly. However they are lost during processing when the camera disconnects causing a ConnectionResetError while attempting to read the ONVIF message data.

This PR https://github.com/home-assistant/core/pull/91070 will fix that issue, it is currently under review and will hopefully be included in HA 2023.4.3, but that depends on the core reviewers.

I will let you know once a HA patch release with a fix is available.

starkillerOG commented 1 year ago

If you appreciate the reolink integration and want to support its development, please consider sponsering the upstream library or purchase Reolink products through this affiliate link.

DIYtechie commented 1 year ago

@starkillerOG Thanks. Fingers crossed :)

starkillerOG commented 1 year ago

HomeAssistant 2023.4.5 is now available and includes the ONVIF push fix. Please let me know if it is now working for you on 2023.4.5.

DIYtechie commented 1 year ago

Just tried it this morning and it seems to be working (for the first time ever with my setup). Thank you very much! 🙏🏻