DS-KD8003 - DS-KV8113 - DS-KV8213 - DS-KV6113 - DS-KV8413 and .... integration Hikvision HikConnect Video intercom doorbell

I don’t think you can create snapshots if you can’t provide a snapshot url to HA

I use this, it works very well. Besides snapshot, I also save a short video.

How did you add the camera to HA? Can you show config?

Sure, but now i’m away. But it’s nothing complicated, I just used it platform:ffmpeg. And i have an automation that when someone calls uses service: camera.snapshot. That’s all.

Ok, np…

I use the Synology platform for cameras, so just interested how your urls look like… Want to know what you provided for snap and stream url

Ah, maybe like below?

@pepeEL , maybe worth a shot for you?

Am afraid you miss something here.
You can not take a snapshot out of a stream. You need a still_image URL

As this integration is not using still_image URL you can not take a camera.snapshot.
This integration is using RTSP stream and is not possible to take a snapshot.

Atleast with camera.snapshot.

Interested too in this , in case my Synology dies :slight_smile:

What are you talking about?

camera:
   - platform: ffmpeg
     input: "rtsp://admin:[email protected]:554/ch1/main/av_stream"
     name: interfon

And automation:


alias: Interfon - Camera Snapshot
description: ''
trigger:
  - platform: state
    entity_id: sensor.interfon_status
    to: ring
action:
  - service: camera.snapshot
    data:
      filename: /config/www/interfon/interfon_{{ now().strftime("%Y%m%d-%H%M") }}.jpg
    target:
      entity_id: camera.interfon
  - service: notify.mobile_app_mdv
    data:
      title: Interfon
      message: Camera
      data:
        image: >-
          https://ip/local/interfon/interfon_{{
          now().strftime("%Y%m%d-%H%M") }}.jpg
  - service: camera.record
    target:
      entity_id: camera.interfon
    data:
      duration: 30
      filename: /config/www/interfon/interfon_{{ now().strftime("%Y%m%d-%H%M") }}.mp4
  - service: persistent_notification.create
    data:
      title: Interfon {{ now().strftime("%m.%d-%H:%M") }}
      message: >-
        Camera ![image](/local/interfon/interfon_{{      
        now().strftime("%Y%m%d-%H%M") }}.jpg)
mode: single


this is all

1 Like

I only said that you can’t really use the camera.snapshot to take a camera screenshot.

However I found a better way to have picture instead of a continuous stream …

  - platform: ffmpeg
    name: kitchencam
    input: -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/Streaming/channels/101"

The above will show a screenshot every 5 seconds.
No need for anything else … Am really happy with this.

When I get some time, I will share a really nice implementation I have come up with all the above.

I said, I repeat, you do not have to stream continuously for snapshot.

I have a Hikvision DS-KD8003-IME2 with some DS-KH6320-WTE1 indoor stations.
I always wanted to abolish the indoor stations and use wall-mounted tablet running HA dashboard.

So far I managed to have hook up everything at HA after upgraded to the custom firmware.
Right now the following is working for me:

  • Real-time rtp stream
  • Call Status (idle, ring, oncall)
  • Door Open

I was pretty happy with it. For some days … :slight_smile:
After a couple of days, I noticed that the uninterrupted use of the stream caused delays and slow downs to my PI and to the wall-mounted tablet.

I wanted to replace the rtsp stream with something else because it was slowing down my system.

But I was a bit lost because this integration is not supporting the still_image url.

  - platform: generic
    name: Front Door
    username: admin
    password: 12345
    authentication: digest
    still_image_url: http://192.168.70.220/ISAPI/Streaming/channels/101/picture    <<< this doesn't work
    stream_source: rtsp://admin:[email protected]:554/Streaming/channels/101

So I removed the above code for the rtsp stream.
Instead I am using ffmpeg integration.

After a bit of search I found that is possible take a screenshot of a video stream.
Currently I am using the following code for it:

  - platform: ffmpeg
    name: frontdoor
    input: -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/Streaming/channels/101"

The above will take a camera screenshot every 5 seconds.

So all the bits were in place. Camera screenshot, door open and call status!
I had to thing a nice way to popup a view on the wall-mounted tablets.

About a year ago, I made a doorbell with a 3d print an I used browser-mod component to navigate to a different view when a button is pressed.

When you put all the above together, you come up with a perfect (at least for me) solution for the hikvision doorbell.

Automation when the button is pressed:

