Skip to content

Plugin telegram bot

Martin Pihrt edited this page Oct 13, 2026 · 1 revision

Telegram Bot

Sends Telegram notifications and accepts a limited set of OSPy control commands from subscribed chats.

At a glance

Item Value
Version 1.0.1
Category Notifications and remote communication
Author Martin Pihrt
License GPL-3.0
OSPy 3.0.211 or newer
Python 3.8 or newer
Permissions network, system
Hardware No dedicated hardware requirement declared
Dependencies None
Python/OS packages None
Interfaces No provider or mobile API declared
Source Open the plug-in directory

What it is for

Sends Telegram notifications and accepts a limited set of OSPy control commands from subscribed chats.

How it works and how to configure it

This plugin lets OSPy send Telegram notifications and lets subscribed Telegram chats run a small set of OSPy control commands.

The plugin uses the official Telegram Bot API directly. It does not install or upgrade python-telegram-bot, because current versions of that library use a new asynchronous API and older plugin code is not compatible with it.

It includes a plugin.json manifest and reports its worker, token presence, connection, bot username, subscribed chat count, polling, received messages and errors through the OSPy system health interface. Tokens and chat identifiers are not included in diagnostics.

Setup

  1. In Telegram, open @BotFather and send /start.
  2. Create a bot with /newbot.
  3. Copy the token from BotFather.
  4. Paste the token into the OSPy Telegram Bot plugin.
  5. Enable the plugin and submit the form.
  6. Wait until the plugin shows the bot ID and username.
  7. Open your bot chat and send /subscribe BOT_ID, where BOT_ID is the ID shown on the plugin page.

OSPy restart is not required after changing the token or enabling the plugin.

Plugin setup

  • Enable Telegram Bot: Enables or disables the Telegram polling worker.

  • Bot Token: Token from @BotFather.

  • Your Bot ID: Telegram ID detected from the token. Use this ID as the subscribe access key.

  • Bot username: Telegram username detected from the token.

  • Subscribed chats: Telegram chats that can control OSPy and receive notifications.

  • Zone Change: Send a message when station state changes.

  • Help Command: Command for showing available commands.

  • Info Command: Command for showing current station and scheduler state.

  • Enable Command: Command for enabling the scheduler.

  • Disable Command: Command for disabling the scheduler.

  • RunOnce Command: Command for running a program by number, for example /runOnce 1.

  • Stop Command: Command for stopping all stations and disabling the scheduler.

  • Show in footer: Show Telegram Bot status in the OSPy footer.

Commands

  • /start: Show the first setup message.

  • /subscribe BOT_ID: Subscribe the current Telegram chat to OSPy.

  • /help: Show available commands.

  • /info: Show station and scheduler state.

  • /enable: Enable the scheduler.

  • /disable: Disable the scheduler.

  • /runOnce 1: Run program number 1.

  • /stop: Stop all stations and disable the scheduler.

Example

In-app help and settings notes

The following notes are generated from the help page shipped with this plug-in. Field names are also explained directly in the OSPy settings page.

You must provide a token to enable the bot to talk to telegram, follow the instructions Here

Setup

  • In Telegram, open @BotFather and send /start.

  • Create a new bot with /newbot and copy the token from BotFather.

  • Paste the token into the Telegram Bot plugin, enable the plugin, and submit the form.

  • The plugin connects automatically; OSPy restart is not required.

  • After the bot ID appears, open your bot chat and send /subscribe followed by the displayed bot ID.

Commands

  • shows the first setup message.

  • subscribes the current Telegram chat.

  • shows available commands.

  • shows station and scheduler state.

  • enables the scheduler.

  • disables the scheduler.

  • runs a program by number.

  • stops all stations and disables the scheduler.

The plugin uses the official Telegram Bot API directly and does not install python-telegram-bot automatically.

Example

Related links and diagrams

phone1

phone2

Support

Check OSPy → Diagnostics first and remove passwords, tokens, private addresses and other secrets before sharing logs. Report reproducible plug-in problems in the OSPy-plugins issue tracker.

Back to the plug-in catalog

Clone this wiki locally