Pass a value from rules engine to a shell command

Hi,

I want to
pass a value (temperature) from within a rule to a shell command. I use this
commandline to execute the command and to send the value to command.

execute.command(
“Uterum-Airconditioner-StatusAirTempToRegistry”, TempUterum );

Also tried
to use just a fixed number as valut to be sure there nothing tricky about the
variable.

execute.command(
“Uterum-Airconditioner-StatusAirTempToRegistry”, 25);

The command
is configured like this:

Name:
Uterum-Airconditioner-StatusAirTempToRegistry

Protocol:
Shell execution protocol

Path:
c:\windows\system32\cscript.exe

Command
parameter: C:\OpenRemote\SetTempValueToRegistry.vbs ${param}

Nothing in
the other fields.

Command is
running but the value from the rules engine is not passed as parameter to the shell
script.

Any ideas?

Hi

I don't recall putting anything in the command parameter field.

Have you tried putting everything you need in the path field, just as you would type it at a command prompt?

Path: c:\windows\system32\cscript.exe c:\OpenRemote\SetTempValueToRegistry.vbs ${param}

Assuming that cscript.exe is the program you're calling, with a .vbs file and your new value?

Hi,

Thanks for your reply Stuart.
I have now also tried your suggestion with the same result. Seems like the ${param} dont work at all.

Is there anyone out there who has been able to make this ${param} work in Openremote running on a Windows installation?

/Nils

Hi Nills,

I’ve had a look at how I’ve setup a param feature for a Linux Script file.

This is what I’ve got.

Screenshot_20190220-082554_Chrome.jpg

Hi,

I have tried several ways to enter the command also
based on how you setup your command, unfortunately without any luck. Seems like
running Openremote on Windows could be different. The parameter is not passed
to the operatingsystem…