Skip to content
jack edited this page Feb 5, 2019 · 10 revisions

NxBot Wiki

NxBot requires Nx Witness as well as Telegram. The following sections will serve to aide in setting up these services to work with NxBot.

Setting up Telegram

NxBot was written specifically with Telegram in mind, given it's support and feature-set available to bots. The code can be freely modified, however, to work with any other notification / messaging system.

If you're new to Telegram, you can learn more and download the app from their website.

The following guides aide in the NxBot setup process as it related to Telegram:

Nx Witness Motion Event Rule

NxBot sends motion event snapshots for selected cameras, configured within Nx Witness.

Config Variables

There are a handful of config/environment variables required to run NxBot. Here you'll find the necessary information to obtain the appropriate values to get up and running.

NxBot can be configured to run using environment variables (recommended under Docker deployment), or by writing a config.yml, located in the same directory as the nxbot.exe (or no .exe for non-Windows) binary.

Example: config.yml

  • NX_IP_PORT (env) / nx_ip_port (yaml)

    Format: <IP>:<PORT> e.g. 192.168.1.2:7001

    Your Nx server's local IP address. The standard port is 7001.

  • NX_USER (env) / nx_user (yaml)

    The username of the Nx account. This can be a dedicated account with appropriate access or the account you already use to access Nx.

  • NX_PASS (env) / nx_pass (yaml)

    The password for the above Nx account.

  • HTTP_IP_PORT (env) / http_ip_port (yaml)

    Format: <IP>:<PORT> e.g. :7001 (omitting IP binds to all network interfaces)

    An IP and port combination used for the built-in NxBot web-server used for motion-event actions.

  • TG_TOKEN (env) / tg_token (yaml)

    The token issued by Telegram for access to their HTTP API. You can learn more on how to create a Telegram bot and retrieve the token on the dedicated Wiki page: Telegram: Creating Your Bot.

  • TG_USER_WHITELIST (env) / tg_user_whitelist (yaml) [highly-suggested]

    Format: (env) <id>,<id>... e.g. 123456789,987654321
    Format: (yaml) [<id>,<id>...] e.g. [123456789,987654321]

    The user ID, or multiple user IDs (comma separated when multiple), of the accounts allowed to communicate with the bot. It's fine to only list one user ID, but be sure to use the [ ] (square-brackets) when using the yaml config.

    It's highly recommended to set a value, as omitting it will leave your bot open to any user that discovers it.

    To learn how to get your user ID, or the ID of others, visit the dedicated Wiki page: Telegram: Getting User IDs.

  • TG_GROUP_WHITELIST (env) / tg_group_whitelist (yaml) [optional]

    Format: (env) <id>,<id>... e.g. -123456789,-987654321
    Format: (yaml) [<id>,<id>...] e.g. [-123456789,-987654321]

    The group ID, or multiple group IDs (comma separated when multiple), of the groups allowed to communicate with the bot. It's fine to omit this value if you're not using groups. When specifying a value, be sure to use the [ ] (square-brackets) when using the yaml config.

    Group IDs tend to be negative (-) numbers. To learn how to get the group's ID, visit the dedicated Wiki page: Telegram: Getting Group IDs.

  • TG_MOTION_RECIPIENTS (env) / tg_group_whitelist (yaml)

    Format: (env) <id>,<id>... e.g. -123456789,987654321
    Format: (yaml) [<id>,<id>...] e.g. [-123456789,987654321]

    The user or group ID, or multiple, of recipients of motion-event actions. It's fine to only list one ID, but be sure to use the [ ] (square-brackets) when using the yaml config.

    User IDs tend to be positive numbers, while group IDs are negative (prefixed with -). To learn how to get Telegram user IDs, or group IDs visit the following Wiki pages:

Clone this wiki locally