EXEC binding not executing net rpc command (works via ssh)

Hi,

Question pls, i installed the EXEC Binding from the default bindings list on my openhab 2.5 RPI3.

Added manually a thing:

Thing exec:command:pcsleep [command="net rpc shutdown -I 192.168.1.20 -U USERNAME%PASSWORD -f", interval=0, timeout=5, autorun=false]

And added an Item:

Switch pcsleep "pc sleep" (Home, Scene) { channel="exec:command:pcsleep:run" }

But when using my switch nothing seems to happend and i see this in my logs:

2020-02-08 14:30:46.934 [ome.event.ItemCommandEvent] - Item 'pcsleep' received command ON

2020-02-08 14:30:46.941 [nt.ItemStatePredictedEvent] - pcsleep predicted to become ON

2020-02-08 14:30:46.971 [vent.ItemStateChangedEvent] - pcsleep changed from OFF to ON

2020-02-08 14:30:46.982 [ERROR] [ng.exec.internal.handler.ExecHandler] - An exception occurred while formatting the command line with the current time and input values : 'o != java.util.Date'

2020-02-08 14:30:46.994 [vent.ItemStateChangedEvent] - pcsleep changed from ON to OFF

`tried my command via SSH command line, this works without an issue:

net rpc shutdown -I 192.168.1.20 -U USERNAME%PASSWORD -f

Am i overlooking something?

Thx.

It’s usually a permissions thing. Have a look at any recent exec binding thread for help on obtaining more info and dealing with it.

1 Like

Here’s a good place to start:

1 Like

@rossko57 & @H102 thanks for the input , this got me in the right direction :slight_smile:

my issue was the transform option not installed for REGEX.

secondaly having USERNAME%%PASSWORD instead of USERNAME%PASSWORD in my command.

Works perfectly now.

Thank you both!

1 Like