Trigger a rule from REST API

I’m managing indoor location from my Android app, and depending on that location, I want openhab to trrigger a set of events, e.g. when I enter my living room, launch TV and switch the lights off.
So I thought of triggering a rule from a REST API call. Is that possible? Or is there another way to do it?


I would do this slightly differently. I would have an item which you can update through the REST API and then have a rule which fires on changes or updates to this item.

That’s a good lead… Is it possible to have a “virtual” item which will handle it?

Yes e.g.

Switch myVirtualSwitch // not bound to any binding
rule "Virtual Switch"
   Item myVirtualSwitch changed
  // do whatever

then do a HTTP POST to myVirtualSwitch with state of ON or OFF.

Great! That’s just what I needed.
Thanks a lot!