Passing parameters to a script

Or don’t use netcat and use curl…

Dont think curl works, its not HTTP

Seems its started not working again, the KDS_Command isnt updating when setting the switch to off. If I reboot the system it works again.

It seems theres something wrong with the OH rule engine?? Very odd. Infact, ALL rules stop working.

It’ll depend on which version of netcat you’re using, but try adding a -c, which should close the connection. You’re using the old rule engine, which is running out of threads.

Let me know if you’d like me to convert it Jython… would only take a minute.

1 Like

Will do. Sure have a go at a conversion. I’ll look to see if I can set up jython :+1: thanks Scott

Setup is easy…

from core.rules import rule
from core.triggers import when
from core.actions.Exec import executeCommandLine
# uncomment the next line to use logInfo, like in the DSL
#from core.actions.LogAction import logInfo

@rule("Put KDS into Standby")
@when("Item KDS_Power received command")
def put_kds_into_standby(event)
    new_state = 'Action Preamp/Product 2 SetStandby "{}'.format('0"' if receivedCommand == ON else '1"')
    #logInfo("Linn", new_state)# you can still use this, but you need to use the import above

    events.postUpdate("KDS_Command", new_state)
    result = executeCommandLine("/etc/openhab2/scripts/" + new_state, 5000)
    #logInfo("Linn", "result: {}", result)"result: {}".format(result))

Ah, it requires 2.5 OH, then I’m out.

The addon does, but you can still do a manual install…