Do you want the result from this HTTP request or do you mainly care about just sending the request to cause something to happen?
If you care about the result, you will have to use the the sendHttpGetRequest Action and build up the URL in a Rule.
If you don’t care about the result, the following might work. I’ve never done this so it also might not in which case you will have to use a Rule and sendHttpGetRequest as well.
Right, so you can try the binding example I presented above which uses the String.format notation to split out the six variables and insert them into the URL. You sendCommand the values of the six variables in order.
Or, if that won’t work, you need to have a Rule and build up the URL String and use sendHttpGetRequest.
When I try to declare the Item I get this below error
08:41:54.708 [ERROR] [del.item.internal.GenericItemProvider] - Binding configuration of type 'http' of item 'PanHP' could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: bindingConfig '*:http://192.168.100.145/send_ir_dke.html?power=%1$s&mode=%2$s&fan=%3$s&temperature=%4$s&vswing=%5$s&hswing=%6$s' doesn't contain a valid out-binding-configuration. A valid configuration is matched by the RegExp '(.*?):([A-Z]*):(.*)'
rule "http string"
when
whatever trigger
then
var String httpString = ""
val String number1Str = item1.state.intValue.toString
httpString = "http://192.168.100.145/send_ir_dke.html?power=" + number1Str
val String number2Str = ...
...
val String response = sendHttpGetRequest(httpString)
end
rule "http string"
when
Item Panasonic_RunSet changed
then
var String httpString = ""
val String number1Str = Panasonic_RunSet.state.intValue.toString
httpString = "http://192.168.100.145/send_ir_dke.html?power=" + number1Str
val String response = sendHttpGetRequest(httpString)
end
Do you have any idea what this error is?
09:34:59.554 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'http string': 'intValue' is not a member of 'org.eclipse.smarthome.core.types.State'; line 14, column 29, length 31
rule "http string"
when
Item Panasonic_RunSet changed
then
var String httpString = ""
val String number1Str = Panasonic_RunSet.state.intValue.toString("%d")
httpString = "http://192.168.100.145/send_ir_dke.html?power=" + number1Str
val String number2Str = item2.state.toString("%d)
httpString = httpString + "&mode=" + number2Str
// ...
// Carry on like this with all the other values until your httpString is complete
val String response = sendHttpGetRequest(httpString)
end