user9409752
user9409752

Reputation:

How to add devices using openHAB REST API

I am looking for a way to discover a USB zstick "/dev/ttyACM0" using OpenHab command line interface as I am not going to be using a GUI and I need to create a script to automate few things.

In their website here and here OpenHab have some documentation, and that's what I found for discovery:

GET /discovery POST /discovery/bindings/{bindingId}/scan

however I was unable to make that into a useful curl command. any idea on where to start?

Upvotes: 0

Views: 506

Answers (2)

Felix Schneider
Felix Schneider

Reputation: 11

I don't know if adding devies through REST is possible. If so you can find it in the REST Documentation. If it doesn't work though the REST API you might want to write a small bash script which adds the things you want. Then you can call your script with executeCommandLine in a rule

Upvotes: 0

J. Luckenbach
J. Luckenbach

Reputation: 71

I would suggest to try out the REST Documentation, for finding the right endpoint/expression.

You can install it through paper ui: paper ui view for the rest docs addon

It will then be available through <YOUR_OH_IP>:<PORT>/doc/index.html. It provides some ui with explanations and examples for the endpoints and you can test them live through it. This should help you find the correct rest call to use with curl afterwards.

Overview of rest docs addon page

Upvotes: 0

Related Questions