[feature request] add an API to execute arbitrary Z-Wave commands

Basically I just want to be able do what is possible using the zwavejs2mqtt add-on as mentioned here: https://github.com/zwave-js/zwavejs2mqtt/issues/336

Example of what is done with the mqtt add-on:

Ok so the args could be in this case [1, 0, <value>] (air temperature, celsius, the value).

Topic: zwavejs/_CLIENTS/ZWAVE_GATEWAY-<yourName>/api/sendCommand/set

Payload:

{ "args": [
  {
    "nodeId": 4,
    "commandClass": 49,
    "endpoint": 0,
    "property": "Air temperature"
  }, 
  "sendReport",
  [1, 0, <value>]
  ]
}

Tldr: Should be able to send commands to nodes, so we can have external temperature displayed on zwave thermostats for example. Really don’t want to have to rename all my entities switching to zwavejs2mqtt just to get this one function.

Should be exposed as a service call or something, but I don’t think it’s possible in the standard zwavejs add-on.

Not a response to your feature request, but this comment:

Switching to zwavejs2mqtt doesn’t do anything to your entities, everything is preserved. If you switch you can continue to use the integration as you are now, and also enable MQTT for other functionality like this. If you don’t want to wait, it could at least tide you over until (if ever) this feature is added.

You can use this functionality with the official addon, but it requires accessing the websocket API directly, using the endpoint.invoke_cc_api command. Not for the feint of heart.

1 Like

Hmm… I tried switching over and it made new entities for me, so I restored from a VM snapshot. I was assuming this is because you have to re-add the integration. But I may have missed a step. I might try again to see if it behaves itself on a second try (it’s hard to find time to test things in a live environment with a family running around). I read through the ZwaveJS page and in the FAQ it shows:

CAN I SWITCH BETWEEN THE OFFICIAL Z-WAVE JS ADD-ON AND Z-WAVE JS TO MQTT?

You can, but you cannot run them at the same time. Only one of them can be active at the same time.
When you switch add-ons, re-add the Z-Wave integration to Home Assistant with the new/updated WebSocket URL.

It’s possible I just misunderstood what they meant by that?

Yes. It never says remove the integration. “Re-add” is literal, click the + button to add the integration again without removing it, using the new URL. Uncheck the supervisor checkbox.

1 Like

Thanks! Fingers crossed it works when I try it again.

Side note: Not to crap on the great work everyone’s done (and are still doing), but dang the documentation and processes for managing things is definitely not consistent or intuitive across the platform. For example, your extra sentence would’ve made those instructions 100% clearer.

Got it working with zwavejs2mqtt. Now I just have to write the logic to update the temperature in real-time!

These instructions made the process to switch over super easy:

Confirmed working with a service call:

service: mqtt.publish
data:
  topic: zwave/_CLIENTS/ZWAVE_GATEWAY-mosquitto/api/sendCommand/set
  payload: >-
    { "args": [
      {     
        "nodeId": 35,     
        "commandClass": 49,     
        "endpoint": 0,     
        "property": "Air temperature"   
      },    
      "sendReport",   [1, 0, 33]   
      ] 
    }