Hi,
I made a simple integration via rules with BleBox modules, you can find example below. I was thinking about configuring things and dedicated channels (status, on/off, brightness) but I can’t find information on how to define a channel for calling rest api.
rule "Room light"
when
Item L_Room received command
then
var Number brightness = Math::round((L_Room.state as Number * 2.55).floatValue())
val String URL = "http://192.168.0.110/api/dimmer/set"
val String contenttype = "application/json"
var String jsondata = '{"dimmer": {"desiredBrightness": ' + brightness + '}}'
sendHttpPostRequest(URL, contenttype, jsondata)
logInfo("lights.rules", "L_Room brightness set to " + brightness)
end
to:
Thing network:device:dimm1 "Dimmer". [ hostname="192.168.0.110", refresh=3 ] {
Channels:
Type switch : PowerSwitch [ state="api/device/state ???". command="api/dimmer/set ???", on="ON", off="OFF" ].
}
How to generate HttpPostRequest for that?
P.