ZWave JS and MQTT

Migrated to the official ZWaveJS addon a while back and it’s awesome, been loving it. I just got a Zooz zse19 siren that needs the SOUND_SWITCH command class. This is implemented in ZWave-JS, but not exposed by the integration. As as far as I can see there is only a service to call the set method in a custom command class. Is there any way to call custom methods in a command class with the official addon? I.e. Is there anyway to send commands directly to the z-wave JS instance that is powering the add-on? or can the ZWave-JStoMQTT add-on be used to interface with the official addon’s z-wave JS instance?

Thanks,
Mark

You can try the set_value service. I think you can at least play a tone, but it doesn’t look like setting the volume is supported using the value API. The only way to do this would be in zwavejs2mqtt with a custom command. https://zwave-js.github.io/zwavejs2mqtt/#/guide/mqtt?id=send-command

I was assuming the set_value service wouldn’t work as the command class doesn’t have a set method : zwave-js - Z-Wave driver written entirely in JavaScript/TypeScript . But I guess I should try it before writing it off completely.

Assuming it doesn’t work, is there a way to expose the zwave-js instance in the official add-on so it can be queried directly? or so that zwave2mqtt could access it allowing both integrations to work side by side? The instructions for zwave2mqtt imply it needs direct access to the usb stick. I definitely don’t want to re-migrate everything to zwavejs2mqtt that I just migrated to the official z-wave addon from openzwave.

Not true, there is a setValue API implemented for the CC. There is no ability to set the volume with the value API though. You can at least play tones.

Sorry, I didn’t pay very good attention and thought you were using the zwavejs2mqtt addon.
HA talks to zwavejs2mqtt or the zwave-js server (zwave-js addon) over a websocket, it doesn’t have the capability to call Javascript directly. Support for the command class API could probably be added to the websocket API, but it doesn’t exist yet.

1 Like

Ah ha, you are right, thanks! I’ll definitely give it a shot. Hopefully it just plays at 100% volume as that’s all I need. Would be awesome if we got a service going to call any method, would at least enable these more complex scenarios temporarily until things are fully implemented.

FYI, this works a treat, setting “toneId” plays the tone once, and setting “defaultVolume” lets you adjust the volume. good enough for now, thanks again.