Exposing restful API in openHAB2 and event handling

Hi,

I am trying to get events from camera to the openhab2 server. What is the way i can get event data to openhab local server.

I started working on binding development. My camera has configuration like it will call a URL when door is opened. So i want that door opened event to be displayed as status of camera in openHAB(Paper UI) like Home SAFE / NOT SAFE.

I was thinking about is there any way by which openhab can expose API to feed that URL in my camera?

  1. I want to get notified in Paper UI control after API get called by camera.

Thank You
Praveen NL

You mean something like a REST API?

PaperUI is intended to be an administration UI, not a user UI. You should be using BasicUI, ClassicUI, Habmin, or HabPanel for displaying and interacting with this sort of information.

1 Like

Yes.

To expose i am creating/exposing an API in
org.eclipse.smarthome.io.rest

I don’t know this is part of openhab architecture or not. Even i don’t know it is right way to expose API or not.
But i need a openhab REST API to expose and feed it in to controller.

Please suggest if i am wrong.

Having something external like an IP camera update or command Items through the OH REST API is perfectly acceptable and a common approach.

Having OH make HTTP calls to external web services or devices using the HTTP Binding or sendHTTP* actions is also acceptable and commonly used.

1 Like