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
  • Guides

    • Getting Started
    • First Automation
    • Action Node Tips and Tricks
    • Conditionals
    • Mustache Templates
    • JSONata

      • JSONata
      • JSONata primer
    • Output Properties
    • Diagnostics Information
    • Issues Guide
    • Breaking Changes
  • Custom Integration

    • Getting Started
    • Exposed Nodes
  • Contribute to

    • Development
    • Documentation

Issues Guide

This guide explains specific issues that may appear in the Issues tab for various nodes.


State Type Deprecation

The State Type option has been deprecated and will be removed in the version 1.0 release. This guide explains what that means, why it matters, and how to update your flows.

TL;DR — Simple Fix

Note

If you’re seeing a State Type deprecated warning and your node doesn’t use an If State condition or any Output Properties, you only need to update one setting:

  1. Edit the node.
  2. Set State Type to string (from number or boolean).
  3. Save the node and Redeploy your flow. That’s it — the warning will disappear, and your flow will continue to work as before.

Background: What Changed

Previously, the State Type setting automatically converted entity states before they were evaluated or output:

State TypeBehavior
stringNo conversion; the state is treated as a string (e.g., "42", "on", "locked", "true")
numberConverts "42" → 42
booleanConverts to true or false based on Home Assistant State Boolean values (e.g., "on", "open", "locked")

These conversions happened automatically, even before If State conditions or Output Properties were applied.

Now, entity states are always treated as strings unless you explicitly convert them. This makes behavior more predictable and consistent.


Updating “If State” Conditions

If your node uses If State conditions that depended on the old State Type behavior, update them as follows:

  1. Edit the node.

  2. For each If State condition:

    • Set Value Type to number if you want to compare the state as a number.
    • Set Value Type to Home Assistant State Boolean if you want to check whether the state matches one of your configured boolean values.
      • Home Assistant State Boolean comparisons are only available with the in and not in operators.
  3. Save the node and Redeploy your flow.

This ensures your logic continues to work as expected with explicit, type-safe comparisons.


Updating “Output Properties”

You now have full control over how the entity state is cast within Output Properties.

The entity state can be explicitly set to one of the following types:

  • string (default): No conversion is applied; the state remains as text.

  • number: Converts the state to a numeric value.

  • boolean: Converts the state to true or false using standard logic:

    • If the value is already a boolean, it’s used as-is.
    • Numbers: non-zero values become true, and 0 becomes false.
    • Strings: "true" → true, "false" → false, numeric strings like "1" or "42" → true, and "0" → false.
    • Any other or unrecognized value results in false.
  • Home Assistant State Boolean: Converts the state to true if it matches one of the configured true values (e.g., "on", "open", "locked"), otherwise false.


Event Nodes

For event nodes, data in msg.data — including old_state.state and new_state.state — will no longer be converted automatically based on the State Type setting. All state values are now delivered as strings, unless you explicitly convert them elsewhere in your flow.


Summary

BeforeAfter
Automatic state conversion based on State TypeExplicit conversion using Value Type or Output Properties
States may be number or boolean automaticallyStates are always strings by default
Hidden conversions inside nodesTransparent, user-controlled type casting

Recommendation

For best results:

  • Always treat entity states as strings unless your flow explicitly requires numeric or boolean logic.
  • Review any custom nodes or function nodes that expect numeric/boolean states.
  • Use the Value Type and Output Properties options for clarity and maintainability.
Help us improve this page!
Last Updated: 11/11/25, 9:59 AM
Contributors: zachowj
Prev
Diagnostics Information
Next
Breaking Changes