1.0.4 • Published 7 years ago

home-assistant-telegram-bot v1.0.4

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

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
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}})')
    }
})
1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago