neilenns / node-deepstackai-trigger

Detects motion using Deepstack AI and calls registered triggers based on trigger rules.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cooldowns, suppressions and other control features

ratatine opened this issue · comments

Issue at hand

One vital feature this should have is the ability to suppress spurious notifications. If I've already been told that there is a person detected in my driveway, there isn't a need to flood my phone with 10 notifications were one or two will do. Additionally what if that person is me and I want to issue a suppression through Node-Red or some other automation platform like HA? Or perhaps it might be useful to specify time periods of various detection rules/triggers? Perhaps I only want to know if someone is in my garage in the middle of the night?

Potential solutions:

  • An API call or file indicator that can be passed through docker to suppress or alter alert handlers for a period of time
  • A trigger handler cooldown configuration that controls when it will alert or how many alerts it will send in a specified period of time.
  • A trigger handler time window configuration that will only use specific handlers during specific times/days/etc

Alternatives considered

I know some things could be done with BI profiles although that is BI specific and may not help with other integrations. It's not ideal to have to configure profiles for every scenario potential.

The system already supports cooldown, both at the trigger level and at the individual handler level, specifically for this reason.

See https://github.com/danecreekphotography/node-deepstackai-trigger/wiki/Defining-triggers. The very first entry in the first table is cooldownTime.

Each of the individual handlers that send text notifications (Telegram, Pushbullet, Pushover) also supports cooldownTime.

You can add more complicated logic by relying on MQTT events and doing your own handling in NodeRed based on the incoming MQTT messages. From the NodeRed side you can then call whatever you want to trigger recording (this is how I have my system set up). E.g. if you only want to trigger recording during certain times of the day use the excellent Light Scheduler node for NodeRed to define "on" times, and upon receipt of MQTT messages during that period use a node to call BlueIris to start recording.

I'll look into doing that with MQTT. I didn't see the parameter in the sample config and built it off that. Thanks.