Hi,
I just wanted to share that i found out that my Aliexpress bought camera provides a pretty powerfull API: Keno IPC. I forgot how i came about to trying out the API requests. The API is documented here: https://keno-cctv.ru/upload/iblock/eb8/KENO_IPC_API_2018_NEW.pdf
The API is a rest-api and easily be tried using curl. I can trigger a reboot of my Camera with: curl -X POST -H 'Content-Type: application/json' -H 'cache-control: no-cache' -d '{"type": 0, "Ch": 1, "Data": { } }' --digest -u admin:SecretPassword http://192.168.178.175/digest/frmDeviceReboot
I can use the following Home Assistant configuration to retrieve an api version without authentication:
rest:
- resource: "http://192.168.178.175/digest/frmWebApiVersion"
sensor:
- name: "WebApi Version"
value_template: "{{ value_json.Data.Standard }}"
- name: "WebApi Build"
value_template: "{{ value_json.Data.Build }}"
I can also request info using authentication:
rest:
- resource: "http://192.168.178.175/digest/frmUserLogin"
method: POST
verify_ssl: False
authentication: digest
username: admin
password: SecretPassword
headers:
Content-Type: application/json
User-Agent: "libcurl/4.7.1"
payload: '{ "Ch" : 0, "Type": 0, "Data: {} }'
sensor:
- name: "Camera Channel Number"
value_template: "{{ value_json.Data.ChanNum }}"
- name: "Camera Alarm Output Port Number"
value_template: "{{ value_json.Data.AlarmOutPortNum }}"
- name: "Camera Alarm Input Port Number"
value_template: "{{ value_json.Data.AlarmInPortNum }}"
- name: "Camera RTSP Port"
value_template: "{{ value_json.Data.RTSPPort }}"
- name: "Camera RTMP Port"
value_template: "{{ value_json.Data.RTMPPort }}"
- name: "Camera Device Type"
value_template: "{{ value_json.Data.DVRType }}"
- name: "Camera Http Port"
value_template: "{{ value_json.Data.HttpPort }}"
- name: "Camera Device Port"
value_template: "{{ value_json.Data.DVRPort }}"
- name: "Camera Serial Number"
value_template: "{{ value_json.Data.SerialNumber }}"
- name: "Camera Default Password"
value_template: "{{ value_json.Data.DefaultPwd }}"
I bought the 5mp T31X + GC4653 POE version for 32euro at: https://nl.aliexpress.com/item/1005002751982357.html
Unfortunatly i don´t see an reliable way to detect this api without customizing the builtin-home-assistant-integrations.
The WebUI looks like this: