Here you go: Connair Elro TXP script - Pastebin.com (used a template from the simple solutions forum, so credit goes mostly to that guy, I only improved some of the coding)
It probably got some coding flaws and also doesn’t have working error handling, but that doesn’t really matter anyway. (to me atleast)
If you want to use OpenHABs UDP binding, look down below for my new script
Usage is:
script.sh elro masterdip slavedip on|off gatwayip gatewayport
Netcat has to be installed, else it won’t work. Here is the example usage with OpenHAB:
exec=“>[*:tx433 elro 10110 11000 %2$s 192.168.0.15 49880]”
(my script tx433 is located in the /usr/bin folder, else you’d have to put in the full path)
This should work with SimpleSolutions Connair LAN Gateway, with the Intertechno Gateway and also the Brennenstuhl Gateway, can’t confirm the last both though, but from what I’ve read they use the same TXP string. If that’s not the case you probably have to rewrite it a little.
Also probably only devices with this kinda dip switches work with this script: http://www.fhemwiki.de/w/images/6/6a/ELRO_0100110111.png
I use Elro AB440S socket switches, which work fine with the script.
Update
I’ve also just written a script which just returns the TXP string via echo, so you can send the string via the TCP/UDP binding like this:
udp=“>[*:192.168.0.15:49880:EXEC(tx433 01100 10010 %s)]”
Here is the script: Updated Elro TXP script - Pastebin.com
Advantage over the other script is, that you don’t have to have Netcat installed on your machine. At the moment with OpenHAB 1.8.1, you can’t use wildcards with the UDP Binding, so my example above will throw an exception, you have to wait until my pull request gets accepted.
Until then you’d have setup your item like this.
udp=“>[ON:192.168.0.15:49880:‘EXEC(elro433 10110 01100 on)’], >[OFF:192.168.0.15:49880:‘EXEC(elro433 10110 01100 off)’]”