[SOLVED] Can device discovery for Z-Wave in Habmin be implemented by only rest api on /doc/index.html#/?

For zwave device discovey, I know we can go by Habmin.

0 habmin -> configuration -> thing
1 click “+” on top nav bar
2 choose zwave binding -> zwave serial controller
3 in configuration page, click save. also configure serial port.
4 click search left from “+”, choose zwave binding to enter inclusion mode.

I understand the step 4 is same as rest api “post /discovery/bindings/{bindingId}/scan”. But is it possible to do equivalent thing by rest api to replace step 0 - 3 in Habmin?

My understanding is, as a binding, Habmin may use some software interface between openHab and binding which are not expose as rest api. Am I correct to say that?

If that is the case, for those software interface involved in step 0 - step 3 in Habmin, is it big effort to expose them as rest api?

For the issue mentioned above, can some expert suggest something I should look into?

my enviroment is OH2, build #445.

Thank you very much.

No - HABmin uses the REST API as per the ESH documentation.

Hi chris,

I am sorry that my description is not precise.

But as you say ESH REST API, I go here
However, it looks to me more like API instead of REST API.

is the only page with rest in its url.

I really can not find documentation for ESH REST API.
Would you mind share some link for ESH REST API?

And for this ESH REST API, is the usage same as openhab REST API at /dec/index.html, meaning I can use them on another machine/phone to communicate with openHAB server?

It seems me not. I mean, I guess ESH REST API can be used in a openhab binding. But am I correct to say that I can NOT use them if I want to communicate with openHAB server on another machine?

Thank you very much.

The REST documentation is available directly from the OH dashboard.

I don’t know what /dec/index.html is, but yes, the purpose of the REST API is to communicate externally.

Yes - the REST API is designed to allow communication external to the OH system - it is NOT used by bindings at all. You could use it to communicate with another OH server if you wanted, but there are probably better ways of doing this (Depending on your use case) such as using MQTT.

Hi chris,

Thank you very much for your clarification.

I am sorry, it is /doc/index.html on openhab server.

By your information, am I correct to say that, by the rest api in the below page, I can implement the zwave confiugration feature in Habmin for the inclusion mode and exclusion mode?

Thank you very much.

Yes - that’s correct.

hi chris,

thank you for your confirmation.

But I still have some doubt for it.

1 For operation sequence habmin -> configuration -> things -> “+” -> select binding (I select zwave binding here)
After I choose zwave binding, only zwave serial controller pop up in the thing type list. (I plug zwave sticker on usb port).

2 Even more, on step 3 configure thing step of /discovery/bindings/{bindingId}/scan, “zwave:zsticke:1579bf0931d” pop up in UID text box.

Here, it looks to me in both cases, habmin can somehow communicate with the zwave sticker device to get some information.
It does not seems to me that some rest api in doc/index.html can do the same thing. Am I correct to say that?

3 Also after add zwave controller by “add new thing wizard”, we can enter both inclusion mode and exclusion mode.
3.1 to enter inclusion mode, it looks like equivalent to rest api
(POST /discovery/bindings/{bindingId}/scan).
3.2 however, for enter exclusion mode, I guess it should be by another rest api.

If that’s the case, would you mind share some info for that rest api?
I really can not find that specific rest api for exclusion mode.

Thank you very much for your attention.

No - as I’ve already said, the REST API is used by HABmin.

Yes - this is correct for starting a scan. The REST documentation clearly states this -:

Starts asynchronous discovery process for a binding and returns the timeout in seconds of the discovery operation

Thank you very much.
Now I can do the zwave binding scan by rest API as Habmin do.