Giter Club home page Giter Club logo

hubot-home-assistant's Introduction

Hubot Home Assistant

npm version Build Status

๐Ÿ’ฌ ๐Ÿก A Hubot module for interacting with Home Assistant via chat.

๐Ÿšจ DEPRECATED

This repository is deprecated, unmaintained and archived.

Installation

In hubot project repo, run:

npm install hubot-home-assistant --save

Then add hubot-home-assistant to your external-scripts.json:

[
  "hubot-home-assistant"
]

Configuration:

Variable Required? Description
HUBOT_HOME_ASSISTANT_HOST Yes The URL for your Home Assistant instance, e.g. https://demo.home-assistant.io or http://hassio.local:8123.
HUBOT_HOME_ASSISTANT_API_TOKEN Yes The long-lived access token for a Home Assistant user.
HUBOT_HOME_ASSISTANT_MONITOR_EVENTS No If set to any value, whether to monitor for events
HUBOT_HOME_ASSISTANT_MONITOR_ALL_ENTITIES No If set to any value, whether to monitor all entities for status changes
HUBOT_HOME_ASSISTANT_EVENTS_DESTINATION No Which room/channel/chat to send events, e.g. #homeassistant or @alice; default: #home-assistant

Upgrading from v1.x?

The HUBOT_HOME_ASSISTANT_API_PASSWORD environment variable has been replaced by the HUBOT_HOME_ASSISTANT_API_TOKEN. You can obtain your long-lived access token in your v0.77+ instance of Home Assistant by clicking on your user icon in the navigation, scrolling to the section titled "Long-Lived Access Tokens," and clicking the "Create" button.

Read more about long-lived access tokens.

Commands:

List all entities

Returns the current state of the entity. Note that it uses the hidden attribute flag to reduce this list. It will also exclude Views and Zones.

<alice> hubot hass list
<hubot> sun.sun: Sun; camera.office: Office; camera.den: Den; group.commute: Commute; group.climate: Climate; ...

Get the state of an entity

Returns the current state of the entity.

<alice> hubot hass state of Living Room Downlights
<hubot> @alice Living Room Downlights is off (since 2 hours ago)

Toggle an entity on or off

Turn the entity on/off.

<alice> hubot hass turn Living Room Downlights on
<hubot> @alice Living Room Downlights turned on

Set an entity to a desired state

Set the entity state to the given value.

<alice> hubot hass set Bob's iPhone to home
<hubot> @alice Setting Bob's iPhone to home
<hubot> @alice Bob's iPhone set to home

Streaming Capabilities

In addition to directly interacting with Home Assistant, this package will allow you to stream entity status changes (e.g. turn a light on, home temperature rises, etc.) into a room/channel/user of your choice.

  1. Set HUBOT_HOME_ASSISTANT_MONITOR_EVENTS to any value to enable streaming.
  2. Set HUBOT_HOME_ASSISTANT_EVENTS_DESTINATION to where you want the messages to be seen. By default, they will go to a channel/room called #home-assistant.
  3. Restart your Hubot

Option 1 - Monitor Everything

Note that Home Assistant will send a lot of change events throughout the day if you have several components configured. For example, if you have a thermostat configured, it will send an event for every detected temperature change.

  1. Set HUBOT_HOME_ASSISTANT_MONITOR_ALL_ENTITIES to any value.
  2. Restart your Hubot

Option 2 - Monitor Specific Devices

  1. Ensure that HUBOT_HOME_ASSISTANT_MONITOR_ALL_ENTITIES is not set in the configuration.
  2. Update your Home Assistant configuration under the customize, customize_domain or customize_blob key to include the hubot_monitor: true attribute. See documentation for more details.
  3. Restart your Hubot

Examples:

homeassistant:

  #...

  # Set a specific device to monitor
  customize:
    climate.my_ecobee3:
      hubot_monitor: true

  # Monitor all devices in a particular domain
  customize_domain:
    alarm_control_panel:
      hubot_monitor: true
    light:
      hubot_monitor: true

  # Monitor devices matching a pattern
  customize_blob:
    "device_tracker.*_iphone":
      hubot_monitor: true

hubot-home-assistant's People

Contributors

frenck avatar robbiet480 avatar stephenyeargin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hubot-home-assistant's Issues

Add support for long-lived tokens

The api password is deprecated in Home Assistant. It's recommended now to use long-lived access tokens. The homeassistant package supports this already.

Getting Hubot Home-Assistant running with XMPP

Hey guys. Nice wrk. I just was wondering how to make it running to send messages and states to an XMPP account.

If any help out there.. Highly appreciated . I installes hubot with xmpp adapter but get these errors:

[Thu Dec 29 2016 16:48:20 GMT+0000 (UTC)] ERROR [xmpp error]<message from="[email protected]" to="[email protected]/75955050861423988841483030073555935" type="error" xmlns:stream="http://etherx.jabber.org/streams"><body>VLC Player is idle (was idle for 5 hours)</body><error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">User session not found</text></error></message>

cannot install - getting 404 from registry

Thats what i get when i try to install hubot-home-assistant in the npm logs:
18 http request GET https://registry.npmjs.org/hubot-home-assistant
19 http 404 https://registry.npmjs.org/hubot-home-assistant

if you try to browse the url thats what you get: {}

thats what im getting in the console:

root@raspberrypi:~/hubot-home-assistant# npm install hubot-home-assistant --save
npm ERR! Linux 4.4.38-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "hubot-home-assistant" "--save"
npm ERR! node v4.2.1
npm ERR! npm v4.0.5

npm ERR! Cannot convert undefined or null to object
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /root/hubot-home-assistant/npm-debug.log

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.