Device IDs as script parameters: "No zwave_js nodes found for given target"

I’m really embarrassed to not solve this myself, but my google-fu is failing. I’m certain it’s a simple solve for someone who has been here before but I’m at a loss.

I want to use a script to send notifications to inovelli lights and use a parameter to identify the target. I’m getting the error “No zwave_js nodes found for given target” when I’m trying to run the script, either independently (relying on the default value) or through an automation attempting to pass data parameters.

If I remove the field and hard-code the ID, the script works exactly as expected. So my problem is clearly some syntax, formatting, organization issue with the YAML for the script.

Doesn’t work:

fields:
  device_id:
    name: Device Id
    default: ce20880c2045741585f1ef3c41678529
    description: Device ID to update notification
sequence:
  - service: zwave_js.set_config_parameter
    data:
      parameter: "99"
      value: "255"
      bitmask: FF
    target:
      device_id: "{{ device_id }}"
  - service: zwave_js.set_config_parameter
    data:
      parameter: "99"
      value: "100"
      bitmask: FF00
    target:
      device_id: "{{ device_id }}"
  - service: zwave_js.set_config_parameter
    data:
      parameter: "99"
      value: "128"
      bitmask: FF0000
    target:
      device_id: "{{ device_id }}"
  - service: zwave_js.set_config_parameter
    data:
      parameter: "99"
      value: "2"
      bitmask: FF000000
    target:
      device_id: "{{ device_id }}"
mode: single

Does work:

sequence:
  - service: zwave_js.set_config_parameter
    data:
      parameter: "99"
      value: "255"
      bitmask: FF
    target:
      device_id: ce20880c2045741585f1ef3c41678529
  - service: zwave_js.set_config_parameter
    data:
      parameter: "99"
      value: "100"
      bitmask: FF00
    target:
      device_id: ce20880c2045741585f1ef3c41678529
  - service: zwave_js.set_config_parameter
    data:
      parameter: "99"
      value: "128"
      bitmask: FF0000
    target:
      device_id: ce20880c2045741585f1ef3c41678529
  - service: zwave_js.set_config_parameter
    data:
      parameter: "99"
      value: "2"
      bitmask: FF000000
    target:
      device_id: ce20880c2045741585f1ef3c41678529
mode: single

I’m at sea here, really appreciate any assistance.

You might have an easier time using an existing script. If your goal is to figure it out, I’d start with the trace and see what it’s calling. You might need a {{ device_id | string }} filter or it might be an issue with how you’re defining the variable before it’s passed to the script. I didn’t use that method in my script, otherwise I might be able to help more.