ich habe das folgende "Thing" definiert, welches über das HTTP-Binding angesprochen wird:
Code: Alles auswählen
Thing http:url:nuki_TR "Nuki Technikraum" [
baseURL="https://api.nuki.io",
authMode="BASIC",
stateMethod="GET",
commandMethod="POST",
contentType="application/json",
headers="Authorization=Bearer <ID>", "key2=value2",
refresh=60] {
Channels:
Type string : state "Status" [ stateExtension="/smartlock/<ID>", stateTransformation="JSONPATH:$.state.state" ]
Type switch : action "Aktion" [
mode="WRITEONLY",
stateExtension="/smartlock/<ID>/action",
onValue="{\"action\": 2}",
offValue="{\"action\": 1}"]
}
Code: Alles auswählen
Switch DO_TR_Aktion "Nuki TR Aktion (Auf / Zu)" { channel="http:url:nuki_TR:action" }
Wenn ich jedoch versuche, den Status des Switchs über eine Rule zu setzten, so passiert nichts.
Code: Alles auswählen
rule "Technikraum auf/zu"
when
Channel "openwebnet:bus_cenplus_scenario_control:F454_000350862992:24:button#1" triggered SHORT_PRESS
then
if (DO_GS_Aktion.state == OFF) {
DO_GS_Aktion.sendCommand(ON)
} else {
DO_GS_Aktion.sendCommand(OFF)
}
end
Bitte um Info, ob ich hier etwas übersehen habe.
Danke!