Any way to make OH listen for incoming web requests?


is it possible to send http post requests to OH directly, or maybe using a third party web server and a binding in OH?
I’d like to build a rule based on incoming web requests.


Hi, OpenHab have a REST API that enables you to do this and more. Look at

thx, I thought this API can only be used directly on items. like switching an existing / known lamp on and off. but I’d like to send custom commands, like setting a custom variable. as soon as the value for variable has changed, a rule will be triggerd.

Anyway, I’ll have a look :wink:

  1. Create a String/Number item, example:
Number myCustomTriggerItem
  1. Create a rule when that item changes.
rule "myCustomTriggerItem Changed"
	Item myCustomTriggerItem changed
    logInfo("myCustomTriggerItem", myCustomTriggerItem.state)
    // Do logic here based on myCustomTriggerItem.state
  1. Make a REST call to openHAB to update that item
POST to myCustomTriggerItem
  1. Your rule will be triggered.
  2. Do your logic
1 Like

Awesome! will give it a try. This way I should be able to use Google Home via IFTTT (sending the web request). Right? :slight_smile:

EDIT: I answer myself: yes, works like a charm :slight_smile: