Keno IPC API for cheap Aliexpress camera's

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:
afbeelding

afbeelding

Why inventing the wheel again and not just use onvif?

Thank’s god (or HA dev team!) support for wipers was recently added to onvif cams :muscle:

image

You are right and wrong at the same time :wink:
I am still using the onvif integration for the camera. But the onvif-controls unfortunately didn’t do anything with my camera. I’ve tried to see if i was able to extend the onvif-integration with other settings/controls, but nothing additional was exposed via onvif.
Via the Keno IPC api i’m able to change all kind of shutter and exposure settings, which are not exposed via onvif. Via this IPC api i now able to switch between day and night mode.

1 Like