0

What I have seen, the most bindings use "pull" strategy to update Item statuses, like exec binding:

in:  exec="<[<commandLine to execute>:<refreshintervalinmilliseconds>:(<transformationrule>)]"

Or HTTP binding:

in:  http:"<[<url>:<refreshintervalinmilliseconds>:<transformationrule>]"

Updates are based on refresh interval. But what if I need to "push" an event immediatelly from external system (bash script, or another network device)?

Gondy
  • 4,925
  • 4
  • 40
  • 46

1 Answers1

1

This can be approached by using OpenHAB Rest Api

The REST API of openHAB serves different purposes. It can be used to integrate openHAB with other system as it allows read access to items and item states as well as status updates or the sending of commands for items.

In order to send a command to an item, you would use the item uri (http://localhost:8080/rest/items/Temperature_FF_Office) and send an HTTP POST with the according command in the request body as text/plain.

For example, curl utility can be used for pushing command from bash script.

Gondy
  • 4,925
  • 4
  • 40
  • 46