Pass a value from rules engine to a shell command

33 views
Skip to first unread message

Nils Jaburek

unread,
Feb 9, 2019, 6:18:32 AM2/9/19
to OpenRemote

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?

Stuart Hanlon

unread,
Feb 11, 2019, 5:31:40 PM2/11/19
to OpenRemote
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?

Nils Jaburek

unread,
Feb 18, 2019, 2:04:54 AM2/18/19
to OpenRemote
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

Stuart Hanlon

unread,
Feb 20, 2019, 3:31:05 AM2/20/19
to OpenRemote
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


Nils Jaburek

unread,
Feb 26, 2019, 1:31:48 AM2/26/19
to OpenRemote

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...

Reply all
Reply to author
Forward
0 new messages