Adding a USB device using the command line interface

Hello,

I am not able to find a runtime command to add a USB zwave stick.

I usually add zwaves devices that connect to the stick using a command similar to this "discovery start zwave " however I am unable to do the same for the USB z stick. I tried the following without success “discovery start /dev/ttyACM0”

I used /dev/ttyACM0 because that’s what works for me when I do it through paperUI

any idea?

It’s important to understand how the leave binding works. The USB zwave controller is not discoverable by OH. You must manually create a zwave serial Thing and provide it with the path to the USB device.On Linux, that path will be /dev/ttySomething.

Once you have the zwave serial Thing defined, the devices paired with the controller can be discovered.

Thanks, can you please explain how I can manually create a zwave serial Thing? I am kinda lost there.

You can create a Thing for the controller in a .things file, but it is (IMO) much easier to just add one in Paper UI. In the Inbox, click the blue button with the plus sign, then select the Zwave binding. Discovery will start, but it won’t find the controller. At the bottom of the page, you can select ‘Add Manually’. Click the Z-Wave Serial Controller and configure it. After you’ve created the controller and it is online, go back to the inbox and click the blue button again to discover all existing devices that have already been included into the network managed by that controller.

I am not having any issues doing it using PaperUi, but for my project I need to automate few things and Paper UI won’t be useful to me. I am not using a GUI anyway.

You’ll need to read through this then to add the controller to a .things file…

Why is advanced user documentation like this not included or at least linked to in the official documentation?

You may volunteer … Seriously, not snark.

You can add Things using REST API (this what PaperUI does)

Does the PaperUI do all its OH management through the API?

I am starting small. I am waiting to test my first zwave entry.

I am not a Java person but anyone with free time can do documentation. Unfortunately busy times at work have limited my free time.

I notice most of the documentation and focuses on the text files. I guess that is due to time constraints and the preference to replace the PaperUI with a different interface.

Partly historic, but also a lot easier to document concisely.

Yes.

1 Like

where can I find the API resources? I looked everywhere without success.

From the Add-ons -> UIs tab in PaperUI you can install the REST API Docs. This is an interactive guide that documents and allows you to exercise the REST API. When you do exercise the API, it shows you the equivalent curl command to do what you just did.

If you are on a recent snapshot, the REST API Docs are currently broken so you will need to be running on an earlier version of OH (e.g 2.5 M1). There is already an issue open and it is expected to be fixed quickly.

2 Likes

@rlkoshak Thanks a lot, that was very helpful, I was able to get the job done and I am sure this will take care of other things I needed to do next.