All Projects → grover → homebridge-telegram

grover / homebridge-telegram

Licence: MIT license
HomeKit/Homebridge driven notifications via Telegram

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to homebridge-telegram

homebridge-automation-switches
A flexible automation switch for Homebridge: https://github.com/nfarina/homebridge
Stars: ✭ 96 (+104.26%)
Mutual labels:  home-automation, homebridge, homebridge-plugin
homebridge-plex
Plex plugin for homebridge: https://github.com/nfarina/homebridge
Stars: ✭ 58 (+23.4%)
Mutual labels:  home-automation, homebridge, homebridge-plugin
homebridge-wink3
Homebridge plugin for wink.com
Stars: ✭ 53 (+12.77%)
Mutual labels:  home-automation, homebridge, homebridge-plugin
Homebridge Dacp
Remotely control Apple TV and iTunes via HomeKit.
Stars: ✭ 128 (+172.34%)
Mutual labels:  home-automation, homebridge, homebridge-plugin
homebridge-vsx
📻 A VSX and SC Plugin for homebridge
Stars: ✭ 12 (-74.47%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-mijia-camera
Homebridge plugin for the Xiaomi Mijia 1080P Smart IP Camera, also known as Mi Home Security Camera.
Stars: ✭ 35 (-25.53%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-mi-fan
XiaoMi fan plugins for HomeBridge.
Stars: ✭ 59 (+25.53%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-messenger
Send HomeKit messages with HomeBridge (Pushover / IFTTT / Email)
Stars: ✭ 74 (+57.45%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-callmonitor
Signals incoming and outgoing calls using the call monitor facility in Fritz!Box devices via HomeKit
Stars: ✭ 25 (-46.81%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-z2m
Expose your Zigbee devices to HomeKit with ease, by integrating 🐝 Zigbee2MQTT with 🏠 Homebridge.
Stars: ✭ 197 (+319.15%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-magichome-platform
Homebridge Plugin for MagicHome LED Strips with Preset Scene Automation Support (Cycle Color/Fade/Strobe)
Stars: ✭ 46 (-2.13%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-yamaha-avr
homebridge-plugin for Yamaha AVR. Audio Receiver Accessory with Power, Input, Volume & Remote Control
Stars: ✭ 39 (-17.02%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-vieramatic
Homebridge plugin for Panasonic™ Viera™ TVs (includes support for 2018 and later models)
Stars: ✭ 39 (-17.02%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-pi-thermostat
Homebridge Plugin to make Raspberry Pi into Thermostat
Stars: ✭ 33 (-29.79%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-open-sesame
Homebridge plugin for SESAME3 and SESAME4
Stars: ✭ 14 (-70.21%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-nature-remo-cloud-aircon
Homebridge Plug-in for Air Conditioner Managed by Nature Remo
Stars: ✭ 28 (-40.43%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-nremo
Nature Remo Plugin for homebridge
Stars: ✭ 17 (-63.83%)
Mutual labels:  homebridge, homebridge-plugin
homebridge-eveatmo
Homebridge plugin which adds a Netatmo weatherstation as HomeKit device and tries to act like Elgato Eve Room/Weather
Stars: ✭ 63 (+34.04%)
Mutual labels:  homebridge, homebridge-plugin
hass config
My personal Home-Assistant configuration for my home.
Stars: ✭ 17 (-63.83%)
Mutual labels:  home-automation, homebridge
homebridge-pilight
Accessory plugin for Homebridge allowing to manage and control pilight devices
Stars: ✭ 16 (-65.96%)
Mutual labels:  homebridge, homebridge-plugin

Homebridge Plugin for Telegram Bots

A platform that provides configurable Telegram Bots and integrates them with HomeKit via Homebridge.

Status

HitCount Build Status Dependency Status devDependency Status Node version NPM Version

Why a Telegram Bot?

This plugin enables you to send Telegram messages upon certain HomeKit events. The plugin provides a toggle switch for groups of notifications, which will send out one of the predefined notifications via Telegram to a configured chat. For example, you could set up a rule to send out a message via Telegram when a window is opened. And with homebridge-automation-switches you could even repeat that process until the window is closed.

You can also add a little fun to it, by providing many different messages in a group, which the plugin selects randomly.

The bots are non-interactive, e.g. they do not provide commands to trigger things and will not listen for messages sent to them.

Changelog

All changes to homebridge-telegram are documented in the changelog.

Installation instructions

After Homebridge has been installed:

sudo npm install -g homebridge-telegram

Example config.json:

{
 "bridge": {
     ...
 },
 "platforms": [
   {
     "platform": "Telegram",
     "bots": [
       {
         "name": "Bot name as seen in HomeKit",
         "token": "TELEGRAM BOT TOKEN",
         "chat": "TELEGRAM CHAT ID",
         "error": "Something broken. I'm shutting down.",
         "notifications": {
           "Hello": {
             "mode": "Markdown",
             "randomize": true,
             "messages": [
               "*Hi!*",
               "_Hello!_",
               "Hey mate!"
             ]
           },
           "Bye": {
             "mode": "HTML",
             "randomize": false,
             "messages": [
               "<b>Good bye!</b>",
               "<i>I'm sad to see you leave.</i>"
             ]
           }
         }
       }
     ]
   }
 ]
}

Simple style configuration will still work and can be mixed with the advanced configuration modes:

"Hello": [
  "Hi!",
  "Hello!",
  "Hey mate!"
]

The platform can provide any number of bots that have to be predefined in the homebridge config.json. Each bot supports the following attributes:

Attributes Usage
name A unique name for the bot. Will be used as the accessory name.
token The Telegram Bot API token provided when you registered the bot.
chat The chat ID used to send the notification to.
error The message to send if something fails. If you do not want an error message visible in Telegram, keep this undefined.
notifications An object providing notifications in named groups.

A switch is created for each notification group.

Configuring notification groups

Notification groups have additional configuration options if the new style configuration is used:

Attributes Usage
mode Specify the format of the notifications. Do not specify this for plain text notifications. Use Markdown for markdown notifications and HTML for HTML notifications.
randomize If true, will select a message randomly. The default value is true. If you do not want random messages, select false.
messages An array of messages to use for the button.

Creating a bot

The folks at Telegram created better documentation, than I could ever do.

Once you've created the bot you'll need to find a chat ID that this plugin should send messages to. The easiest way is to message the bot and look for the JSON dumps in the homebridge log. This also supports group chats.

Formatting Options

Please read the formatting options in the Telegram Bot API for the supported HTML and Markdown formatting options.

Accessory Services

Each bot will expose two services:

  • Accessory Information Service
  • Bot Service

BotService Characteristics

The exposed switch service supports the following characteristics:

Characteristic UUID Permissions Type Usage
Quiet 9799244D-7E74-471F-B672-C41C262F7337 READ, WRITE BOOL Stops the bot from sending messages, while this is enabled.

See HomeKitTypes.js for details.

Supported clients

This platform and the bots it drives have been verified to work with the following apps on iOS 11

  • Elgato Eve

Some asks for friendly gestures

If you use this and like it - please leave a note by staring this package here or on GitHub.

If you use it and have a problem, file an issue at GitHub - I'll try to help.

If you tried this, but don't like it: tell me about it in an issue too. I'll try my best to address these in my spare time.

If you fork this, go ahead - I'll accept pull requests for enhancements.

License

MIT License

Copyright (c) 2017 Michael Fröhlich

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].