neilenns / node-deepstackai-trigger

Detects motion using Deepstack AI and calls registered triggers based on trigger rules.
MIT License
165 stars 28 forks source link

Cooldowns, suppressions and other control features #382

Closed ratatine closed 3 years ago

ratatine commented 3 years ago

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:

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.

neilenns commented 3 years ago

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.

ratatine commented 3 years ago

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