### openHAB REST API

openHAB has a REST API to get or set items state.
Read more https://github.com/openhab/openhab/wiki/REST-API
Examples using the openHAB REST API
Get or set the state of an openHAB item as defined in the configuration items file.
This example are using the TinkerForge Bricklets AmbientLight and IO-16.
openHAB Items file
//AmbientLight as Number
Number TF_AmbientLight "Luminance [%.0f lx]" { tinkerforge="uid=mdh" }
//IO-16 Port
Switch outa0 "LED A0" { tinkerforge="uid=gkM, subid=outa0" }
openHAB REST-API URL Commands
AmbientLight get actual measured value = http://192.168.0.30:8080/rest/items/TF_AmbientLight/state
IO-16 Port A0 get state ON or OFF = http://192.168.0.30:8080/rest/items/outa0/state
IO-16 Port A0 set state ON = http://192.168.0.30:8080/rest/items/outa0/ON
IO-16 Port A0 set state OFF = http://192.168.0.30:8080/rest/items/outa0/OFF

Changed: , Category: TinkerForge openHAB, File: T6C267M1991.htm, ID: 1991