Skip to content

thejta/node-red-contrib-home-assistant-websocket

 
 

Repository files navigation

Node Red Contrib Home Assistant Websocket

Build Status Coverage Status Greenkeeper badge

Various nodes to assist in setting up automation using node-red communicating with Home Assistant.

Project status

Project is going through active development and as such will probably have a few 'growing pain' bugs as well as node type, input, output and functionality changes. At this stage backwards compatibility between versions is not a main concern and a new version may mean you'll have to recreate certain nodes.

Getting Started

This assumes you have node-red already installed and working, if you need to install node-red see here

NOTE: node-red-contrib-home-assistant-websocket requires node.JS >= 8.12.0. If you're running Node-Red in Docker you'll need to pull the -v8 image for this to work.

Install via Node-RED Manage Palette

node-red-contrib-home-assistant-websocket

Install via npm

$ cd ~/.node-red
$ npm install node-red-contrib-home-assistant-websocket
# then restart node-red

For Hass.io add-on users:

The Community Hass.io add-on ships with this node right out of the box.

Use the Hass.io API Proxy address http://hassio/homeassistant as the Home Assistant server address (Base URL, which is the default on installing the add-on the first time). The access token field can be left empty as the plugin will fill it in with the HASSIO_TOKEN when you deploy your flows.

The add-on can be found here: https://github.com/hassio-addons/addon-node-red#readme

======= For flow examples checkout the flows here


Included Nodes

The installed nodes have more detailed information in the node-red info pane shown when the node is selected. Below is a quick summary

All Events - websocket

Listens for all types of events from home assistant

State Changed Event - websocket

Listens for only state_changed events from home assistant

State Trigger - websocket

Much like the State Changed Ndoe however provides some advanced functionality around common automation use cases.

Poll State - websocket

Outputs the state of an entity at regular intervals, optionally also at startup and every time the entity changes if desired

Call Service - websocket

Sends a request to home assistant for any domain and service available ( light/turn_on, input_select/select_option, etc..)

Fire Event - rest api

Fire an event on the event bus

Get Current State - websocket

Fetches the last known state for any entity on input

Get History - rest api

Fetches HomeAssistant history on input

Get Template - rest api

Allows rendering of templates on input

Development

Check out the wiki page for setting up an environment with Home Assistant/Node Red.

Development Wiki

Authors

List of all authors and contributors

Acknowledgments

About

Node-RED integration with Home Assistant through WebSocket and REST API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 51.9%
  • HTML 47.4%
  • Dockerfile 0.7%