{"id":48769,"library":"node-red-contrib-home-assistant-websocket","title":"node-red-contrib-home-assistant-websocket","description":"A Node-RED package that integrates Home Assistant via WebSocket and REST API, enabling automation flows within Node-RED. Version 0.80.3 requires Node-RED 3.1.1+, Node.js 18.2.0+, and Home Assistant 2024.3+. It provides dedicated nodes for triggering automations, calling services, and managing entities. This package is the de facto solution for Home Assistant automation in Node-RED, offering tighter event-driven integration compared to generic HTTP nodes.","status":"active","version":"0.80.3","language":"javascript","source_language":"en","source_url":"https://github.com/zachowj/node-red-contrib-home-assistant-websocket","tags":["javascript","node-red","home-assistant","home assistant","home automation","websocket"],"install":[{"cmd":"npm install node-red-contrib-home-assistant-websocket","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-contrib-home-assistant-websocket","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-contrib-home-assistant-websocket","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"WebSocket client for communication with Home Assistant","package":"ws","optional":false},{"reason":"TypeScript library for Home Assistant WebSocket API","package":"home-assistant-js-websocket","optional":false}],"imports":[{"note":"This is a Node-RED module; it must be installed and nodes are added via the palette. No direct JavaScript/TypeScript import.","wrong":"const Server = require('node-red-contrib-home-assistant-websocket');","symbol":"Server","correct":"Use the config node in Node-RED UI, no import needed"},{"note":"Nodes are used within Node-RED flows, not imported programmatically.","wrong":"import { haWebSocket } from 'node-red-contrib-home-assistant-websocket';","symbol":"HA WebSocket node","correct":"Add 'ha-websocket' node from the palette in Node-RED"}],"quickstart":{"code":"// This package is a Node-RED module, not a library for programmatic use.\n// To use:\n// 1. Install Node-RED (>=3.1.1)\n// 2. Run: cd ~/.node-red && npm install node-red-contrib-home-assistant-websocket\n// 3. Restart Node-RED\n// 4. Add a 'server' config node with your Home Assistant details\n// 5. Use 'ha-websocket' nodes in your flows","lang":"javascript","description":"Shows how to install and configure the package in Node-RED."},"warnings":[{"fix":"Update Node.js to >=18.2.0","message":"Minimum Node.js version raised to 18.2.0","severity":"breaking","affected_versions":">=0.80.0"},{"fix":"Update Node-RED to >=3.1.1","message":"Minimum Node-RED version raised to 3.1.1","severity":"breaking","affected_versions":">=0.80.0"},{"fix":"Update Home Assistant to >=2024.3","message":"Minimum Home Assistant version raised to 2024.3","severity":"breaking","affected_versions":">=0.80.0"},{"fix":"Generate a token from HA UI or use the add-on checkbox if running in HA add-on","message":"Config node requires a long-lived access token generated from Home Assistant UI (Profile > Long-Lived Access Tokens) or using the add-on checkbox","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.80.3':30 '18.2.0':37 '2024.3':41 '3.1.1':35 'api':21 'assist':6,16,40,63,86,88 'autom':23,48,64,90 'call':49 'compar':75 'contrib':4 'de':58 'dedic':44 'driven':73 'enabl':22 'entiti':53 'event':72 'event-driven':71 'facto':59 'flow':24 'generic':77 'home':5,15,39,62,85,87,89 'home-assist':84 'http':78 'integr':14,74 'javascript':80 'manag':52 'node':2,10,27,33,45,67,79,82 'node-r':9,26,32,66,81 'node-red-contrib-home-assistant-websocket':1 'node.js':36 'offer':69 'packag':12,55 'provid':43 'red':3,11,28,34,68,83 'requir':31 'rest':20 'servic':50 'solut':60 'tighter':70 'trigger':47 'version':29 'via':17 'websocket':7,18,91 'within':25","created_at":"2026-06-07T16:58:22.073912+00:00","updated_at":"2026-06-07T16:58:22.073912+00:00","problems":[{"fix":"Run 'npm install ws' in the Node-RED user directory (~/.node-red)","cause":"Missing 'ws' dependency","error":"Error: Cannot find module 'ws'"},{"fix":"Verify the access token and Home Assistant URL in the config node","cause":"Incorrect token or server URL in the Home Assistant server config node","error":"Error: socket hang up"},{"fix":"Ensure the entity_id exists and use a 'currentState' node or wait for the message payload","cause":"Trying to access entity state before the message is fully received or the entity doesn't exist","error":"TypeError: Cannot read properties of undefined (reading 'state')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://zachowj.github.io/node-red-contrib-home-assistant-websocket/","github":"https://github.com/zachowj/node-red-contrib-home-assistant-websocket","docs":null,"changelog":null,"pypi":null,"npm":"node-red-contrib-home-assistant-websocket","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}