Hi everyone,
i have a boiler controller from TECH (Polish company) which after some internet digging i found out that i can control it through network sending some curl commands.
So when i send from terminal the command :
But when I get lost in @@s I just create a simple bash script that can be reliably called by an executeCommandLine. So if the above doesn’t work you could try that.
Use sible quote inside the double quotes. Linux is happy with that
No need for @@ instead of spaces. That’s in the binding only.
Add a timeout at the end.
Hi thanks for immidiate replys.
When i try to run the rule i get the error below in the console.
Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "curl 'http://xxx.xxx.xxx.xxx/admin/cgi-bin/edition.cgi' -H 'Authorization: Basic " (in directory "."): error=2, No such file or directory)
when sending the command i realized that at my authorization code i miss some characters.
My auth code is am9obnltMzA6cDQ1NXcwcmQ=\r\n while in the logs it misses \r\n
Ok although i dont have programming skills that would be the easy part, but how i can pass a command to the script.
Right now you can see what i was trying to accomplish with the rules below.
//Set DHW Temp
rule "Set DHW Temp to Boiler"
when
Item SetDHWTemp received command
then
executeCommandLine(" curl 'http://192.168.1.53/admin/cgi-bin/edition.cgi' -H 'Authorization: Basic am9obnltMzA6cDQ1NXcwcmQ=\\r\\n' --data 'st=654_" + receivedCommand + "' -s" , 10000)
end
If there is another way to do it, i would be more than happy to hear it!!!
rule "Send DHW Temp to Boiler"
when
Item DHWSet received command
then
executeCommandLine(" /etc/openhab2/scripts/setdhwtemp" )
end
My temp changes to the value i set to the script (st=654_45)
if i change 45 to 50 it will change my temp to 50.
How can i work this out now, everytime the item DHWSet receives a command (a number i suppose in my example) to be inserted in the script?