Rule executes but doesn't work

Hello!

After researching rules/switches I’ve created a couple of rules that seem to work. That is, they execute a command, but my thermostat isn’t changing.

These are the buttons I’m pushing.

Commented within my rules I have the commands that work from a command prompt.

rule “Hold Disabled”
when
Item Tstat_hold received command 0
then
// command line: curl -d ‘{“hold”:0}’ http://192.168.224.50/tstat
executeCommandLine(“curl -d ‘{"hold":0}’ http://192.168.224.50/tstat”)
end

rule “Hold Enabled”
when
Item Tstat_hold received command 1
then
// command line: curl -d ‘{“hold”:1}’ http://192.168.224.50/tstat
executeCommandLine(“curl -d ‘{"hold":1}’ http://192.168.224.50/tstat”)
end

Watching the monitor connected to the Pi I see the following when clicking the No button.

Tstat_hold received command 0
executed CommandLine ‘curl -d ‘{“hold”:1}’ http://192.168.224.50/tstat

But the thermostat doesn’t change.

Is there something wrong in my command?

Thanks!

Scot

I assume that the command will work from the commandline itself. Maybe you have to use the fullqualifies path to curl like /usr/bin/whatever/curl

Thomas

Yes it works from the command line.

Thanks for the thought on using the full path, gave it a try, but unfortunately it didn’t work.

Hi,

Check this post:

Cheers

THANK YOU!

Changed this:

executeCommandLine(“curl -d ‘{"hold":0}’ http://192.168.224.50/tstat”)

To this:

executeCommandLine(“curl@@-d@@{"hold":0}@@http://192.168.224.50/tstat”)

See this link where I am sending an HTTP POST to the thermostat.