Using the http commands to send a jpg - can I "request" a picture a second or 2 earlier for a doorbell?

Post Reply
neilma
Posts: 2
Joined: Sat Nov 27, 2021 1:55 pm

Using the http commands to send a jpg - can I "request" a picture a second or 2 earlier for a doorbell?

Post by neilma »

I posted this in the Ipcamtalk forum but haven't had any response so trying here if anyone can offer any suggestions?

Hi folks Excuse the convoluted setup but for background....

I have a doorbell button, connected to a sonoff Mini. When the button is pressed, NodeRed (running in home assistant) sees the state change, and calls a script. The script I have set up, sends a notification to Telegram using the following format.....

http://IP.OF.MyBI.Server:81/image/FDCam?q=25&s=50&decode=1&Kbps=56

What is happening is that its capturing the image around 1.5 to 2 seconds after the button was pressed (I can get it to be a bit quicker by using the substream image (using &decode-1 ) but its not almost immediate like it used to (I have played around with lowering the q and s (and adding/removing and lowering the Kbps too).

I am not sure whats slowed things down as I have been making lots of changes of late but the 1.5 to 2 secs delay is consistent so in order to workaround this I was kind of hoping I could ask for an image 2 seconds before the request if you see what I mean? The camera is recording 24x7 so the info is there. Is there anyway to achieve this with the http command?

Here's the script if that helps (the script is run within milliseconds of the button being pressed so I am counting out the sonoff (as the bell rings) and NodeRed and Home Assistant as I can see everything triggering almost immediately on the button push (Ignore the bad formatting of the script - when I post this message, all the tabs/spacing at the start get removed) - The script works ok so its not down to the spacing (or lack of :))

- service: notify.telegram
data:
title: DoorbellTitle
message: DoorbellMessage
data:
photo:
- url:
http://IP.OF.MyBI.Server:81/image/FDCam?q=25&s=50&decode=1&Kbps=56
username: xxxxxxx
password: xxxxxxxxxxxxxx
caption: Doorbell Pressed

Thanks in advance or for any other ideas using the above setup?
neilma
Posts: 2
Joined: Sat Nov 27, 2021 1:55 pm

Re: Using the http commands to send a jpg - can I "request" a picture a second or 2 earlier for a doorbell?

Post by neilma »

Ended up working around this - Created a new clone camera with lower resolution and used it solely for the doorbell. My thinking is that when I started using substreams, it introduced some form of delay - The new camera isnt using substreams so is quicker? Dunno but its all working how I want now.
User avatar
TimG
Posts: 2084
Joined: Tue Jun 18, 2019 10:45 am
Location: Nottinghamshire, UK.

Re: Using the http commands to send a jpg - can I "request" a picture a second or 2 earlier for a doorbell?

Post by TimG »

Thank you for letting us know. I didn't respond before as I couldn't add anything. This is helpful information fo the next person with a similar query.
Forum Moderator.
Problem ? Ask and we will try to assist, but please check the Help file.
Post Reply