Z-Wave JS value

The Z-Wave JS value condition passes when a Z-Wave value on the selected nodes equals the value you specify. Use it to check a Command Class value directly, including values that Home Assistant does not expose as an entity.

This condition is the counterpart of the Z-Wave value updated trigger. Where that trigger fires on a change, this condition tests the current value.

This condition is useful when:

  • You want to check a Z-Wave value that has no Home Assistant entity.
  • You want to test a specific Command Class, property, property key, or endpoint.
  • A device reports detail in a value that its entity state flattens away.

Using this condition from the user interface

If you prefer building automations visually, Home Assistant walks you through this condition step by step. You pick what to check, tweak a few options, and save. No YAML knowledge required.

To use Z-Wave JS value in an automation:

  1. Go to Settings > Automations & scenes.
  2. Open an existing automation, or select Create automation > Create new automation.
  3. In the And if section, select Add condition.
  4. Search for Z-Wave JS value and select it.
  5. Under Devices (see Selecting nodes), pick the Z-Wave devices whose nodes you want to check.
  6. Under Command class, pick the Command Class of the value.
  7. Under Property, enter the property of the value, and under Value, enter the value to compare with.
  8. Optionally set Property key and Endpoint.
  9. Under Condition passes if (see Behavior with multiple nodes), choose how multiple nodes should combine. The default is Any.
  10. Select Save.

Options in the UI

Devices

The Z-Wave devices whose nodes to test. Select one or more.

Command class

The Command Class of the Z-Wave value.

Property

The property of the Z-Wave value.

Value

The value to compare with, either the raw value or its state label.

Property key

The property key of the Z-Wave value, for values that have one.

Endpoint

The endpoint of the Z-Wave value.

Condition passes if

When several nodes are selected, controls how results combine:

  • Any: passes if at least one node matches (default).
  • All: passes only when every node matches.

Using this condition in YAML

If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required.

In YAML, refer to this condition as zwave_js.value. A basic example looks like this:

ConditionConditions check whether something is true at that moment, for example, whether a door is closed. You can use them in automations and scripts. If a condition is not met, the actions that come after it in the same sequence do not run. At the top level of an automation or script, this stops the automation or script. [Learn more]
condition: zwave_js.value
options:
  device_id: 45d7d3230dbb7441473ec883dab294d4
  command_class: 98
  property: currentMode
  value: "Unsecured"

This passes when the Door Lock Command Class reports the lock as unsecured.

To require every listed node to match, and to select a value that has a property key and an endpoint:

ConditionConditions check whether something is true at that moment, for example, whether a door is closed. You can use them in automations and scripts. If a condition is not met, the actions that come after it in the same sequence do not run. At the top level of an automation or script, this stops the automation or script. [Learn more]
condition: zwave_js.value
options:
  device_id:
    - 45d7d3230dbb7441473ec883dab294d4
    - 8f4219cfa57e23f6f669c4616c2205e2
  command_class: 51
  property: currentColor
  property_key: 0
  endpoint: 0
  value: 255
  behavior: all

Options in YAML

condition string Required

The condition type. For this condition, use zwave_js.value.

device_id string | list Required

One or more device IDs of the Z-Wave devices whose nodes to test.

command_class integer Required

The numeric ID of the Command Class of the Z-Wave value.

property string | integer Required

The property of the Z-Wave value.

value string | integer | boolean | float Required

The value to compare with, either the raw value or its state label.

property_key string | integer (Optional)

The property key of the Z-Wave value.

endpoint integer (Optional)

The endpoint of the Z-Wave value.

behavior string (Optional, default: any)

When several nodes are selected, controls how results combine:

  • any (Any in the UI, default): passes if at least one node matches.
  • all (All in the UI): passes only when every node matches.

Selecting nodes

A Z-Wave node is represented in Home Assistant as a device, so this condition selects nodes with a device picker rather than a target. Pick one or more Z-Wave devices, and the condition tests the node behind each one.

Behavior with multiple nodes

When you select more than one device, the Condition passes if option controls how the results combine:

  • Any (default): the condition passes if at least one node’s value matches.
  • All: the condition passes only when every node’s value matches.

Good to know

  • Property names, property keys, and Command Class IDs come from Z-Wave JS. Refer to the Z-Wave JS documentation for the available values.
  • A value with named states can be compared either by its raw value or by its state label, for example 0 or "Unsecured". The raw value written as a string, such as "0", also matches.
  • A property key of 0 is a real key, for example a Color Switch component, and is not the same as leaving the property key out.
  • The condition is rejected when it is saved if none of the selected nodes has the value at all, so a typo in the Command Class or property surfaces immediately rather than silently never passing.
  • A node that does have the value but with a different reading simply does not match.
  • The condition does not pass when none of the selected devices resolve to a Z-Wave node. A device that no longer resolves counts as unresolved and makes All fail.

Try it yourself

Ready to test this? Go to Settings > Automations & scenes, open an automation, and add this condition. Trigger the automation with and without the condition met, and watch whether it continues or stops.

More examples

Real scenarios where this condition gates an automation. Copy any example and adapt it to your setup.

Tip

You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.

Automation: only close the garage if the latch reports closed

  • Trigger: Time: 23:00
  • Condition: Z-Wave JS value
    • Devices: Garage door lock
    • Command class: 98 (Door Lock)
    • Property: latchStatus
    • Value: closed
  • Action: Send a notification message
YAML example for checking a Z-Wave value
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Confirm the latch is closed at night"
triggers:
  - trigger: time
    at: "23:00:00"
conditions:
  - condition: zwave_js.value
    options:
      device_id: 45d7d3230dbb7441473ec883dab294d4
      command_class: 98
      property: latchStatus
      value: "closed"
actions:
  - action: notify.send_message
    target:
      entity_id: notify.my_device
    data:
      message: "The front door latch is closed for the night."

Still stuck?

The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the condition you’re using and what you expected to happen, or share on our subreddit /r/homeassistant.

Tip

AI assistants like ChatGPT or Claude can also explain conditions or suggest the right one when you describe what you want in plain language.

Related conditions

Explore related conditions: