[APP][Pro] Support for ONVIF compatible cameras (Release 2.0.48, Test 2.0.51)

Thank you, Adrian. I fear you are right.

I don’t know what’s going on. Since I’ve updated the random reboots of the camera are gone, but:

  • Time of camera is not showing anymore in device settings
  • Time of sabotage isn’t showing anymore.

But the most annoying part is the following. I have made a few flows:

  • If my doorbell is pressed: send a text message in Telegram and send a screenshot in Telegram.
  • If there is movement. Send a text message in Telegram and send a screenshot in Telegram.

Before I have updated the camera this worked 100% of the times. Since I have updated, it only works when I manually start one of these flows. To make it more strange: The text messages are coming through all the time, so the flow triggers are working. The screenshots only when I manually start the flow (and it isn’t triggered) and like 10% of the times when the flow is triggered.

Meanwhile I have updated the camera multiple times, updated the Homey, restarted everything. But nothing seems to help. The Telegram app isn’t updated for over a year, but before I have updated my camera it worked always. I don’t know where to search anymore. Do you have any ideas what it can be?

Could you share one of the flows?
I wonder if it’s just a timing issue.

I tried a lot of variations. But it even happens with the most simple one:

If - Camera - motion detected (from onvif app)
Then send Telegram message
Then send Telegram motion snapshot (delay 3 seconds)

*Note: same behavior if I use:
Camera → motion
Camera → snapshot

To send a picture with Telegram

This is the flow I use
https://homey.app/f/6spsCB

Yes I tried that version also. I just tried both in one flow:

  1. Telegram: text Message
  2. Telegram: snapshot
  3. Push notification: snapshot

If I manually start the flow:
I get all 3

If the flow is triggered:
I get 1 and 3

This is very frustrating, since the push notifications are not saved somewhere and I can only see the last one. It’s strange though, before I have updated my camera it all worked


Is it possible that it has something to do with the time which is not showing under the camera anymore?

Probably it’s something with the Telegram app, which doesn’t seem to be maintained. Very unfortunate, this was one of the functions I used most with this camera


That does seem really strange. If you reverse the order of 2 and 3 does it make a difference?
Are you triggering off the Motion Snapshot Ready?

Order doesn’t matter unfortunately.
I tried to trigger on that as well. Exact same behavior. It’s really strange! I tried really everything, and run out of options.

I still find it so weird that if I start the flow myself, it all works. I also tried other triggers in the flow, but all the same


Tonight it worked randomly two times, triggered on motion. And 6 times it didn’t send a picture, but always send the text.

I also tried to start a flow from within a flow (to try to emulate my manual start). Same strange outcome.

It’s really strange and I share your frustration as I can’t think why this should happen.
It seems the image is being captured as it is being sent via the push notification. By using the Motion Snapshot Ready trigger there shouldn’t be any timing issues. The only thing I can think of is the image itself is sometimes not compatible but that doesn’t make sense when it is reliable when manually triggered.
I will ask around to see if anyone has any suggestions.

I don’t think it’s directly related, as in the cause of the image issue, but could be another symptom of the underlying issue.
Could you set the log to Full Information and send it me after triggering motion.

Really appreciate your effort!
Just send the full information log. Before I send it, I noticed these notifications in the log from the onvif app.

Those messages mean a new trigger came in before it had time to download the previous image.
Looking at the time stamps they are coming in quite frequently. Maybe that is causing an issue where an image that is being sent is overwritten before it completely transfers. I will need to look at the code to refresh my memory about how I did it. If it looks like it is then I will need to think of some workaround but I am not aware of anyway to know if an image is being sent.
I will let you know if I confirm or disprove my hypothesis.

1 Like

I have published a new test version ONVIF Camera | Homey
I have tried two things in this version to solve the problem with Telegram.

  1. The image file is now unlinked before downloading it again. The hope is that it will prevent the image overwriting an image that is being sent to Telegram.
  2. Add a Minimum On Time. This will also limit the time beteen image captures so it can be used to ensure time is given to send each image to Telegram before a new image is captured by another trigger.

