"On Alert" macros and JSON Api

allflameme

n3wb
Joined
Jun 21, 2022
Messages
2
Reaction score
2
Location
Ukraine
Hi community.

It seems I can't find the way to "glue" both together, that is I cannot find a way to match the Alert by "ALERT_DB", "ALERT_CLIP, "ALERT_PATH" or "FILE" variables to the ones that are used in the JSON Api.
I have different zones setup, and have 2 different "On Alert" actions. One will basically trigger every time "person" goes by and the other one would trigger only if "person" moves across zones in a certain order.

The problem:
So when the second (with a pathway) "On Alert" fires an MQTT message I want to be able to use "export" JSON command later on to export a video OR timelapse. In the docs for the "export" it says you need to refer by db locator, so I went into the UI3 sources and checked how it works there. When exporting files it uses db locator for the current recording file (I use continuous + alerts, if anything). But this locator is different from any variables available in the "On Alert" tab and can only be found using "alerts" JSON Api. The problem there is that I can only see zones: 3 in the response, and, moreover, cannot ask Api to filter only those alerts, that I'm really interested in (the ones, that have a specific pathway).
Ideally, I want to find the way on how to get the, say "@123456789.bvr" string that I can feed into the "export" Api from the variables that I have in the "On Alert" stage (using some API or idk)

I can workaround by asking to export mp4 files when flagged, but this will create multiple files that are not needed and neither can I choose to create a video and a timelapse to be able to choose later on which one to download
 
Top