Setting a condition with a macro

alroul

n3wb
Feb 4, 2023
1
0
us
Hi everyone,

I recently set up an "alert" on one of my cameras. When motion is detected, a script sends a photo directly to my local AI (Ollama) and forwards the answer along with the photo to my cellphone to Pushover and Home Assistant (HA). Everything works perfectly.
I also created a custom button in Home Assistant to disable "all" alerts for that camera. Sometimes, I don't want the alert to trigger. This also works fine.

On this camera, I have three types of alerts: Email, MQTT to HA, and Ollama. Instead of disabling all alerts at once, I wanted to find a way to disable only one alert at a time. Unfortunately, I haven't had success with this approach yet. I know I can clone the camera and set individual alerts for each type, but I was wondering if there's a way to conditionally trigger my Ollama alert script.

Here’s what I tried:
I programmed a custom button in Home Assistant to send an MQTT message with a value of 1 or 0 to the macro %1. This works perfectly. However, I am having trouble setting up the condition directly in BlueIris where if macro %1 is set to 1, the script triggers; otherwise, it doesn’t trigger. This can be effective to disabling the Ollama alert when I don't need it, but keep the other alerts on.

Any help will be really appreciated.
thanks.

Here is my settings :
BlueIris : version 5.9.9.67

Camera 1 :
Alert 1 : MQTT : pushover
Alert 2 :Email
Alert 3 : Ollama Alert

Alert 3 : Ollama Alert, I have :
Camera / Alert / On Alert / Run a program or write to a file /
Action : Run a program
File : H:\Blueiris\Scripts\ollama.bat
Parameters : &ALERT_PATH &CAM &OBJECTS &TIME