--- /dev/null
+##############################################
+# $Id: myUtilsTemplate.pm 7570 2015-01-14 18:31:44Z rudolfkoenig $
+#
+# Save this file as 99_myUtils.pm, and create your own functions in the new
+# file. They are then available in every Perl expression.
+
+package main;
+
+use strict;
+use warnings;
+use POSIX;
+
+sub
+myUtils_Initialize($$)
+{
+ my ($hash) = @_;
+}
+
+# Enter you functions below _this_ line.
+
+sub write_temp_knx {
+ my $temp = ReadingsVal("Aussentemperatur","temperature",10);
+ my $m;
+ my $b0;
+ if ( $temp < 0) {
+ # negative temperture
+ $m = ~int($temp * (-100) / 16);
+ $b0 = "a7";
+ } else {
+ $m = int($temp * 100 / 16);
+ $b0 = "20";
+ }
+ my $b1 = substr(sprintf("%X", $m), -2);
+ my $cmd = "groupwrite ip:127.0.0.1 3/0/1 $b0 $b1";
+ #print("$temp\n");
+ #print("$cmd\n");
+ system($cmd);
+}