node-red-contrib-home-assistant-websocketnode-red-contrib-home-assistant-websocket
Guides
Nodes
FAQ
Cookbook
Scrubber
Discussions
Discord
Github
Guides
Nodes
FAQ
Cookbook
Scrubber
Discussions
Discord
Github
  • Config Nodes

    • Device Config
    • Entity Config
    • Server Config
  • General Nodes

    • Action
    • API
    • Current State
    • Device
    • Events: all
    • Events: calendar
    • Events: state
    • Fire Event
    • Get Entities
    • Get History
    • Poll State
    • Render Template
    • Sentence
    • Tag
    • Time
    • Trigger: state
    • Wait Until
    • Webhook
    • Zone
  • Entity Nodes

    • Binary Sensor
    • Button
    • Entity
    • Number
    • Select
    • Sensor
    • Switch
    • Text
    • Time
    • Update Config

API

The API node provides access to all points of the Home Assistant WebSocket and HTTP API. This enables you to interact programmatically with Home Assistant, sending and receiving data through these protocols. It’s a powerful tool for integrating third-party systems, custom automations, or advanced control within Node-RED, offering full access to Home Assistant's core functionalities.

Config

Protocol required

  • Type: string
  • Values: websocket|http
  • Default: websocket

Protocol to use to access Home Assistant API.

Method

  • Type: string
  • Values: get|post

Type of method to use to access the HTTP endpoint.

Path

  • Type: string
  • Accepts Mustache Templates

URL of the API endpoint.

Params

  • Type: Object
  • Accepts Mustache Templates

A JSON object with key/value pairs that will be converted into URL parameters.

Data

  • Type: Object
  • Accepts Mustache Templates when the data type is JSON

JSON Object to send for WebSocket requests and HTTP posts.

Results

  • Type: string

    Location to save the API results.

Input

All properties need to be under msg.payload.

protocol

  • Type: string
  • Values: websocket|http

Overrides or sets the protocol property of the config.

method

  • Type: string
  • Values: get|post

Overrides or sets the method property of the config.

path

  • Type: string

Overrides or sets the path property of the config.

data

  • Type: Object|string

Overrides or sets the data/params property of the config.

location

  • Type: string

Overrides or sets the results property of the config.

locationType

  • Type: string
  • Values: msg|flow|global

Overrides or sets the results type property of the config.

Output

Value types:

  • results: results of the API request
  • config: config properties of the node

References

  • http api
  • websocket api
Help us improve this page!
Last Updated:
Contributors: Jason, Keir Stiegler
Prev
Action
Next
Current State