judge / homebridge-hikconnect

A Homebridge plugin to communicate with Hikvision smart doorbells via Hik-Connect cloud and allows lock to be unlocked. It exposes doorbell locks as a lock accessories to Homekit.
MIT License
18 stars 2 forks source link

different cloud address #5

Closed msher1956 closed 2 years ago

msher1956 commented 2 years ago

I’m able to connect to https://www.hik-connect.com with my login/pwd but there is no any device connected there in the cloud. We have in Russia different cloud address. It is https://www.hik-connectru.com and when I’m entering there I can see my device (KH-6320WTE) with it serial no. and IP. I suppose on this reason I don’t have any accessory in homebridge and in Homekit.

[1/18/2022, 5:52:49 PM] [HikConnect] Initializing HikConnect platform... [1/18/2022, 5:52:49 PM] [HikConnect] Initializing child bridge 0E:F8:4B:9E:2C:3C [1/18/2022, 5:52:50 PM] [homebridge-hikconnect] Launched child bridge with PID 25151 [1/18/2022, 5:52:50 PM] Registering platform 'homebridge-hikconnect.HikConnect' [1/18/2022, 5:52:50 PM] [homebridge-hikconnect] Loaded homebridge-hikconnect v1.1.1 child bridge successfully [1/18/2022, 5:52:50 PM] Loaded 0 cached accessories from cachedAccessories.0EF84B9E2C3C. [1/18/2022, 5:52:51 PM] Homebridge v1.3.9 (HAP v0.9.8) (homebridge-hikconnect) is running on port 45908.

I tried to register another account on EU address but there is no possibility to share device from one cloud to another. Is it possible to modify your plugin with ability of the cloud address changing? Thank you.

judge commented 2 years ago

Hello! I think it's possible to define this in the config but I'm not sure if the API is the same. Could you help me figure this out? If you log in with the 'ru' address, please open this url in a new tab: https://api.hik-connect.com/v3/userdevices/v1/devices/pagelist?groupId=-1&limit=100&offset=0&filter=TIME_PLAN,CONNECTION,SWITCH,STATUS,STATUS_EXT,WIFI,NODISTURB,P2P,KMS,HIDDN Or if this does not work, maybe the same domain change needs to be applied, so something like this: https://api.hik-connectru.com/v3/userdevices/v1/devices/pagelist?groupId=-1&limit=100&offset=0&filter=TIME_PLAN,CONNECTION,SWITCH,STATUS,STATUS_EXT,WIFI,NODISTURB,P2P,KMS,HIDDN

msher1956 commented 2 years ago

