address was long one I corrected to now when alert goes, or when I send test alert it crashes:
Code:5. Use {ip}:3000/snapshot?camera=$CAM in blue iris alert web request to get a snapshot (node:2280) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'C:\blue-iris-telegram-bot\images\snapshot.jpg' (node:2280) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5) (node:2280) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. events.js:288 throw er; / Unhandled 'error' event ^ Error: Cannot find ffmpeg at C:\blue-iris-telegram-bot\node_modules\fluent-ffmpeg\lib\processor.js:136:22 at C:\blue-iris-telegram-bot\node_modules\fluent-ffmpeg\lib\capabilities.js:123:9 at wrapper (C:\blue-iris-telegram-bot\node_modules\async\dist\async.js:272:20) at next (C:\blue-iris-telegram-bot\node_modules\async\dist\async.js:4584:24) at C:\blue-iris-telegram-bot\node_modules\async\dist\async.js:325:20 at C:\blue-iris-telegram-bot\node_modules\fluent-ffmpeg\lib\capabilities.js:116:11 at C:\blue-iris-telegram-bot\node_modules\fluent-ffmpeg\lib\utils.js:223:16 at F (C:\blue-iris-telegram-bot\node_modules\which\which.js:68:16) at E (C:\blue-iris-telegram-bot\node_modules\which\which.js:80:29) at C:\blue-iris-telegram-bot\node_modules\which\which.js:89:16 Emitted 'error' event on FfmpegCommand instance at: at emitEnd (C:\blue-iris-telegram-bot\node_modules\fluent-ffmpeg\lib\processor.js:424:16) at C:\blue-iris-telegram-bot\node_modules\fluent-ffmpeg\lib\processor.js:433:16 at wrapper (C:\blue-iris-telegram-bot\node_modules\async\dist\async.js:272:20) at next (C:\blue-iris-telegram-bot\node_modules\async\dist\async.js:4584:24) at C:\blue-iris-telegram-bot\node_modules\async\dist\async.js:325:20 at wrapper (C:\blue-iris-telegram-bot\node_modules\async\dist\async.js:272:20) at next (C:\blue-iris-telegram-bot\node_modules\async\dist\async.js:4584:24) at C:\blue-iris-telegram-bot\node_modules\async\dist\async.js:325:20 at C:\blue-iris-telegram-bot\node_modules\fluent-ffmpeg\lib\capabilities.js:519:16 at C:\blue-iris-telegram-bot\node_modules\fluent-ffmpeg\lib\processor.js:136:16 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! blue-iris-telegram-bot@1.0.0 start: `node index.js "index.js"` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the blue-iris-telegram-bot@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\root\AppData\Roaming\npm-cache\_logs\2020-02-25T12_00_12_052Z-debug.log
Blue Iris Alert bot listening on port 3000!
1. enter your settings in conf.json and restart
2. contact the bot with /start
3. check this console output for the userId
4. add the userId to the ALLOWED_USER in conf.json
5. restart this bot
5. Use {ip}:3000/snapshot?camera=$CAM in blue iris alert web request to get a snapshot
{"gif":[],"snapshot":[xxxxxxxxx]}
writing to chats.json
{"gif":[544227395],"snapshot":[xxxxxxx]}
writing to chats.json
ok, now it works almost. I have to run test from camera alert.
almost: it triggers when I made movement, but snapshot or gif what it sends is 4days ago
That was itand it works! there is typo in git page, it should be: 127.0.0.1:3000/snapshot?camera=&CAM not 127.0.0.1:3000/snapshot?camera=$CAM !
Really sorry for the typo, that is correct! Thanks for finding it, will correct it asap!and it works! there is typo in git page, it should be: 127.0.0.1:3000/snapshot?camera=&CAM not 127.0.0.1:3000/snapshot?camera=$CAM !
This is awesome! works really well thanks.Works very well im my opinion, but one should keep in mind that etlgr could access the images.
really like this approach! could you help me adjust the code so it sends the latest N pictures instead of a single one? thanks!!Heres how I do it:
1) Download curl for Windows from curl for Windows and copy the bin folder (in the zip file) to a location (I put mine into D:\BlueIris\Telegram_Upload)
2) Configure the BlueIris Camera: Post. Define what folder you are going to export the motion snapshots. Make sure it is a folder with the same shortname as the BlueIris camera.
View attachment 75307
3) Download, extract the zip file Telegram_Upload.cmd.txt (rename to .cmd) to the same location as step 1.
4) Modify Telegram_Upload.cmd (previous step) to reflect your details and file locations
5) Configure the BlueIris Camera: Alert
Tick "Run a program or execute a script" then click Configure button next to that
View attachment 75310
https://api.telegram.org/bot<BOTID>/sendphoto -F chat_id=<CHATID> -F photo=@D:\BlueIris\Alerts\&ALERT_PATH -F caption="[*&NAME*](http://<BIDOMAIN>/live.htm#&CAM) \- &MEMO" -F parse_mode=MarkdownV2
An alternative to your custom web page could be to open ui3 and directly stream the alert.The link to live.htm is a custom page
caption="[*&NAME*](&WAN/ui3.htm?rec=&ALERT_DB&maximize=1) \- &MEMO"
caption="[*&NAME*](&WAN/ui3.htm?rec=&ALERT_DB&maximize=1&streamingprofile=Jpeg HD) \- &MEMO"
&WAN
macro on my system (5.4.9.18) includes the 'http://', so I've dropped it in my code above.I do similar but just call curl directly from BI so no need for a shell script...
Code:https://api.telegram.org/bot<BOTID>/sendphoto -F chat_id=<CHATID> -F photo=@D:\BlueIris\Alerts\&ALERT_PATH -F caption="[*&NAME*](http://<BIDOMAIN>/live.htm#&CAM) \- &MEMO" -F parse_mode=MarkdownV2
BTW, the&WAN
macro on my system (5.4.9.18) includes the 'http://', so I've dropped it in my code above.
UI3 always seems to take a while to load when I'm away from home on mobile, A custom lightweight page which only loads the elements I want to see loads instantly.An alternative to your custom web page could be to open ui3 and directly stream the alert.
caption="[*&NAME*](&WAN/ui3.htm?rec=&ALERT_DB&maximize=1) \- &MEMO"
or for mobile devices you can use a less demanding (and perfectly adequate) stream:
caption="[*&NAME*](&WAN/ui3.htm?rec=&ALERT_DB&maximize=1&streamingprofile=Jpeg HD) \- &MEMO"
[*FrontYard*](http://WANIP/ui3.htm?rec=@3131123123&maximize=1) \- car:81%
I intended no criticism; was just genuinely curious if the macro might be expanding differently on your system.Yes my bad, I still had the domain hardcoded on a couple of cams and using the &WAN token on the rest.
I understand.UI3 always seems to take a while to load when I'm away from home on mobile
https://api.telegram.org/bot{KEY}/sendphoto -F chat_id={ID} -F photo=@"D:\Blue Iris\Alerts\&ALERT_PATH" -F caption="[*&CAM*](&WAN/alerts/&ALERT_DB?fulljpeg) [UI3](&WAN/ui3.htm?rec=&ALERT_DB&maximize=1) \- &MEMO" -F parse_mode=MarkdownV2