Any way to send arbitrary (http) command when a camera is being viewed?

pozzello

Known around here
Joined
Oct 7, 2015
Messages
2,270
Reaction score
1,117
I'm setting up a solar/battery powered wifi cam for my brother-in-law to keep an eye on his kids & dog when they play in the empty lot across the street. I have a Hikvision 2542 wifi cam powered by a ~12V lithium battery pack, with a PIR sensor to turn it on when motion is detected (stays on for ~6 minutes or so unless more motion). The wifi connection allows the cam to be viewed in Bi when it's on. the battery is good for ~4-5 hrs of operation, but the solar panel can really only replenish a couple hour's worth every day, so we can't just run it full time - thus the PIR switch...

Only problem so far is we always miss the first 30 secs or so of action, as it take a while for the cam to boot up, get on the network, and BI to notice it.

I have also got a Sonoff SV (with Tasmota), which is basically a wifi swicth that can also turn the cam on whenever we need it. There's an app that can control the switch, but it also responds to http and/or MQTT commands. The cam draws ~3-4W, but the switch draws substantially less...

I'd like to find some way to have BI send the 'power up signal' to the wifi switch when the camera is being viewed in BI. There is a checkbox in the 'schedule' config page for each cam that 'enables' the cam when it's either full screen on the console or being streamed from the web UI, but I have yet to find a way to send an arbitrary HTTP command via GET URL or MQTT message when the cam becomes active.

schedule.PNG

Any ideas? I don't want to make this any more complex than it is already, so if there's no simple way, we'll probably just live with missing the leading action... TIA, Paul.
 
Last edited:

pozzello

Known around here
Joined
Oct 7, 2015
Messages
2,270
Reaction score
1,117
Made some progress. URL to power up the wifi switch works when tested in the alerts page, but isn't being fired off when i manually 'trigger' the cam from the console or the BI app...powerup when triggered.PNG
 

pozzello

Known around here
Joined
Oct 7, 2015
Messages
2,270
Reaction score
1,117
It seems BI will not 'trigger' a camera unless the camera is alive and streaming, so i can't power up the cam by triggering it.
May need to check with support to see if there's any workaround for that...
 

pozzello

Known around here
Joined
Oct 7, 2015
Messages
2,270
Reaction score
1,117
Aha! Once I disable 'detect loss of signal' in the watchdog pane, BI does make the http request configured in the alerts when I manually trigger the cam from the console or the app. As much as I'd like to make it more automatic, this will work for now...
disable watchdog.PNG
 

pozzello

Known around here
Joined
Oct 7, 2015
Messages
2,270
Reaction score
1,117
Sadly, while disabling the watchdog allows 'triggerring' the cam to send the power-up command, it does NOT result in the cam being noticed and stream automatically re-started once booted (need to manually restart the cam in BI after triggering + time to boot cam). sigh. back to the drawing board. Will see what BI support has to suggest...
 

myipcam

Getting the hang of it
Joined
Dec 23, 2018
Messages
132
Reaction score
33
Location
USA
You could build a static web page with onload, publish required mqtt json payload and then load BI web ui URL to that specific camera... (check camera URLs in help).
Even then, you would still have to wait for camera to boot up. If PIR is not detecting motion, (I am assuming) no need to monitor the camera and if you manually start it, there may not be anyone there??
In any event, if you want to manually turn it on, that's how I would try to do it.
 
Top