Hello, First address doesn't work, the second one gave a pretty big log with a lot of information about my devices e.g. ip address, model name etc. It looks as follows: {"connectionInfos":{"Q01915644":{"localIp":"192.168.1.43","netIp":"109.167.152.162","localRtspPort":0,"netRtspPort":0,"localCmdPort":9010,"netCmdPort":0,"localStreamPort":9020,"netHttpPort":0,"localHttpPort":0,"netStreamPort":0,"netType":3,"wanIp":null,"upnp":false}},"cameraInfos":[],"p2pInfos":{"Q01915644":[{"ip":"162.62.18.208","port":6000}]},"alarmNodisturbInfos":{"Q01915644":{"alarmEnable":0,"callingEnable":0}},"kmsInfos":{"Q01915644":{"secretKey":"c90a05f1a70d930c3e9209e00f0e146a27bfbcad060eb4d4f20fefca74bb5371","version":"101"}},"timePlanInfos":{"Q01915644":[{"deviceSerial":"Q01915644","channelNo":0,"type":2,"enable":0,"weekPlans":[{"weekDay":"0","timePlan":[]},{"weekDay":"1","timePlan":[]},{"weekDay":"2","timePlan":[]},{"weekDay":"3","timePlan":[]},{"weekDay":"4","timePlan":[]},{"weekDay":"5","timePlan":[]},{"weekDay":"6","timePlan":[]}]},{"deviceSerial":"Q01915644","channelNo":0,"type":4,"enable":-1,"weekPlans":[{"weekDay":"0","timePlan":[{"startTime":"-1:65","endTime":"-1:65"}]},{"weekDay":"1","timePlan":[]},{"weekDay":"2","timePlan":[]},{"weekDay":"3","timePlan":[]},{"weekDay":"4","timePlan":[]},{"weekDay":"5","timePlan":[]},{"weekDay":"6","timePlan":[]}]},{"deviceSerial":"Q01915644","channelNo":0,"type":5,"enable":-1,"weekPlans":[{"weekDay":"0","timePlan":[]},{"weekDay":"1","timePlan":[]},{"weekDay":"2","timePlan":[]},{"weekDay":"3","timePlan":[]},{"weekDay":"4","timePlan":[]},{"weekDay":"5","timePlan":[]},{"weekDay":"6","timePlan":[]}]},{"deviceSerial":"Q01915644","channelNo":0,"type":7,"enable":-1,"weekPlans":[{"weekDay":"0","timePlan":[]},{"weekDay":"1","timePlan":[]},{"weekDay":"2","timePlan":[]},{"weekDay":"3","timePlan":[]},{"weekDay":"4","timePlan":[]},{"weekDay":"5","timePlan":[]},{"weekDay":"6","timePlan":[]}]}]},"statusExtInfos":{"Q01915644":{"upgradeAvailable":0}},"meta":{"code":200,"message":"操作成功","moreInfo":{}},"page":{"offset":0,"limit":100,"totalResults":0,"hasNext":false},"statusInfos":{"Q01915644":{"diskNum":1,"diskState":"0---------------","globalStatus":1,"pirStatus":0,"isEncrypt":0,"upgradeAvailable":0,"upgradeProcess":0,"upgradeStatus":-1,"alarmSoundMode":0,"optionals":{"latestUnbandTime":"1590581330419","BodyDetectTimeInterval":"-1","AlgorithmInfo":"[{\"SubType\":\"0\",\"channel\":0,\"Value\":\"0\"},{\"channel\":1}]","wanIp":"109.167.152.162","CustomVoice":"[]","Route_LinkageStatus":"0","hfullViewURL":"","Battery_WorkStatus":"{\"KeepAlive\":0,\"WorkTime\":0}","daylightSavingTime":"0","Alarm_DetectHumanCar":"{ \"type\": 0 }","tzCode":"0","CustomVoice_Volume":"{ \"volume\": -1 }","diskHealth":"-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1","httpPort":"0","OnlineStatus":"1","timeZone":"UTC+08:00","cmdPort":"0","ROI":"{ \"xCoord\": \"0.00\", \"yCoord\": \"0.00\", \"width\": \"0.00\", \"height\": \"0.00\" }","upnpMappingMode":"0","diskCapacity":"32,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1","lockNum":"{\"1\":2}","domain":"Q01915644","talkMode":"{ \"mode\": 0 }","NightVision_Model":"{ \"graphicType\": 0, \"luminance\": 0 }","timeFormat":"0","ICR":"1","superState":"0","voiceIndex":"0"}}},"wifiInfos":{"Q01915644":{"netName":"wlan0","netType":"wireless","address":"192.168.1.43","mask":"255.255.255.0","gateway":"192.168.1.1","signal":100,"ssid":"wlan0"}},"switchStatusInfos":{"Q01915644":[{"deviceSerial":"Q01915644","channelNo":0,"type":2,"enable":true},{"deviceSerial":"Q01915644","channelNo":0,"type":7,"enable":false},{"deviceSerial":"Q01915644","channelNo":0,"type":10,"enable":false},{"deviceSerial":"Q01915644","channelNo":0,"type":15,"enable":true},{"deviceSerial":"Q01915644","channelNo":0,"type":22,"enable":true},{"deviceSerial":"Q01915644","channelNo":0,"type":200,"enable":false},{"deviceSerial":"Q01915644","channelNo":0,"type":202,"enable":false},{"deviceSerial":"Q01915644","channelNo":0,"type":300,"enable":false},{"deviceSerial":"Q01915644","channelNo":0,"type":301,"enable":false},{"deviceSerial":"Q01915644","channelNo":0,"type":302,"enable":false},{"deviceSerial":"Q01915644","channelNo":0,"type":303,"enable":false},{"deviceSerial":"Q01915644","channelNo":0,"type":304,"enable":false},{"deviceSerial":"Q01915644","channelNo":0,"type":305,"enable":false},{"deviceSerial":"Q01915644","channelNo":0,"type":700,"enable":false}]},"deviceInfos":[{"name":"Indoor station","deviceSerial":"Q01915644","fullSerial":"DS-KH6320-WTE10120200320WRQ01915644CLU","deviceType":"DS-KH6320-WTE1","devicePicPrefix":"https://devpic.ezvizlife.com/device/image/DVR/","version":"V2.1.2 build 191014","supportExt":"{\"69\":\"1\",\"26\":\"4\",\"191\":\"1\",\"154\":\"0\",\"232\":\"0\",\"233\":\"0\",\"234\":34,\"30\":\"0\",\"52\":\"2\",\"31\":\"0\",\"10\":\"1\",\"11\":\"0\",\"78\":\"1\",\"13\":\"0\",\"59\":\"1\",\"1\":\"0\",\"2\":\"1\",\"145\":\"1\",\"3\":\"0\",\"4\":\"0\",\"5\":\"0\",\"6\":\"1\",\"7\":\"0\",\"8\":\"0\",\"9\":\"0\",\"84\":\"1\",\"87\":\"0\"}","status":1,"userDeviceCreateTime":"2020-05-27 12:15:58","casIp":"cas.ezvizru.com","casPort":6500,"channelNumber":34,"hik":true,"deviceCategory":"COMMON","deviceSubCategory":"VIS","ezDeviceCapability":"{\"262\":\"1\",\"175\":\"1\",\"263\":\"0\",\"264\":\"1\",\"232\":\"0\",\"265\":\"1\",\"233\":\"0\",\"266\":\"0\",\"234\":1,\"267\":\"1\",\"289\":\"1\",\"30\":\"0\",\"31\":\"0\"}","customType":"DS-KH6320-WTE1","offlineTime":"2022-01-20 04:01:25","offlineNotify":0,"accessPlatform":true,"deviceDomain":"Q01915644","instructionBook":"http://devpic.ezvizlife.com/device/image/DS-KH6320-WTE1/instruction.jpeg","deviceShareInfo":{"isShared":1,"permission":1,"inviterName":"eknvlk"},"feature":null,"riskLevel":0,"offlineTimestamp":1642651285000}]}

judge commented 2 years ago

I just pushed v1.2 which supports custom API url. If you click the SETTINGS button you can define the url like this: https://www.hik-connectru.com It's pretty hard for me to test this as I don't have any devices on the ru domain so could you give it a try?

msher1956 commented 2 years ago

Hey dude! you are really great guy!

Best regards, Michael Sher

On 24 Jan 2022, at 12:39, Tamás Bíró @.***> wrote:

I just pushed v1.2 which supports custom API url. If you click the SETTINGS button you can define the url like this: https://www.hik-connectru.com It's pretty hard for me to test this as I don't have any devices on the ru domain so could you give it a try?

— Reply to this email directly, view it on GitHub https://github.com/judge/homebridge-hikconnect/issues/5#issuecomment-1019901663, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPPYRYQELBT54XU6QSVAO3UXUM6NANCNFSM5MHO3Z3A. You are receiving this because you authored the thread.

msher1956 commented 2 years ago

It works like a charm

judge commented 2 years ago

Great! :) I'll close the issue.