Discover new device and adding to Sitemap in api rest

  • Platform information:
    • Hardware: Rasberry PI 4
    • OS: openHABian
    • Java Runtime Environment: OpenJDK Java 8
    • openHAB version: 1.5
  • Issue of the topic: Discovery API REST

Hi!
I want use rest api to discover and adding sensor to sitemap, without use UI.

I have read this

and I found API rest “discover” in the REST api.

but how to autorize device “discovered” and adding it in the sitemap?

Thanks

You need to add the items (manually) to your sitemap file. See https://www.openhab.org/docs/configuration/sitemaps.html

can i can new device but i can’t adding it to sitemap on rest api?

Not that I am aware of, you need to manually create this file. I can post an example if needed. How many items do you have?

3 items for now.
but the number is variable.

i 'm writing an app for controling openhub in remote only in rest (i can’t use openhab UI).

i need to adding discovered item in authorized list and see them in sensor list

i can do it with rest API?

thanks for help

You can’t use BasicUI, ClasicUI then why a sitemap?

I seemed to understand that the list of items is the sitemap.:thinking:

When you open a browser and enter http://your_servers_IP_address:8080/start/index what do you see?

i see openhub select interface (basic - ecc)

So you see BasicUI as a selection. This will be empty until you create the sitemap file and add your items.

Currently, the sitemap is a file, not accessible directly from the REST API for editing.

1 Like

Thanks Bruce.
That was what I was trying to say/explain.:laughing: Just have a hard time explaining with text sometimes.:upside_down_face:

1 Like

@luca-parlapiano also in PaperUI > Configuration > Addons > User Interfaces you will need to install BasicUi or whatever UI you prefer. BTW, BasicUI is a good starting point.:wink:

i can’t use UI only api rest.
All right nothing sitemap :slight_smile:

but thanks for help :blush:

I have seen this api in rest page:
http://demo.openhab.org:8080/doc/index.html#/

with this api i can create ad item

PUT /items/createOrUpdateItem
(http://demo.openhab.org:8080/doc/index.html#!/items/createOrUpdateItem)

widh this call i can add sensor?

Install the REST API docs add-on. The answer to all your questions are documented there.

1 Like

now i’m reading it, but i need some test.

Thanks at all for help !!