Hikvision Still Image - Telegram

Stick the url in the browser to do your testing from there
I’ve got a HIK in my van I can always test one

I cannot use this on one of my cameras (that has the latest firmware for it), but it works fine on revisions below that
This, however, works fine no matter what firmware the camera is on.
http://hass:[email protected]/Streaming/channels/1/picture

I know I mentioned it before, but it seems like it was glossed over.

I was thinking the 101 was a bit peculiar
Usually it’s just 1 or 2 for main stream or substream

Sorry, i did not ignore your previous comment, i just forgot to reply to it.
Te URL is correct for accessing the Hikvision camera, it works, but it just prompts for credentials.
If i use your method in the URL i get a 401 response.

And Merry Christmas from sunny South Africa. :smiley:

I know. I do too. What I’m saying is that if I use a different URL, the one I provided, it works.

The more i dig into this problem, the more I feel that it is a bug with this combination of automation and camera.

I have the below config setup for the camera after a factory reset:

camera:
    - platform: generic
      name: Study Camera
      stream_source: "rtsp://admin:[email protected]:554/Streaming/Channels/102"
      still_image_url: http://10.0.0.21/ISAPI/Streaming/channels/101/picture
      username: admin
      password: pass

For stream_source i need to specify the user and password in the URL or the stream fails, there are many topic regarding this on the forum.

For the still image, i can rely on the Username and Password config variables to handle the authentication. I am then successfully able to add the still image onto lovelace with the below config:

      - type: picture-entity
        entity: camera.study_camera
        aspect_ratio: 50%

The image successfully updates every 10 seconds.
However, when attempting either of my automations above, they fail around 95% of the time motion is detected. Yet as before, they are 100% successful if i manually trigger them.

I am currently using the below automation and have had 100% success so far (5 out of 5 triggers sent successfully)

  - entity_id: binary_sensor.study_camera_line_crossing
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      data:
        photo:
        - password: pass
          url: http://10.0.0.21/ISAPI/Streaming/channels/101/picture
          username: admin
      message: Message
      title: Motion Detection
    service: notify.telegram_notifications

The only change i have done is move the username and password from the URL into their own config variable. I will report back after a few days to confirm all is working.

1 Like

Hi, how is it running now?
Just asking cause im struggeling with same issues like u and dont have a solution yet :frowning:
State change is reported but no message is send to telegram :frowning:
Edit what I figgured out now is that if I just send a textmessage everything is working.
So the error happens with getting the picture of the camera.
Could it be that the camera is so bussy with recording and detection that it needs too long to provide the picture? is it possible to define a timeout fot getting it maybe?

Hi Tom,
It has been rock solid for quite some time now.
My issue back in December, I am almost 100% sure, was resolved by a factory reset of the camera.
I have since switched my automations over to NodeRed, but previously it was working fine using Home Assistant only.
If you are in a position for completely factory reset the camera, i would say give that a shot first before messing around constantly with Home Assistant.

It hat definitive to do with the camera. I just added the link from a reolink camera and everything was was working. I just set up the camera so i will test if reseting it helps.