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

Current State

This node is used to fetch the last known state of any entity within Home Assistant when it receives an input. It’s useful for making decisions based on the current status of entities, such as checking if a light is already on before turning it off, or determining the temperature reading before adjusting the thermostat.

Configuration

Entity ID required

  • Type: string
  • Accepts Mustache Templates

The id of the entity to return.

If State

  • Type: string

If the conditional statement is evaluated as true send the message to the first output otherwise send it to the second output. If blank there will only be one output.

Also see:

  • Conditionals

For

  • Type: number

The amount of time the entity state needs to have been constant for the "If state" to be true

State Type

  • Type: string
  • Values: string|number|boolean
  • Default: string

Convert the state of the entity to the selected type. Boolean will be converted to true based on if the string is equal by default to (y|yes|true|on|home|open). Original value stored in msg.data.original_state

Block Input Overrides

  • Type: boolean
  • Default: false

Stop msg.payload values from overriding local config

Inputs

payload.entityId

  • Type : string

    Overrides or sets the entity id for which the current state is being fetched

Outputs

Value types:

  • entity: full entity object
  • entity id: entity id of the triggered entity
  • entity state: entity state of the triggered entity
  • config: config properties of the node

References

  • Home Assistant State Objects
Help us improve this page!
Last Updated:
Contributors: Jason, Simon Kaiser, jason
Prev
API
Next
Device