node-red-contrib-home-assistant-websocket 0.13.1

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

npm install node-red-contrib-home-assistant-websocket

Build Status Coverage Status

Buy me a coffee

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: This requires Node.js v8.12+ and Node-RED v0.19+.

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.

Under the server node config just check the checkbox for I use Hass.io

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

Migrating

Coming from a different version, e.g. @Ayapejian or @Spartan-II-117?

If you have been using @Ayapejian version there are some breaking changes with two of the nodes. The ‘Poll State’ and ‘Current State’ both have a little different formatted outputs. Check your nodes and make sure they are outputting what you expect. A more in depth example can be found here.

If you have been using the @Spartan-II-117 fork this should be a drop in replacement.


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 with the ability to filter by event type

State Changed Event - websocket

Listens for only state_changed events from home assistant

State Trigger - websocket

Much like the State Changed Node 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 - http

Fire an event on the event bus

Current State - websocket

Fetches the last known state for any entity on input

Get Entities - websocket

Get entities based on search criteria with 3 different output options

Get History - http

Fetches HomeAssistant history on input

Get Template - http

Allows rendering of templates on input

Wait Until - websocket

When an input is received the node will wait until the condition is met or the timeout occurs then will pass on the last received message

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

Node Info

Version: 0.13.1
Updated 1 week, 3 days ago
License: MIT
Rating: 5.0
(7 )

Downloads

60 in the last day
522 in the last week
2787 in the last month

Nodes

  • server
  • server-events
  • server-state-changed
  • trigger-state
  • poll-state
  • api-call-service
  • ha-fire-event
  • api-current-state
  • ha-get-entities
  • api-get-history
  • api-render-template
  • ha-wait-until
  • ha-api

Keywords

  • node-red
  • home-assistant
  • home assistant
  • home automation
  • websocket

Maintainers

  • zachowj