09_CUL_FHTTK.pm 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. #
  2. # 09_CUL_FHTTK.pm
  3. #
  4. # A module for FHEM to handle ELV's FHT80 TF-type sensors
  5. # written by Kai 'wusel' Siering, 2009-11-06 with help
  6. # from previously written FHEM code as well as members
  7. # of fhem-users at googlegroups.com! Thanks, guys!
  8. #
  9. # e-mail: wusel+source at uu punkt org
  10. #
  11. # This module reads, despite setting an IODev explicitely,
  12. # from any (CUL-) source and drops any identical message
  13. # arriving within 5 seconds. It does handle the automatic
  14. # retransmission of FHT80 TF as well as concurrent recep-
  15. # tion from multiple sources; in my system, it could happen
  16. # that the CUL in the same room "overhears" a telegram from
  17. # FHT80 TF (most likely due to other messages sent/received
  18. # at the same time) but the one downstairs still picks it up.
  19. # My implementation should be safe for the device in question,
  20. # if you see problems, the "only on this IODev"-code is still
  21. # in place but commented out.
  22. #
  23. #
  24. # Note: The sensor in question is named "FHT80 TF",
  25. # in it's (formerly current, now old) design it looks
  26. # similar to "FS20 TFK" but operates differently.
  27. #
  28. # FHT80 TF is designed to serve as a sensor to FHT80 B,
  29. # only the B receives TF's transmissions (after made
  30. # known to each FHT80 B) normally. The B then, if in-
  31. # structed that way, turns down the heating while any
  32. # of the TFs known to it signal "Window open". The TF
  33. # transmits about every 255 seconds a telegram stating
  34. # whether or nor the (reed-) contact is open (which
  35. # means Window or Door, relevant for heating, open)
  36. # and whether the battery is still full enough.
  37. #
  38. # The FS20 TFK on the other hand just directly addresses
  39. # another FS20 device on opening/closing of it's (reed-)
  40. # contact.
  41. #
  42. # Finally, the HMS100 TFK is designed to notify a HMS-
  43. # central about opened/closed contacts immediately,
  44. # but you can't directly address FS20 devices ...
  45. #
  46. # So, to notify e. g. FHEM instantly about opening
  47. # or closure of doors/windows, your best buy might be
  48. # an HMS100 TFK (as of this writing EUR 29,95 @ ELV).
  49. # You could use an FS20 TFK as well (EUR 34,95 @ ELV),
  50. # that way you could directly have FS20 switches act
  51. # on opened/closed doors or windows in parallel or
  52. # even without FHEM. The FHT80 TF (as eQ-3 FHT 80 TF
  53. # currently for EUR 14,95 available @ ELV) only sends
  54. # out a status telegram every ca. 2,5 minutes, so it's
  55. # ok for seeing where one might have left a window
  56. # open before leaving the house but by no means suit-
  57. # able for any alerting uses (unless a delay of said
  58. # amount of time doesn't matter, of course ;)).
  59. #
  60. # in charge of code: Matscher
  61. #
  62. # $Id: 09_CUL_FHTTK.pm 17083 2018-08-03 09:11:15Z Matscher $
  63. ##############################################
  64. package main;
  65. use strict;
  66. use warnings;
  67. my %fhttfk_codes = (
  68. "02" => "Window:Closed",
  69. "82" => "Window:Closed",
  70. "01" => "Window:Open",
  71. "81" => "Window:Open",
  72. "0c" => "Sync:Syncing",
  73. "91" => "Window:Open, Low Batt",
  74. "11" => "Window:Open, Low Batt",
  75. "92" => "Window:Closed, Low Batt",
  76. "12" => "Window:Closed, Low Batt",
  77. "0f" => "Test:Success");
  78. # -wusel, 2009-11-09: Map retransmission codes to major (8x) ones (0x)
  79. # As I'm somewhat lazy, I just list all codes from
  80. # %fhttfk_codes and map them to their major one.
  81. # (FIXME: it would be sufficient to have %fhttfk_codes
  82. # only list these major, "translated" ones.)
  83. my %fhttfk_translatedcodes = (
  84. "01" => "01",
  85. "11" => "11",
  86. "12" => "12",
  87. "02" => "02",
  88. "0c" => "0c",
  89. "0f" => "0f",
  90. "81" => "01",
  91. "82" => "02",
  92. "91" => "11",
  93. "92" => "12");
  94. # set
  95. my %fhttfk_c2b; # command->button hash
  96. my %canset = (
  97. "01" => "Open",
  98. "02" => "Closed",
  99. "0c" => "Pair",
  100. "ff" => "ReSync");
  101. # -wusel, 2009-11-06
  102. #
  103. # Parse messages from FHT80TK, normally interpreted only by FHT80
  104. #
  105. # Format as follows: "TCCCCCCXX" with CCCCCC being the id of the
  106. # sensor in hex, XX being the current status: 02/82 is Window
  107. # closes, 01/81 is Window open, 0C is synchronization, ?? is the
  108. # battery low warning. FIXME!
  109. #############################
  110. sub
  111. CUL_FHTTK_Initialize($)
  112. {
  113. my ($hash) = @_;
  114. foreach my $k (keys %canset) {
  115. my $v = $canset{$k};
  116. $fhttfk_c2b{$v} = $k;
  117. }
  118. $hash->{Match} = "^T[A-F0-9]{8}";
  119. $hash->{SetFn} = "CUL_FHTTK_Set";
  120. $hash->{DefFn} = "CUL_FHTTK_Define";
  121. $hash->{UndefFn} = "CUL_FHTTK_Undef";
  122. $hash->{AttrFn} = "CUL_FHTTK_Attr";
  123. $hash->{ParseFn} = "CUL_FHTTK_Parse";
  124. $hash->{AttrList} = "IODev do_not_notify:1,0 ignore:0,1 showtime:0,1 " .
  125. "model:FHT80TF,FHT80TF-2,virtual ".
  126. $readingFnAttributes;
  127. $hash->{AutoCreate}=
  128. { "CUL_FHTTK.*" => { GPLOT => "fht80tf:Window,", FILTER => "%NAME" } };
  129. }
  130. #############################
  131. sub
  132. CUL_FHTTK_Set($@)
  133. {
  134. my ($hash, @a) = @_;
  135. my $ret = "";
  136. return "\"set $a[0]\" needs at least two parameters" if(@a < 2);
  137. my $name = shift(@a);
  138. my $opt = shift @a;
  139. # suppress SET option
  140. if(defined($attr{$name}) && defined($attr{$name}{"model"})) {
  141. if($attr{$name}{"model"} eq "dummy") {
  142. Log3 $name, 5, "CUL_FHTTK ($name) Attribute was renamed from dummy to virtual! No functional lack.";
  143. $attr{$name}{"model"} = "virtual";
  144. }
  145. if($attr{$name}{"model"} ne "virtual") {
  146. return $ret;
  147. }
  148. }
  149. else {
  150. return $ret;
  151. }
  152. my $value = join("", @a);
  153. Log3 $name, 5, "CUL_FHTTK ($name) option: $opt and value: $value";
  154. if(!defined($fhttfk_c2b{$opt})) {
  155. my @cList = keys %fhttfk_c2b;
  156. return "Unknown argument $opt ($value), choose one of " . join(" ", @cList);
  157. }
  158. if ($opt eq "Open" ) {
  159. Log3 $name, 3, "CUL_FHTTK ($name) changed window state to open.";
  160. IOWrite($hash, "", sprintf("T%s01", $hash->{CODE})); # 0x01 - open or 0x81
  161. } elsif ($opt eq "Closed" ) {
  162. Log3 $name, 3, "CUL_FHTTK ($name) changed window state to closed.";
  163. IOWrite($hash, "", sprintf("T%s02", $hash->{CODE})); # 0x02 - closed or 0x82
  164. } elsif($opt eq "Pair" ) {
  165. Log3 $name, 3, "CUL_FHTTK ($name) pairing with FHT80b.";
  166. IOWrite($hash, "", sprintf("T%s0c", $hash->{CODE})); # 0x0c - sync
  167. # window state switch to closed through cul FW implementation
  168. $opt = "Closed";
  169. } elsif($opt eq "ReSync" ) {
  170. Log3 $name, 3, "CUL_FHTTK ($name) resyncing with FHT80b.";
  171. CUL_FHTTK_ReSync($hash);
  172. # return, because readingsupdate is perfomred by sub function
  173. return $ret;
  174. } else {
  175. return "Unknown argument $a[1], choose one of Pair ReSync Open Closed"
  176. }
  177. # update new state
  178. readingsSingleUpdate($hash, "state", $opt, 1);
  179. readingsSingleUpdate($hash, "Window", $opt, 1);
  180. return $ret;
  181. }
  182. #############################
  183. sub
  184. CUL_FHTTK_Define($$)
  185. {
  186. my ($hash, $def) = @_;
  187. my @a = split("[ \t][ \t]*", $def);
  188. my $u= "wrong syntax: define <name> CUL_FHTTK <sensor>";
  189. return $u if((int(@a)< 3) || (int(@a)>3));
  190. my $name = $hash->{NAME};
  191. my $sensor = lc($a[2]);
  192. if($sensor !~ /^[0-9a-f]{6}$/) {
  193. return "wrong sensor specification $sensor, need a 6 digit hex number!";
  194. }
  195. $hash->{CODE} = $sensor;
  196. $modules{CUL_FHTTK}{defptr}{$sensor} = $hash;
  197. AssignIoPort($hash);
  198. return undef;
  199. }
  200. #############################
  201. sub
  202. CUL_FHTTK_Undef($$)
  203. {
  204. my ($hash, $name) = @_;
  205. RemoveInternalTimer($hash);
  206. delete($modules{CUL_FHTTK}{defptr}{$hash->{CODE}}) if($hash && $hash->{CODE});
  207. return undef;
  208. }
  209. #############################
  210. sub CUL_FHTTK_Attr($$$) {
  211. my ($cmd, $name, $attrName, $attrVal) = @_;
  212. if( $attrName eq "model" && $attrVal eq "dummy") {
  213. $attr{$name}{$attrName} = "virtual";
  214. return "$name - Renamed attrubte model from dummy to virtual! No functional lack!";
  215. }
  216. return undef;
  217. }
  218. #############################
  219. sub
  220. CUL_FHTTK_Parse($$)
  221. {
  222. my ($hash, $msg) = @_;
  223. my $sensor= lc(substr($msg, 1, 6));
  224. my $def = $modules{CUL_FHTTK}{defptr}{$sensor};
  225. if(!$def) {
  226. Log3 $hash, 1, "FHTTK Unknown device $sensor, please define it";
  227. return "UNDEFINED CUL_FHTTK_$sensor CUL_FHTTK $sensor";
  228. }
  229. my $name = $def->{NAME};
  230. my $state = lc(substr($msg, 7, 2));
  231. Log3 $hash, 4, "CUL_FHTTK $sensor RAW message: $msg";
  232. return "" if(IsIgnored($name));
  233. if(!defined($fhttfk_translatedcodes{$state})) {
  234. Log3 $name, 1, sprintf("FHTTK $def Unknown state $state");
  235. $defs{$name}{READINGS}{"Unknown"}{VAL} = $state;
  236. $defs{$name}{READINGS}{"Unknown"}{TIME} = TimeNow();
  237. return "";
  238. }
  239. $state=$fhttfk_translatedcodes{$state};
  240. # PREVIOUS
  241. # FIXME: Message regarded as similar if last char is identical;
  242. # sure that's always the differentiator? -wusel, 2009-11-09
  243. if(defined($defs{$name}{PREV}{TIMESTAMP})) {
  244. if($defs{$name}{PREV}{TIMESTAMP} > time()-5) {
  245. if(defined($defs{$name}{PREV}{STATE})) {
  246. if($defs{$name}{PREV}{STATE} eq $state) {
  247. Log3 $name, 4, sprintf("FHTTK skipping state (%s) as last similar telegram was received less than 5 (%s) secs ago", $defs{$name}{PREV}{STATE}, time()-$defs{$name}{PREV}{TIMESTAMP});
  248. return "";
  249. }
  250. }
  251. }
  252. }
  253. if (! defined($defs{$name}{READINGS}{"Previous"})) {
  254. $defs{$name}{READINGS}{"Previous"}{VAL} = "";
  255. $defs{$name}{READINGS}{"Previous"}{TIME} = "";
  256. }
  257. if (defined($defs{$name}{PREV}{STATE}) && $defs{$name}{PREV}{STATE} ne $state) {
  258. my $prevState = $defs{$name}{PREV}{STATE};
  259. my ($windowReading,$windowState) = split(/:/, $fhttfk_codes{$prevState});
  260. $defs{$name}{READINGS}{"Previous"}{VAL} = $windowState if defined($windowState) && $windowState ne "";
  261. $defs{$name}{READINGS}{"Previous"}{TIME} = TimeNow();
  262. }
  263. $def->{PREVTIMESTAMP} = defined($defs{$name}{PREV}{TIMESTAMP})?$defs{$name}{PREV}{TIMESTAMP}:time();
  264. $def->{PREVSTATE} = defined($def->{STATE})?$def->{STATE}:"Unknown";
  265. $defs{$name}{PREV}{STATE}=$state;
  266. #
  267. # from here readings are effectively updated
  268. #
  269. readingsBeginUpdate($def);
  270. #READINGS
  271. my ($reading,$val) = split(/:/, $fhttfk_codes{$state});
  272. readingsBulkUpdate($def, $reading, $val);
  273. $defs{$name}{PREV}{TIMESTAMP} = time();
  274. # -wusel, 2009-11-09: According to http://fhz4linux.info/tiki-index.php?page=FHT+protocol,
  275. # FHT80TF usually transmitts between 60 and 240 seconds. (255-256 sec in
  276. # my experience ...) If we got no fresh data for over 5 minutes (300 sec),
  277. # flag this.
  278. if($defs{$name}{PREV}{TIMESTAMP}+720 < time()) {
  279. readingsBulkUpdate($def, "Reliability", "dead");
  280. } elsif($defs{$name}{PREV}{TIMESTAMP}+600 < time()) {
  281. readingsBulkUpdate($def, "Reliability", "low");
  282. } elsif($defs{$name}{PREV}{TIMESTAMP}+300 < time()) {
  283. readingsBulkUpdate($def, "Reliability", "medium");
  284. } else {
  285. readingsBulkUpdate($def, "Reliability", "ok");
  286. }
  287. # set battery state - Forum #87575
  288. my $batteryReading = "batteryState";
  289. my $batteryState = "ok";
  290. if($state eq "11" || $state eq "12") {
  291. $batteryState = "low";
  292. }
  293. if(exists($defs{$name}{READINGS}{"Battery"})) {
  294. if(defined($featurelevel) && $featurelevel <= 5.8) {
  295. readingsBulkUpdate($def, "Battery", $batteryState);
  296. } else {
  297. # delete reading
  298. readingsDelete($def, "Battery");
  299. }
  300. }
  301. readingsBulkUpdate($def, $batteryReading, $batteryState);
  302. #CHANGED
  303. readingsBulkUpdate($def, "state", $val);
  304. $def->{OPEN} = lc($val) eq "open" ? 1 : 0;
  305. Log3 $name, 4, "FHTTK Device $name ($reading: $val)";
  306. #
  307. # now we are done with updating readings
  308. #
  309. readingsEndUpdate($def, 1);
  310. return $def->{NAME};
  311. }
  312. #############################
  313. sub
  314. CUL_FHTTK_ReSync($)
  315. {
  316. my ($hash) = @_;
  317. RemoveInternalTimer($hash);
  318. Log3 undef, 3, "CUL_FHTTK_ReSync() - ReSync for $hash->{NAME} started!";
  319. # set resync
  320. IOWrite($hash, "", sprintf("T%sff", $hash->{CODE})); # 0xff - ReSync
  321. # update new state
  322. readingsSingleUpdate($hash, "state", "ReSync", 1);
  323. readingsSingleUpdate($hash, "Window", "ReSync", 1);
  324. # finish timer
  325. InternalTimer( gettimeofday() + 64, "CUL_FHTTK_ReSyncDone", $hash, 0 );
  326. }
  327. #############################
  328. sub
  329. CUL_FHTTK_ReSyncDone($)
  330. {
  331. my ($hash) = @_;
  332. RemoveInternalTimer($hash);
  333. # update new state
  334. readingsSingleUpdate($hash, "state", "Closed", 1);
  335. readingsSingleUpdate($hash, "Window", "Closed", 1);
  336. Log3 undef, 3, "CUL_FHTTK_ReSyncDone() - ReSync for $hash->{NAME} done!";
  337. }
  338. #############################
  339. sub
  340. CUL_FHTTK_ReSyncAll()
  341. {
  342. my $timeOffset = 0;
  343. foreach my $culFhtTk ( sort keys %{$modules{CUL_FHTTK}{defptr}} ) {
  344. my $hash = $modules{CUL_FHTTK}{defptr}{$culFhtTk};
  345. my $name = $hash->{NAME};
  346. Log3 undef, 4, "CUL_FHTTK_ReSyncAll - Possible device ($hash->{NAME}) found.";
  347. # check for model virtual
  348. if(AttrVal($name, "model", "") eq "virtual") {
  349. my $timerRaised = gettimeofday() + $timeOffset;
  350. InternalTimer( $timerRaised, "CUL_FHTTK_ReSync", $hash, 0 );
  351. Log3 undef, 3, "CUL_FHTTK_ReSyncAll() - ReSync for $hash->{NAME} starts at ".localtime($timerRaised)."!";
  352. $timeOffset += 3600; # one hour later, the next one, because of LOVF
  353. }
  354. }
  355. Log3 undef, 3, "CUL_FHTTK_ReSyncAll done! Devices will be synchronized in steps!";
  356. }
  357. #############################
  358. 1;
  359. =pod
  360. =item summary support for the window sensor fht80tf and fht80tf-2
  361. =item summary_DE Einbindung des fht80tf und fht80tf-2 Fensterkontaktes
  362. =begin html
  363. <a name="CUL_FHTTK"></a>
  364. <h3>CUL_FHTTK</h3>
  365. <ul>
  366. This module handles messages from the FHT80 TF "Fenster-T&uuml;r-Kontakt" (Window-Door-Contact)
  367. which are normally only acted upon by the <a href="#FHT">FHT80B</a>. With this module,
  368. FHT80 TFs are in a limited way (see <a href="http://fhz4linux.info/tiki-index.php?page=FHT+protocol">Wiki</a>
  369. for detailed explanation of TF's mode of operation) usable similar to HMS100 TFK. The name
  370. of the module was chosen as a) only CUL will spill out the datagrams and b) "TF" designates
  371. usually temperature+humidity sensors (no clue, why ELV didn't label this one "TFK" like with
  372. FS20 and HMS).<br><br>
  373. As said before, FHEM can receive FHT80 TF radio (868.35 MHz) messages only through an
  374. <a href="#CUL">CUL</a> device, so this must be defined first.
  375. <br><br>
  376. With the latest build on <a href="http://sourceforge.net/p/culfw/code/HEAD/tree/trunk/culfw/Devices/">SVN</a>
  377. or next official version 1.62 or higher, it is possible to send out FHT80 TF data with a CUL or simular
  378. devices. So it can be simulate up to four window sensor with one device
  379. (see <a href="http://www.fhemwiki.de/wiki/CUL_FHTTK">FHEM Wiki</a>). To setup a window sensor, you have to
  380. add and/or change the attribute "model" to virtual. The 6 digit hex number must not equal to FHTID.<br><br>
  381. <a name="CUL_FHTTKdefine"></a>
  382. <b>Define</b>
  383. <ul>
  384. <code>define &lt;name&gt; CUL_FHTTK &lt;devicecode&gt;</code>
  385. <br><br>
  386. <code>&lt;devicecode&gt;</code> is a six digit hex number, given to the FHT80 TF during
  387. production, i. e. it is not changeable. (Yes, it keeps this code after changing batteries
  388. as well.)<br>
  389. Examples:
  390. <ul>
  391. <code>define TK_TEST CUL_FHTTK 965AB0</code>
  392. </ul>
  393. </ul>
  394. <br>
  395. <a name="CUL_FHTTKset"></a>
  396. <b>Set</b>
  397. <ul> Only available, if model is set to virtual.<br><br>
  398. <code>set &lt;name&gt; &lt;value&gt;</code>
  399. <br><br>
  400. where <code>value</code> is one of:<br>
  401. <ul>
  402. <li><code>Closed</code><br>set window state to Closed</li><br>
  403. <li><code>Open</code><br>set window state to Open</li><br>
  404. <li><code>Pair</code><br>start pairing with FHT80B (activate FHT80B sync mode before) - state after pairing is Closed</li><br>
  405. <li><code>ReSync</code><br>resync virtual sensor with FHT80b after a reset of CUL device. In other words, perform a virtual
  406. battery exchange to synchronize the sensor with FHT80b device again. (at the moment, only
  407. available with prototype cul fw - see forum 55774)</li><br>
  408. </ul>
  409. </ul>
  410. <br>
  411. <u>Special to the "ReSync" of existing FHT80TFs after a CUL firmware reset:</u><br>
  412. After a reset or restart of a CUL device, the connection between the FHT80B and the virtual FHT80TFs is interrupted. This is equivalent to a battery change.
  413. The contacts are still registered at the FHT80B. No new pairing is required. If multiple virtual contacts are used, it is recommended to synchronize them at large intervals!<br>
  414. Calling the <b>CUL_FHTTK_ReSyncAll()</b> function synchronizes all virtual window contacts successively with the FHT80B.
  415. The time interval between the individual sensors is <u>1 hour</u>. This is determined by the 1% rule, since per contact 480 credits are consumed within 64 seconds!<br><br>
  416. <b>Get</b>
  417. <ul> No get implemented yet ...
  418. </ul><br>
  419. <a name="CUL_FHTTKattr"></a>
  420. <b>Attributes</b>
  421. <ul>
  422. <li><a href="#do_not_notify">do_not_notify</a></li><br>
  423. <li><a href="#verbose">verbose</a></li><br>
  424. <li><a href="#model">model</a><br>Possible values are: FHT80TF, FHT80TF-2, virtual (value, which allow to simulate a window sensor)</li><br>
  425. <li><a href="#showtime">showtime</a></li><br>
  426. <li><a href="#IODev">IODev</a></li><br>
  427. <li><a href="#ignore">ignore</a></li><br>
  428. <li><a href="#eventMap">eventMap</a></li><br>
  429. <li><a href="#readingFnAttributes">readingFnAttributes</a></li>
  430. </ul>
  431. <br>
  432. </ul>
  433. =end html
  434. =begin html_DE
  435. <a name="CUL_FHTTK"></a>
  436. <h3>CUL_FHTTK</h3>
  437. <ul>
  438. Dieses Modul hantiert die empfangen Daten von FHT80 TF "Fenster-T&uuml;r-Kontakt" Sensoren, welche
  439. normalerweise nur mit den <a href="#FHT">FHT80B</a> Geräten kommunizieren. Mit diesen Modul k&ouml;nnen
  440. FHT80 TFs in eingeschr&auml;nkter Weise &auml;hnlich wie HMS TFK Sensoren benutzt werden (weitere
  441. Informationen sind unter <a href="http://fhz4linux.info/tiki-index.php?page=FHT+protocol">Wiki</a> zu lesen).
  442. Der name des FHEM Moduls wurde so gewählt, weil a) nur der CUL die Daten empfangen kann und b) "TF" normalerweise
  443. Temperatur- und Feuchtigkeitssensoren suggeriert. (Keine Ahnung, warum ELV diesen Sensor nicht TFK genannt hat,
  444. wie die Sensoren von FS20 und HMS).
  445. <br><br>
  446. <a href="#CUL">CUL</a> device muss vorhr definiert sein.
  447. <br><br>
  448. Mit dem letzten Build auf <a href="http://sourceforge.net/p/culfw/code/HEAD/tree/trunk/culfw/Devices/">SVN</a>
  449. oder mit der n&auml;chsten offiziellen Version 1.62 oder h&ouml;her, ist es m&ouml;glich, FHT80 TF Daten zu senden.
  450. M&ouml;glich mit einem CUL oder &auml;hnlichen Ger&auml;ten. So k&ouml;nnen bis zu vier Fenstersensoren mit einem Ger&auml;t
  451. simuliert werden (siehe <a href="http://www.fhemwiki.de/wiki/CUL_FHTTK">FHEM Wiki</a>). Es muss lediglich das Attribut model mit dem
  452. Wert "virtual" hinzugef&uuml;gt oder ge&auml;ndert werden. Wichtig: Der Devicecode sollte nicht der FHTID entsprechen.<br><br>
  453. <a name="CUL_FHTTKdefine"></a>
  454. <b>D</b>
  455. <ul>
  456. <code>define &lt;name&gt; CUL_FHTTK &lt;devicecode&gt;</code>
  457. <br><br>
  458. <code>&lt;devicecode&gt;</code> Ist eine sechstellige Hexadezimalzahl, welche zum Zeitpunkt der Produktion
  459. des FHT80 TF gegeben wurde. Somit ist diese auch nicht mehr &auml;nderbar und bleibt auch nach einem Batteriewechsel
  460. erhalten.<br>
  461. Examples:
  462. <ul>
  463. <code>define TK_TEST CUL_FHTTK 965AB0</code>
  464. </ul>
  465. </ul>
  466. <br>
  467. <a name="CUL_FHTTKset"></a>
  468. <b>Set</b>
  469. <ul> Nur vorhanden, wenn das Attribut model mit virtual definiert wurde.<br><br>
  470. <code>set &lt;name&gt; &lt;value&gt;</code>
  471. <br><br>
  472. wobei <code>value</code> folgendes sein kann:<br>
  473. <ul>
  474. <li><code>Closed</code><br>setzt den Fensterstatus zu Closed</li><br>
  475. <li><code>Open</code><br>setzt den Fensterstatus zu Open</li><br>
  476. <li><code>Pair</code><br>startet das Anlernen an das FHT80B (FHT80B muss sich im Sync mode befinden) - danach wird der state auf "Closed" gesetzt</li><br>
  477. <li><code>ReSync</code><br>neu synchronisieren des virtuellen Sensor mit dem FHT80b Module. Damit wird ein virtueller Batteriewechsel simuliert und der angelernte
  478. Sensor wieder aufsynchronisiert. (aktuell nur mit Prototyp CUL FW verf&uuml;gbar Forum 55774)</li><br>
  479. </ul>
  480. </ul>
  481. <br>
  482. <u>Spezielles zum "ReSync" von vorhanden FHT80TFs nach einem CUL Firmware Reset:</u><br>
  483. Nach einem Reset bzw. Neustart eines CUL Devices ist die Verbindung zwischen dem FHT80B und den virtuellen FHT80TFs unterbrochen. Dies kommt einem Batteriewechsel gleich.
  484. Die Kontakte sind weiterhin am FHT80B angelernt. Ein neues Pairen entf&auml;llt. Wenn mehrere vitruelle Kontakte verwendet werden, empfiehlt es sich diese in großen Abst&auml;nden
  485. wieder zu synchronisieren!<br>
  486. Mithilfe des Aufrufes der Funktion <b>CUL_FHTTK_ReSyncAll()</b> werden alle virtuellen Fensterkontakte <u>nacheinander</u> mit den FHT80B wieder synchronisiert.
  487. Der Abstand betr&auml;gt zwischen den einzelnen Sensoren <u>1 Stunde</u>. Dies wird durch die 1% Regeln bestimmt, da pro Kontakt 480 credits innerhalb von 64 Sekunden verbraucht werden!<br><br>
  488. <b>Get</b>
  489. <ul> N/A </ul>
  490. <br>
  491. <a name="CUL_FHTTKattr"></a>
  492. <b>Attributes</b>
  493. <ul>
  494. <li><a href="#do_not_notify">do_not_notify</a></li><br>
  495. <li><a href="#verbose">verbose</a></li><br>
  496. <li><a href="#model">model</a><br>M&ouml;gliche Werte sind: FHT80TF, FHT80TF-2, virtual (zum simulieren eines Fensterkontaktes)</li><br>
  497. <li><a href="#showtime">showtime</a></li><br>
  498. <li><a href="#IODev">IODev</a></li><br>
  499. <li><a href="#ignore">ignore</a></li><br>
  500. <li><a href="#eventMap">eventMap</a></li><br>
  501. <li><a href="#readingFnAttributes">readingFnAttributes</a></li>
  502. </ul>
  503. <br>
  504. </ul>
  505. =end html_DE
  506. =cut