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
put_kds_into_standby.log.info(new_state)
events.postUpdate("KDS_Command", new_state)
result = executeCommandLine("/etc/openhab2/scripts/linn.sh@@" + new_state, 5000)
#logInfo("Linn", "result: {}", result)
put_kds_into_standby.log.info("result: {}".format(result))