- Platform information:
- OS: Ubuntu Server 22.04.4
- openHAB version: 4.2.1
Hi community
I am failing to send an https request. I want to start a machine with the following call:
In browser:
http://192.168.0.132/hh?command=setSmartStart&value=%7B%22starttime%22%3A%200%7D
It works fine in the browser. The call sets the start delay to 0 and the machine starts.
(Side note: The time offset for starting the machine in seconds is {“starttime”: 0} converted it is %7B%22starttime%22%3A%200%7D)
Things file:
Thing http:url:TestMachine "TestMachine" [
baseURL="http://192.168.0.132/",
refresh=15] {
Channels:
Type string : inactiveStatus "Inactive Status" [
stateExtension="ai?command=getDeviceStatus",
stateTransformation="JSONPATH:$.Inactive" ]
Type switch : startMachine "Start Machine" [
commandExtension="hh?command=%2$s",
onValue="setSmartStart&value=%7B%22starttime%22%3A%200%7D",
offValue="setSmartStart&value=%7B%22starttime%22%3A%209999%7D",
mode="WRITEONLY"]
}
Items file:
Switch dishwasher_startMachine "Dishwasher Smart Start" { channel="http:url:TestMachine:startMachine" }
String dishwasherInactiveStatus "Dishwasher Inactive Ready" { channel="http:url:TestMachine:inactiveStatus" }
Rules file:
.....
dishwasher_startMachine.sendCommand(ON)
logInfo(logName, "Dishwasher ON")
....
end
Querying the ‘inactiveStatus’ works perfectly. But the machine is never started by the sendCommand.
It would be great if someone had an idea.
Many thanks,
Michael