alias: Hikvision Doorbell notifier (security gate)
description: ''
trigger:
  - entity_id: sensor.hikvision_doorbell_status_main_entrance
    platform: state
    to: ring
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: switch.attictv_tplink
            state: 'on'
        sequence:
          - data:
              message: Someone is at the security gate!
            service: notify.sofita_tv
    default: []
  - data: {}
    service: script.show_doorbell_on_tablets
  - service: script.doorbell_chime
mode: single
max_exceeded: silent

Here is the code of the two scripts:

Show doorbell on tablets.
Notice the use of the browser_mod.navigate which will take you automatically to the doorbell tab.

alias: show_doorbell_on_tablets
sequence:
  - service: browser_mod.navigate
    data:
      navigation_path: /lovelace/security
      deviceID:
        - e573a061-4437bb43
  - delay:
      hours: 0
      minutes: 0
      seconds: 30
      milliseconds: 0
  - service: browser_mod.navigate
    data:
      navigation_path: /lovelace/UI_Attic
      deviceID:
        - e573a061-4437bb43
  - service: input_boolean.turn_off
    target:
      entity_id:
        - input_boolean.security_gate_button_is_pressed        
mode: single

And here is the doorbell chime code

alias: doorbell_chime
sequence:
  - service: media_player.volume_set
    data:
      volume_level: 1
    target:
      entity_id: media_player.living_room
  - repeat:
      count: '4'
      sequence:
        - service: media_player.play_media
          data:
            media_content_id: amzn_sfx_doorbell_chime_02
            media_content_type: sound
          target:
            entity_id: media_player.living_room
mode: single
icon: mdi:doorbell

Finally, here is the lovelace card

and the code for it

cards:
  - aspect_ratio: 90%
    camera_image: camera.frontdoor
    camera_view: auto
    entity: camera.frontdoor
    show_state: false
    show_name: false
    type: picture-entity
  - icon: mdi:lock-open
    layout: icon_name
    name: Open door lock
    styles:
      card:
        - font-size: 1.6rem
      icon:
        - width: 30%
      name:
        - justify-self: start
    tap_action:
      action: call-service
      service: script.open_front_door
    type: custom:button-card
type: vertical-stack

Hope you have fun with it, like it!

2 Likes

You can do a lot more if you go the SIP road, the you can actually ditch the indoor stations, and use your tablets with HA and talking fucntionality :slight_smile:

There is some nice progress on the asterisk add-on and the SIP card… But requires knowledge… It’s not a 1 2 3 setup

For which custom component specifically ?

All components are here:

It’s a work in progress

It’s a very nice progress , no official indoor station needed, you can just answer the call with your HA client… And also open door…

All based on default sip, even the asterisk add-on is ready for use, we tested it a lot, and will be released soon for public, but you can already test if you want, beta is ready…

1 Like

Thank you Fabio…Really dumb question…I have a 6113 (B series), running the latest firmware and am able, using postman to do the following

I can open up a 2-way audio connection by issue a PUT to the URL:
http://192.168.1.XXX/ISAPI/System/TwoWayAudio/channels/1/open
I can get streamed audio data by issuing a GET command to the URL:
http://192.168.1.XXX/ISAPI/System/TwoWayAudio/channels/1/audioData
I can send streamed audio data by issuing a PUT command to the URL:
http://192.168.1.XXX/ISAPI/System/TwoWayAudio/channels/1/audioData
and finally, I can close the 2 way audio connection by issuing a PUT to the URL:
http://192.168.1.XXX/ISAPI/System/TwoWayAudio/channels/1/close

I know you are working on a few ways via SIP but this seems like a much cleaner method??

Kind of exciting at least for me…now I have to figure out how I do it programmatically.

Yes , two way audio works indeed, but the question is, how to use it in HA? :slight_smile:

Always a better option that sip

I’ve been looking into the homebridge plugin route which seems pretty fully functioning as well.

Also, if you havent already done so, have a look here.

Ive ditched the idea of taking motion detection from the camera and leveraging the plugin’s analysis to determine motion.

My perfect solution is to not use hikconnect cloud, sip is a good alternative, bur the problem is that there is no early media on ring groups…

Two-way audio could solve it , I’m now using my Synology DS cam, that I open to talk … I open it from an action I receive from home Assistant companion app…

But if possible the perfect solution would be to start two way audio from HA itself…
Already did a request for it on the webrtc card…