# home-assistant-telegram-bot

> home-assistant-telegram-bot ----------------

Latest version **1.0.4** (published 2017-06-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install home-assistant-telegram-bot
pnpm add home-assistant-telegram-bot
yarn add home-assistant-telegram-bot
bun add home-assistant-telegram-bot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-06-09 |
| First published | 2017-06-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Matthias Rupp |
| Maintainers | matthinc |

## Links

- npm: https://www.npmjs.com/package/home-assistant-telegram-bot
- Repository: https://github.com/matthinc/home-assistant-telegram-bot
- Homepage: https://github.com/matthinc/home-assistant-telegram-bot#readme
- Issues: https://github.com/matthinc/home-assistant-telegram-bot/issues
- npm.io page: https://npm.io/package/home-assistant-telegram-bot

## Dependencies (3)

- [mustache](https://npm.io/package/mustache.md) ^2.3.0
- [node-rest-client](https://npm.io/package/node-rest-client.md) ^3.1.0
- [node-telegram-bot-api](https://npm.io/package/node-telegram-bot-api.md) ^0.27.1

## Recent versions

- 1.0.4 (latest) — 2017-06-09
- 1.0.3 — 2017-06-09
- 1.0.2 — 2017-06-09
- 1.0.1 — 2017-06-09
- 1.0.0 — 2017-06-07

## README

home-assistant-telegram-bot
----------------

An easy to use framework to create an advanced Telegram chatbot for interaction with Home Assistant

```
npm install home-assistant-telegram-bot
```

```javascript
var Bot = require('home-assistant-telegram-bot').Bot

var bot = new Bot({
    token: '<telegram-bot-token>',
    url: '<home-assistant-url>',
    password: '<home-assistant-password>'
})

bot.on('Temperature', function(chat, hass) {
    chat.send('The temperature is {{sensor.temperature.state}}C')
})

bot.on('Turn light on', function(chat, hass) {
    hass.switch.light.turnOn()
    chat.send('Ok')
})

bot.observeState('sensor.wind', function(state, hass) {
    if (state > 10) {
        bot.sendToAll('It`s windy ({{hass.sensor.wind.state}})')
    }
})
```

---
_Source: https://npm.io/package/home-assistant-telegram-bot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
