RelesWemos TelegramBot ESP8266

by jcherreradev in Circuits > Microcontrollers

17 Views, 1 Favorites, 0 Comments

RelesWemos TelegramBot ESP8266

Screenshot_1.jpg
Screenshot_2.jpg

Allows to control relays remotely through a Telegram bot. It uses an ESP8266, which receives commands to turn relays on or off, manage users and configure automatic on/off schedules. In addition.

Features

  1. ESP8266 connects to the Internet and links to a Telegram bot.
  2. It receives commands from Telegram to turn on/off relays and configure the system.
  3. Supports manual and automatic control according to predefined rules.
  4. Incorporates a system of LED alerts to indicate connection and configuration status.
  5. Allows management of registered users and relays.

Alerts LEDs

  1. 🔴 (Red) - No WiFi connection.
  2. 🔵 (Blue) - No Internet connection.
  3. 🟡 (Yellow) - No data configured.
  4. ⚪ (White) - Configuration mode activated.
  5. 🟢 (Green) - Everything working correctly.


Supplies

RelesWemos_TelegramBot_ESP8266_bb.png
  1. x1 ESP8266 board
  2. x1 Relay Module (depending on the number of devices to be controlled)
  3. x1 RGB LED
  4. x1 Push button
  5. x4 Resistors

Environment Configuration

Software

  1. IDE: Arduino IDE v2.3.x
  2. Board: LOLIN(WEMOS) D1 mini
  3. Framework: Arduino ESP8266 v3.1.2
  4. Partition: 4MB(FS: 3MB OTA: 512MB)

Libraries

  1. WiFiManager v2.0.17 → For WiFi connection configuration.
  2. UniversalTelegramBot v1.3.0 → For communication with Telegram.
  3. ArduinoJson v6.21.5 → For handling JSON data.

Flow of Operations

  1. Startup and Configuration: When the device is turned on, it attempts to connect to WiFi and retrieve stored configurations. If there is no data, it enters configuration mode.
  2. Interaction with Telegram Bot: Users can send commands to control relays and configure permissions.
  3. LED alerts: indicate system status in real time.
  4. Notifications: Messages are sent in Telegram when there are important changes or errors.

Code