I have been testing with Telegram for a few days and I couldn’t get it to go wrong with my cameras even before the changes so I don’t know if it will fix your problem.

Let me know if it helps.

I was so happy when you released it. Everything worked again. Unfortunately that feeling disappeared after a few hours again. I did extensive testing and can’t wrap my head around what’s going on.

  • First everything worked and then suddenly everything stopped and strangely at 20:00 UTC it worked again for a while.
  • Manual starting flows did send a telegram text message, the push message from homey worked, but no picture in Telegram.
  • I removed the Telegram app, made a new bot and everything, same behavior. Telegram log says it’s being send.

It seems so random. Right now I can make a flow where the push message picture is receiving, but not in Telegram. That will probably work in an hour again
 It seems somehow that time has influence on what’s going on.

When it’s working, how frequently do you get images into Telegram?
I occasionally get a situation where the image doesn’t appear in the notification bar but it does show in the history of Telegram. That is obviously an issue with Telegram.

With the new setting you can restrict the number of images as the minimum On time also defines the minimum time between images. It might be worth increasing that to see if it helps.

If it’s working I can get multiple images per minute in Telegram. That’s working fine then.

Today: Zero images in Telegram and push notifications worked perfectly.

It’s the function I used most from Homey
 :frowning: It all started after I have updated the camera because it rebooted at random times (and after a reboot, this problem occurred). At that time it was fixable with a restart of the app.

The only big difference I noticed is that my camera via Onvif is not giving the time anymore. Could this be an issue with a new onvif version?

Edit: today also manual triggering is not showing the image in Telegram, but only in push message

If you set the minumim on time to 15 seconds and it still doesn’t work then I am completly out of ideas.
That seting should gurantee that all images are sent before a new one is captured and that is the only thing I can thnk of that is happening.
Unfortunatley, Homey has no file locking mechanaism so there is no way to know if a file is being transmitted when a new image is written.

I really appreciate your help. I also don’t understand it anymore. I have tested literally everything and now it’s not working at all anymore. Text messages are received 100% and images at this moment never. The telegram log says its been send, but I don’t receive it though.

If I make a flow: “Motion snapshot ready” and I manually start this one. I receive an image with the Homey logo. That’s the only thing I still receive
 Strange thing also is that the push message is working all the time.

I can’t find anything strange. Seems like I am hitting a bug somewhere, but I don’t know where I should look for it. At this moment I don’t see the “Event STILL processing last image (Camera)” anymore. But it doesn’t seem that this was the problem. I have also changed the minimum on time, but no difference.

Strange thing I find is that it started when I have updated my camera. My camera had a bug where it rebooted at random times. After the reboot, I had this exact same behavior, but I was always able to fix it by either restarting the camera app.

Telegram log with normal image (snapshot):
4:47:04 PM: Response:
4:47:01 PM: get stream
4:47:01 PM: [SEND IMAGE] {“to”:{“image”:“https://telegram.org/img/t_logo.png",“name”:“Username”,“chat_id”:chatid},“droptoken”:"homey:image:random token”}

Telegram log with “Motion snapshot ready” (when this is not available and I receive the Homey logo):
4:52:38 PM: get stream
4:52:38 PM: [SEND IMAGE] {“to”:{“image”:“https://telegram.org/img/t_logo.png",“name”:“Username”,“chat_id”:chatid},“droptoken”:"homey:image:random token”}

The empty response is remarkable. Do you also have this when sending a snapshot to Telegram?

I’ve only been using Telegram to test for the problem you are experiencing so I don’t have a lot of experience with it.
However, the images from my cameras have appeared in Telegram every time.

I understand. I know for sure now something is going wrong. If I send a Sonos picture to Telegram, it’s working and also there is no response in the telegram log.

If I look into the telegram code on git I see:

Blockquote
if(!response.ok) {
console.log(‘Response:’, await response.text());
return false;
}

So it’s going wrong, but logging isn’t saying what’s going wrong because answer is empty. Unfortunately this app doesn’t seem to be developed anymore.