ZSamuels28 / UnifiClientCheck-Docker

Monitor UniFi networks for new devices with Telegram or Ntfy alerts using Art-of-WiFi/UniFi-API-client.
Apache License 2.0
16 stars 2 forks source link
php telegram-bot unifi unifi-controller

UniFiClientAlerts

Version Docker Build and Push Docker Pulls

UniFiClientAlerts is a Dockerized application that monitors UniFi networks for new device connections and sends alerts via Telegram or Ntfy.sh. It leverages PHP code from the Art-of-WiFi/UniFi-API-client for interfacing with UniFi Controllers.

This has been tested on a number of devices, and I personally have this running on Portainer on a Raspberry Pi 5.

Docker Hub Image: https://hub.docker.com/r/zsamuels28/unificlientalerts

Features

UniFi Configuration

To successfully use this application with your UniFi Controller, please follow these guidelines:

By following these steps, you can securely and effectively connect this application to your UniFi Controller for monitoring new device connections.

Setting up an Ntfy.sh Topic

  1. See https://github.com/binwiederhier/ntfy/tree/main

Telegram Configuration and Setting Up a Telegram Bot

  1. Search for "BotFather" in Telegram.
  2. Use the /newbot command to create a new bot.
  3. Follow the instructions to name your bot and get a token.
  4. Save the token and use it in the TELEGRAM_BOT_TOKEN variable.
  5. Send a message to your bot on Telegram and access https://api.telegram.org/bot{YOUR_TOKEN}/getUpdates this will give you the Chat ID to use in TELEGRAM_CHAT_ID

Environment Variables

Set these variables for proper configuration:

Running the Application

Using Docker

Using Docker Compose

Manual Docker Build

Running Outside Docker

Contributions

Contributions are welcome. Please adhere to the project's standards and submit a pull request for review.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Acknowledgements

This project utilizes code from the Art-of-WiFi/UniFi-API-client, a PHP-based client class to interact with the UniFi Controller API.