|
From: <ma...@us...> - 2012-06-17 15:08:22
|
Revision: 886
http://openautomation.svn.sourceforge.net/openautomation/?rev=886&view=rev
Author: makki1
Date: 2012-06-17 15:08:14 +0000 (Sun, 17 Jun 2012)
Log Message:
-----------
CUL/CUN adjustments, better EM1000, storable-example for complex datatypes
Modified Paths:
--------------
wiregate/plugin/generic/cul868
Added Paths:
-----------
wiregate/plugin/generic/Plugininfo_StoreComplex.pl
Added: wiregate/plugin/generic/Plugininfo_StoreComplex.pl
===================================================================
--- wiregate/plugin/generic/Plugininfo_StoreComplex.pl (rev 0)
+++ wiregate/plugin/generic/Plugininfo_StoreComplex.pl 2012-06-17 15:08:14 UTC (rev 886)
@@ -0,0 +1,19 @@
+# Beispielplugin um komplexe Datenstrukturen in $plugin_info abzulegen
+# V0.1
+
+use Storable;
+
+$plugin_info{$plugname."_cycle"} = 86400;
+
+my %localhash = ( 'test' => 'value1',
+ 'counter' => $plugin_info{$plugname."_ticks"} );
+
+store \%localhash, $plugin_info{$plugname."_complex"};
+
+return "stored hash in plugin_info";
+
+# zum laden sowas wie:
+#use Storable;
+#my %loadedhash = %{retrieve $plugin_info{'PluginInfo_StoreComplex.pl_complex'}};
+#return $loadedhash{'counter'};
+
Modified: wiregate/plugin/generic/cul868
===================================================================
--- wiregate/plugin/generic/cul868 2012-06-15 21:37:21 UTC (rev 885)
+++ wiregate/plugin/generic/cul868 2012-06-17 15:08:14 UTC (rev 886)
@@ -1,5 +1,5 @@
# Plugin zum verarbeiten aller Funktelegramme von FS20/(K)S300/FHZ/FHT/HMS/EM via CUL
-# Version: 0.71 2010-07-28
+# Version: 0.72 2012-06-17
# - KS300,S300TH-Empfang
# - FS20<->KNX
@@ -98,7 +98,7 @@
# RM100: T3
return "HMS recv: $buf T$type Status $stat P$prf Batt:$bat Code:$HA Val:$values";
}
- elsif($fn eq "K" && $len == 15) # KS300
+ elsif($fn eq "K" && $len >= 15) # KS300
{
my @a = split("", $buf);
my $rain = sprintf("%0.1f", hex("$a[14]$a[11]$a[12]") * 255 / 1000);
@@ -117,7 +117,7 @@
knx_write($ks300_israin_ga,$ir,1);
return "KS300 recv: $val";
}
- elsif($fn eq "K" && $len == 9) # S300TH
+ elsif($fn eq "K" && $len >= 9) # S300TH
{
my @a = split("", $buf);
my $addr = $a[2]+(hex($a[1])&7);
@@ -145,7 +145,19 @@
# 1111: cumulated value
# 2222: last value (Not set for type 2)
# 3333: top value (Not set for type 2)
- return "Debug EM recv: $buf";
+ #FIXME: ist noch nicht 100% ..
+ my @a = split("", $buf);
+ my $type = $a[2];
+ my $addr = $a[3] . $a[4];
+ my $seqno = hex($a[5].$a[6]);
+ my $total_cnt = hex($a[ 9].$a[10].$a[ 7].$a[ 8]) / 100;
+ my $current_cnt = hex($a[13].$a[14].$a[11].$a[12]) / 100;
+ my $peak_cnt = hex($a[17].$a[18].$a[15].$a[16]) / 100;
+ # these are the raw readings from the device
+ my $val = sprintf("CNT: %d CUM: %0.3f kW 5MIN: %0.3f kW TOP: %0.3f kW",
+ $seqno, $total_cnt, $current_cnt, $peak_cnt);
+ # nun sollten wir noch was sinnvolles tun, aufn Bus schreiben oder so
+ return "Debug EM recv: $buf type $type addr $addr $val";
}
elsif($fn eq "?" or $fn eq "") # empty/error-message
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|