0

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?

  • I'm doing something similar, but automated in Ansible. Blog posts are here: https://andreas.scherbaum.la/blog/categories/67-openHAB - You can probably extract the necessary curl requests from there. – A. Scherbaum Jul 18 '19 at 14:30

2 Answers2

0

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

0

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