OH2 is more than confusing, its messing things up big time. don´t know why there was such a big change needed, cause bindings like the old exec made OH so flexible. Got some similar problem as Paul here:
In OH1, this was my single line setup for a stupid wallplug. The plug doesn´t supply status, so its only ON or OFF, no matter what state the plug got from manual switch via remote control or by hand:
.items:
Switch Light_GF_Living_Couch “Steckdose Sofa” (GF_Living) { exec=“OFF:/opt/brematic/licht_sofa_off.sh, ON:/opt/brematic/licht_sofa_on.sh” }
licht_sofa_on.sh:
cat licht_sofa_on.sh
!/bin/bash
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
}
licht_sofa_off.sh:
cat licht_sofa_off.sh
!/bin/bash
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
}
As you can see, there are two scripts needed to do the full task of switching on and off, just because i need to send two different strings with netcat to the controller (Brematic). How can i do this with OH2?
See, the concept with things is pretty straight forward. I wanted to torture myself and do the whole migration setup from OH1.8.3 to OH2.0 with paper UI and habmin, just to see how hard it would be. For Netatmo, Max!, Hue and Network, everything went very well and quite easy - in fact, better then i suspected it to be. But now i struggle with the exec binding and here you can “feel”, that OH2 is still not out of beta. I´m a long time user of OH, terminal is no struggle for me, but i really wanted to use the GUI for once. But as it seems, there is actual no way to solve this only from clicking.