For the guys interested in the SDK, i created an addon based on @laszlojakab python script… i’m not a developer, so its some hardcoded stuff… this will work for DS-KD8003 owners, wo already updated to the last official firmware with no custom isapi support… offcourse other hikvision models are supported too…
Ok, first of all, create a template sensor in your yaml
- platform: template
sensors:
hikvision_test:
value_template: "Hikvision TEST"
Download zip, and place it in your “addon” folder, then you can install the local addon, as a normal addon… the addon is based in debian slim 3.7, since it doesnt run on Alpine (hassos) users
So after copy/paste, change line 73 in hik.py, setup your ip of outdoorstation and password
user_id = HCNetSDK.NET_DVR_Login_V30( "IPOUTDOORSTATION".encode('utf-8'), 8000, "admin".encode('utf-8'), "YOURPASSWORD".encode('utf-8'), device_info)
Change line 100, i’m using REST api commands to update the template sensor, see example screenshot below, the XXX you need to replace by your bearer token offcourse… mine HA runs local on http, so if you are using https locally, change that also offcourse…
'Authorization': 'Bearer XXXXX',
you can see for example, after a doorpress button, i set the callstatus to “on” for 1 second, you can see that at line 26
Its a little bit hard coded, but it works… if there is a python developer here who can improve!.. pls post
This SDK , the “lib” from hikvision doesnt run on ARM / Alpine, so therefore my docker image is based on debian, therefore its also not possible to create a custom component (hassos users)