-
-
Notifications
You must be signed in to change notification settings - Fork 28
Configuration
General settings for the system as well as configuration options for outbound services are managed in the settings.json
file.
An annotated sample file to start from is available in the sampleConfiguration directory for the project.
The following settings are available for general system configuration:
Property | Description | Example |
---|---|---|
deepstackUri |
Required. The address of the Deepstack AI server. | http://deepstack-ai:5000/ |
enableAnnotations |
Turns on the internal web server and writing annotated images to local storage for use in outbound messages. Optional. Default false . |
true |
mqtt |
Configuration for sending MQTT messages. Optional. | See below. |
port |
The port number for the internal web server. Only used when enableAnnotations is true . optional. Default 4242 . |
5004 |
purgeAge |
The length of time, in minutes, an annotated image in temporary storage must go without being accessed before being purged. Optional. Default 60 . |
120 |
purgeInterval |
Controls how long the system waits between purges of temporary annotated image storage, in minutes. Optional. Default 30 . |
10 |
verbose |
Controls the level of output logging. If false or omitted then only startup messages, warnings, errors, and successful AI detection are logged. Optional. Default false . |
true |
pushover |
Configuration for sending Pushover messages. Optional. | See below. |
telegram |
Configuration for sending Telegram bot messages. Optional. | See below. |
MQTT is enabled by adding an mqtt
property to settings.json
. The following options are supported:
Property | Description | Example |
---|---|---|
enabled |
If true then MQTT is enabled. Optional. Default true . |
false |
password |
The password to log into the server with. Optional. | "pass" |
rejectUnauthorized |
Controls whether connections to mqtts:// servers should allow self-signed certificates. Set to false if your MQTT certificates are self-signed and are getting connection errors. Optional. Default true . |
false |
retain |
If true all MQTT messages are sent with the retain flag on. Optional. Default false . |
true |
statusTopic |
The topic to send status messages to. Optional. Defaults to node-deepstack-ai/status . |
"aimotion/status" |
username |
The username to log into the server with. Optional. | "user" |
uri |
Required. The address of the MQTT server. | "mqtt://192.168.1.100:1883" |
The only authentication method currently supported is basic.
When MQTT is enabled status messages are automatically sent that report the health of the server. These messages are useful in conjunction with MQTT binary sensors in Home Assistant to monitor whether the server is running and send notifications to people if it goes down for some reason.
"mqtt" : {
"uri": "mqtt://192.168.1.100:1883",
"username": "user",
"password": "pass",
"retain: true
}
{
"state": "online"
}
{
"state": "online",
"triggeredCount": 5
"analyzedFilesCount": 60
}
triggeredCount
is the total number of times a trigger met all the defined requirements and fired its registered handlers. analyzedFilesCount
is the total number of times a trigger evaluated an image. Note: if multiple triggers are registered for the same watchPattern
then each trigger will increment the analyzed file count.
{
"state": "offline",
"details": "error details included here"
}
{
"state": "offline"
}
Telegram is enabled by adding a telegram
property to settings.json
. The following options are supported:
Property | Description | Example |
---|---|---|
botToken |
Required. The bot token for your Telegram bot server. | "123987123:adfk2893r7akdskanfsdalskf" |
enabled |
If true then Telegram is enabled. Optional. Default true . |
false |
Obtaining the botToken
and chatIds
for the trigger configuration is not hard but does take a few
steps. Here's what you need to do:
- Contact
BotFather
on Telegram - Send the
/newbot
command. Follow the instructions and you'll get back a token that looks something like the one in the example above. - Connect to the bot in your Telegram personal account and send it a message
- Go to
https://api.telegram.org/bot123987123:adfk2893r7akdskanfsdalskf/getUpdates
, after replacing the token in the URL with the one you obtained in step 2. - In the response look for the
id
field to obtain the chatId. In the below sample response the chatId is12345
.
{"ok":true,"result":[{"update_id":297596982,
"message":{"message_id":2,"from":{"id":12345,"is_bot":false,"first_name":"Neil","last_name":"Enns","language_code":"en"},"chat":{"id":12345,"first_name":"Neil","last_name":"Enns","type":"private"},"date":1590551469,"text":"hi"}}]}
"telegram" : {
"botToken": "123987123:adfk2893r7akdskanfsdalskf",
}
Pushover is enabled by adding a pushover
property to settings.json
. The following options are supported:
Property | Description | Example |
---|---|---|
apiKey |
Required. The apiKey token for your Pushover app. | "asdflj234xvnmwekl234" |
enabled |
If true then Pushover is enabled. Optional. Default true . |
false |
userKey |
Required. The userKey token for your Pushover account. | "4dkgj34sdfn430234" |
The apiKey is created at the Pushover apps page.
"pushover" : {
"apiKey": "asdflj234xvnmwekl234",
"userKey": "4dkgj34sdfn430234"
}