Coder Social home page Coder Social logo

zway-bot's Introduction

zway-bot

The ZWay text bot is small tool to control ZWay server via human text commands. It can act as telegram bot and as http server.

Installation

go get -u github.com/olegator77/zway-bot

Usage

Start bot

zway-bot -zway-url=<zway API server url> \
    -zway-user=<zway user name> \
    -zway-password=<zway password> \
    -tg-bot-token='<telegram bot token' \
    -tg-bot-users=<comma separated list of authorized telegram users> \
    -http-addr=<http server addr:port> \
    -bind-locations=<Comma separated bindings of sender's default locations, e.g 'olegator77=cabinet,192.168.1.101=hall'>

Using bot

Just send text phrases to the bot like:

  • turn on lamp in the lounge
  • red illumination in the cabinet
  • green illumination
  • turn off TV in the bedroom
  • heat floor in the bathroom and toilet

Bot will parse phrase, match it with commands, devices and locations titles obtained from ZWay server.

Supported comamnds are:

  • on - turn on the device
  • off - turn off the device
  • run - run scene
  • red/green/yellow/white... - set color to RGB lamp illumination
  • maximum - set maximum level to dimmer
  • lighter - increase dimmer level
  • darker - decrease dimmer level

Control contexts

Bot is remember last devices and locations, and uses them for next commands to last devices or last location. Contexts are binded to commands's sender: telegram nick or IP address of remote host.

E.g: after command turn on dimmer in the cabinet, the next command can be in short form, like just off or maximum. The device dimmer and location cabinet will be used from last context.

Default locations

Bot can use default location of command sender (telegram nick or IP address of remote host). This default location will be used, if command phrase is not contains location name.

zway-bot's People

Contributors

olegator77 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.