GithubHelp home page GithubHelp logo

mad-ady / appdaemon-telegrambot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from foxcris/appdaemon-telegrambot

0.0 1.0 0.0 2.19 MB

Simple bot to control your home-assistant

License: GNU General Public License v3.0

Python 100.00%

appdaemon-telegrambot's Introduction

appdaemon-telegrambot

Simple bot to control your home-assistant via a telegram chatbot. As a requirement, the telegram platform has to be configured in home-assistant (https://www.home-assistant.io/components/notify.telegram/).

Currently the bot provides a simple request/response command interface. The following commands are available:

  • /help: Help
  • /state_cover: State of cover
  • /state_vacuum: State of vacuum
  • /state_light: State of light
  • /state_climate: State of climate
  • /state_person: State of person
  • /open_cover: Open cover
  • /close_cover: Close cover
  • /turnoff_light: Turn off light
  • /turnon_light: Turn on light
  • /start_vacuum: Start vacuum
  • /stop_vacuum: Stop running vacuum
  • /restart_hass: Restart hass
  • /state_system: State of home-assistant
  • /state_sensor: State of sensors
  • /get_version: Get version of telegrambot
  • /turnon_automation: Turn on automation
  • /turnoff_automation: Turn off automation
  • /trigger_automation: Trigger automation
  • /state_automation: State of automation
  • send location message from telegram: for each defined zone in home-assistant the travel time from the current location sent is computed

Configuration

appdaemon configuration

Just copy the files

  • TelegramBot.py
  • Helper.py

to your apps folder of appaemon and add the following configuration to your apps.yaml (example data shown for some parameters)

TelegramBot:
  module:                   TelegramBot
  class:                    TelegramBot
  debug:                    True
  extend_system:            sensor.date,sensor.heartbeat
  extend_light:             switch.light
    - load_1m
    - load_5m
  filter_whitelist:
    - sample
  routing:
    waze:
      region:               EU
      avoid_toll_roads:     True

||Configuration parameter || Description || |extend_system | comma separated list of complete entities to include in the system report| |extend_light | comma separated list of complete entities to include in the commands /state_light /turnoff_light /turnon_light| |filter_blacklist| python regex to exclude entities from being reported/used from telegrambot| |filter_whitelist| python regex to whitelist entities from being reported/used from telegrambot The following logic is used to apply the blacklist and whitelist:

  • If the blacklist is empty - nothing is filtered out
  • If the whitelist is empty - nothing is filtered out
  • If both the blacklist and whitelist are non-empty, first the blacklist ist applied and then the whitelist | |routing| currently only waze is supported. region can be 'US','EU','IL','AU' and is used to select the correct routingserver from waze. avoid_toll_roads is a boolean to enable/disable the use of toll roads in the travel time computation.|

The file Helper.py is also used by one of my other appdaemon project. In both projects the same file is used!

Screenshots

Contributing

  • All contributions are welcome!
  • A PR must be accompanied with some tests for the new feature
  • Please take care that:
    • The code is readable and is optimally documented
    • The code passes all tests

Tests

For the unit test the Appdamon-Test-Framework is used together with pytest.

Requirements

All necessary requirements are listed in the requirements-dev.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.