ok, one step further, answering my own questions again. about the external ON or OFF: my fault, just use variables in bash script:
cat licht_sofa.sh
!/bin/bash
value="$1"
if [ $value == “ON” ]; then
an () {
echo “TXP:0,0,10,5600,350,25,1,3,1,3,1,3,1,3,1,3,3,1,1,3,1,3,1,3,1,3,1,3,1,3,1,3,3,1,1,3,3,1,1,3,3,1,1,3,3,1,1,3,1,3,1,3,3,1,1,16,;” | nc -u 192.168.188.25 49880 &
pid=$!
sleep 1
kill $pid 2>/dev/null >/dev/null
}
echo An
an
else
aus () {
echo “TXP:0,0,10,5600,350,25,1,3,1,3,1,3,1,3,1,3,3,1,1,3,1,3,1,3,1,3,1,3,1,3,1,3,3,1,1,3,3,1,1,3,3,1,1,3,3,1,1,3,3,1,1,3,1,1,1,16,;” | nc -u 192.168.188.25 49880 &
pid=$!
sleep 1
kill $pid 2>/dev/null >/dev/null
}
echo Aus
aus
fi
so now i can call this one script with external variable $1 ON or OFF. Works fine. But: How can i use this in things?
My thing and its logs look like this now:
2016-12-24 21:45:59.996 [ItemAddedEvent ] - Item ‘SteckdoseSofa_Input’ has been added.
2016-12-24 21:46:00.477 [ItemChannelLinkAddedEvent ] - Link ‘SteckdoseSofa_Input-exec:command:322f4bc9:input’ has been added.
2016-12-24 21:46:13.324 [ItemCommandEvent ] - Item ‘SteckdoseSofa_Input’ received command NULL
2016-12-24 21:46:13.325 [ItemStateChangedEvent ] - SteckdoseSofa_Input changed from NULL to NULL
So i´m guessing, that the command
/Users/alexanderkarls/Downloads/brematic/licht_sofa.sh %2$s
in the thing is wrong. BUT HOW THE HELL can in pass ON or OFF and vice versa?