i might have not configured my openhab for a while and might have to forgot something basic.
I have had a couple of homepilot rolershutters inegrated with a HTTP binding. Now i upgraded the firmware of the HP - and the interface changed. Grrr.
A bit of “F12” in google chrome and some trying and i know i can control a sutter with a
curl -X PUT -d '{"name":"GOTO_POS_CMD","value":"35"}' http://homepilot/devices/10001
So:
hostame resolves (i run it on my OH machine)
no auth needed
no fancy header or tokeneither
Now i want to setup a mathcig http binding correctly. No, i do not want se excec, since i will poll the status of all rollershutters every minute, and therefore like to have the caching…
In the HTTP binding, the colon character : is used as a parameter separator.
So you have to hide any colons included in your plain text by URL encoding as %3A.
There’s a problem with that though … % is itself an escape character. So you have to escape the %3A and use %%3A
There might be another way to escape with \ but I don’t know it.
I think you might need to URL encode your curly braces too.
In case somebody finds this lokking for HomePilot integration: My solution with the latest Firmware for HP (5.0.xx). Thanks to @rossko57 for directing my nose to the working solution…
//send updates to Home Pilot
rule "GetRollershutterUpdate"
when
Member of GRollAll received command
then
logDebug("rolershutter","rolershutter " + triggeringItem.name + " recieved update" + receivedCommand )
var String myUrl = ""
switch(triggeringItem.name) {
case "RollladenWZSL": { myUrl = "http://homepilot/devices/10001"}
case "RollladenWZSR": { myUrl = "http://homepilot/devices/10002"}
case "RollladenWZSML": { myUrl = "http://homepilot/devices/10004"}
case "RollladenWZSMR": { myUrl = "http://homepilot/devices/10005"}
case "RollladenWZWR": { myUrl = "http://homepilot/devices/10006"}
case "RollladenWZWL": { myUrl = "http://homepilot/devices/10007"}
case "RollladenSZR": { myUrl = "http://homepilot/devices/10008"}
case "RollladenSZL": { myUrl = "http://homepilot/devices/10009"}
case "RollladenSZA": { myUrl = "http://homepilot/devices/10010"}
}
var String myData = '{"name":"GOTO_POS_CMD","value":"' + receivedCommand + '"}'
logDebug("rolershutter","Sending put "+ myData + " to " + myUrl)
sendHttpPutRequest(myUrl, "application/x-www-form-urlencoded", myData)
end