70_WS3600.pm 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. ################################################################
  2. #
  3. # Copyright notice
  4. #
  5. # (c) 2009 Copyright: Kai 'wusel' Siering (wusel+fhem at uu dot org)
  6. # All rights reserved
  7. #
  8. # This code is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # The GNU General Public License can be found at
  14. # http://www.gnu.org/copyleft/gpl.html.
  15. # A copy is found in the textfile GPL.txt and important notices to the license
  16. # from the author is found in LICENSE.txt distributed with these scripts.
  17. #
  18. # This script is distributed in the hope that it will be useful,
  19. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. # GNU General Public License for more details.
  22. #
  23. # This copyright notice MUST APPEAR in all copies of the script!
  24. ################################################################
  25. package main;
  26. ###########################
  27. # 70_WS3600.pm
  28. # Modul for FHEM
  29. #
  30. # Contributed by Kai 'wusel' Siering <wusel+fhem@uu.org> in 2009/2010
  31. # Based in part on work for FHEM by other authors ...
  32. # $Id: 70_WS3600.pm 11307 2016-04-25 08:02:06Z rudolfkoenig $
  33. ###########################
  34. # 15.06.2013 Josch (Josch at abwesend dot de) some debugging
  35. # 25.06.2013 Josch combined Date/Time-Records supported
  36. # 12.07.2013 Josch documentation reworked
  37. # 15.07.2013 Josch state handling improved (shows conn problems)
  38. # 16.08.2013 Josch Logging improved: Level relative to verbosity level
  39. # 27.08.2013 Josch Change to Log3, loglevel removed
  40. # 02.10.2013 Josch check if rawreading defined (empty lines)
  41. # 22.10.2013 Josch update readings with readingsBulkUpdate()
  42. use strict;
  43. use warnings;
  44. #use Device::SerialPort;
  45. # all records except Time- and Date/Time-Records
  46. my %TranslatedCodes = (
  47. "Date" => "DTime",
  48. "Ti" => "Temp-inside",
  49. "Timin" => "Temp-inside-min",
  50. "Timax" => "Temp-inside-max",
  51. "DTimin" => "Temp-inside-min-DTime",
  52. "DTimax" => "Temp-inside-max-DTime",
  53. "To" => "Temp-outside",
  54. "Tomin" => "Temp-outside-min",
  55. "Tomax" => "Temp-outside-max",
  56. "DTomin" => "Temp-outside-min-DTime",
  57. "DTomax" => "Temp-outside-max-DTime",
  58. "DP" => "Dew-Point",
  59. "DPmin" => "Dew-Point-min",
  60. "DPmax" => "Dew-Point-max",
  61. "DDPmin" => "Dew-Point-min-DTime",
  62. "DDPmax" => "Dew-Point-min-DTime",
  63. "RHi" => "rel-Humidity-inside",
  64. "RHimin" => "rel-Humidity-inside-min",
  65. "RHimax" => "rel-Humidity-inside-max",
  66. "DRHimin" => "rel-Humidity-inside-min-DTime",
  67. "DRHimax" => "rel-Humidity-inside-max-DTime",
  68. "RHo" => "rel-Humidity-outside",
  69. "RHomin" => "rel-Humidity-outside-min",
  70. "RHomax" => "rel-Humidity-outside-max",
  71. "DRHomin" => "rel-Humidity-outside-min-DTime",
  72. "DRHomax" => "rel-Humidity-outside-max-DTime",
  73. "WS" => "Wind-Speed",
  74. "DIRtext" => "Wind-Direction-Text",
  75. "DIR0" => "Wind-DIR0",
  76. "DIR1" => "Wind-DIR1",
  77. "DIR2" => "Wind-DIR2",
  78. "DIR3" => "Wind-DIR3",
  79. "DIR4" => "Wind-DIR4",
  80. "DIR5" => "Wind-DIR5",
  81. "WC" => "Wind-Chill",
  82. "WCmin" => "Wind-Chill-min",
  83. "WCmax" => "Wind-Chill-max",
  84. "DWCmin" => "Wind-Chill-min-DTime",
  85. "DWCmax" => "Wind-Chill-max-DTime",
  86. "WSmin" => "Wind-Speed-min",
  87. "WSmax" => "Wind-Speed-max",
  88. "DWSmin" => "Wind-Speed-min-DTime",
  89. "DWSmax" => "Wind-Speed-max-DTime",
  90. "R1h" => "Rain-1h",
  91. "R1hmax" => "Rain-1h-hmax",
  92. "DR1hmax" => "Rain-1h-hmax-DTime",
  93. "R24h" => "Rain-24h",
  94. "R24hmax" => "Rain-24-hmax",
  95. "DR24hmax"=> "Rain-24h-max-DTime",
  96. "R1w" => "Rain-1w",
  97. "R1wmax" => "Rain-1w-max",
  98. "DR1wmax" => "Rain-1w-max-DTime",
  99. "R1m" => "Rain-1M",
  100. "R1mmax" => "Rain-1M-max",
  101. "DR1mmax" => "Rain-1M-max-DTime",
  102. "Rtot" => "Rain-total",
  103. "DRtot" => "Rain-total-DTime",
  104. "RP" => "rel-Pressure",
  105. "AP" => "abs-Pressure",
  106. "RPmin" => "rel-Pressure-min",
  107. "RPmax" => "rel-Pressure-max",
  108. "DRPmin" => "rel-Pressure-min-DTime",
  109. "DRPmax" => "rel-Pressure-max-DTime",
  110. "Tendency"=> "Tendency",
  111. "Forecast"=> "Forecast",
  112. #added for WS-0101 / WS-1080
  113. "WG" => "Wind-Gust",
  114. "DIR" => "Wind-Dir",
  115. "state" => "State",
  116. );
  117. # Date/Time-Records
  118. my %TranslatedDateTimeCodes = (
  119. "DTime" => "DTime",
  120. "DTTimin" => "Temp-inside-min-DTime",
  121. "DTTimax" => "Temp-inside-max-DTime",
  122. "DTTomin" => "Temp-outside-min-DTime",
  123. "DTTomax" => "Temp-outside-max-DTime",
  124. "DTDPmin" => "Dew-Point-min-DTime",
  125. "DTDPmax" => "Dew-Point-min-DTime",
  126. "DTRHimin" => "rel-Humidity-inside-min-DTime",
  127. "DTRHimax" => "rel-Humidity-inside-max-DTime",
  128. "DTRHomin" => "rel-Humidity-outside-min-DTime",
  129. "DTRHomax" => "rel-Humidity-outside-max-DTime",
  130. "DTWCmin" => "Wind-Chill-min-DTime",
  131. "DTWCmax" => "Wind-Chill-max-DTime",
  132. "DTWSmin" => "Wind-Speed-min-DTime",
  133. "DTWSmax" => "Wind-Speed-max-DTime",
  134. "DTR1hmax" => "Rain-1h-hmax-DTime",
  135. "DTR24hmax"=> "Rain-24h-max-DTime",
  136. "DTR1wmax" => "Rain-1w-max-DTime",
  137. "DTR1mmax" => "Rain-1M-max-DTime",
  138. "DTRtot" => "Rain-total-DTime",
  139. "DTRPmin" => "rel-Pressure-min-DTime",
  140. "DTRPmax" => "rel-Pressure-max-DTime",
  141. );
  142. # Time-Records (will be appended to Date-Record)
  143. my %TranslatedTimeCodes = (
  144. "Time" => "DTime",
  145. "TTimin" => "Temp-inside-min-DTime",
  146. "TTimax" => "Temp-inside-max-DTime",
  147. "TTomin" => "Temp-outside-min-DTime",
  148. "TTomax" => "Temp-outside-max-DTime",
  149. "TDPmin" => "Dew-Point-min-DTime",
  150. "TDPmax" => "Dew-Point-min-DTime",
  151. "TRHimin" => "rel-Humidity-inside-min-DTime",
  152. "TRHimax" => "rel-Humidity-inside-max-DTime",
  153. "TRHomin" => "rel-Humidity-outside-min-DTime",
  154. "TRHomax" => "rel-Humidity-outside-max-DTime",
  155. "TWCmin" => "Wind-Chill-min-DTime",
  156. "TWCmax" => "Wind-Chill-max-DTime",
  157. "TWSmin" => "Wind-Speed-min-DTime",
  158. "TWSmax" => "Wind-Speed-max-DTime",
  159. "TR1hmax" => "Rain-1h-hmax-DTime",
  160. "TR24hmax"=> "Rain-24h-max-DTime",
  161. "TR1wmax" => "Rain-1w-max-DTime",
  162. "TR1mmax" => "Rain-1M-max-DTime",
  163. "TRtot" => "Rain-total-DTime",
  164. "TRPmin" => "rel-Pressure-min-DTime",
  165. "TRPmax" => "rel-Pressure-max-DTime",
  166. );
  167. #####################################
  168. sub
  169. WS3600_Initialize($)
  170. {
  171. my ($hash) = @_;
  172. # Consumer
  173. $hash->{DefFn} = "WS3600_Define";
  174. $hash->{AttrList}= "model:WS3600,WS2300,WS1080";
  175. # $hash->{ReadFn} = "WS3600_Read";
  176. $hash->{UndefFn} = "WS3600_Undef";
  177. }
  178. #####################################
  179. sub
  180. WS3600_Define($$)
  181. {
  182. my ($hash, $def) = @_;
  183. my @a = split("\"", $def);
  184. my $dev;
  185. my $Timer = 60; # call every 64 seconds; normal wireless update interval
  186. # is 128 sec, on wind >10 m/s 32 sec. 64 sec should ensure
  187. # quite current data.
  188. if(@a==1) {
  189. @a = split("[ \t][ \t]*", $def); #compatibility for old syntax
  190. return "wrong syntax: define <name> WS3600 \"</path/to/extprog [<options>]>\" [<readinterval in s>]" if(@a!=3);
  191. $dev = $a[2];
  192. }
  193. else {
  194. return "wrong syntax: define <name> WS3600 \"</path/to/extprog [<options>]>\" [<readinterval in s>]" if(@a < 2 || @a > 3);
  195. $dev = $a[1];
  196. $Timer = $a[2] if((@a==3)&&($a[2]>=10));
  197. }
  198. my $name = $hash->{NAME};
  199. my $ret = `$dev`; #call external program
  200. Log3 $name, 4, "WS3600(Dbg): $name ret=$ret";
  201. return "WS3600(Err): Can't start $dev: $!" if(!defined($ret));
  202. # Log3 $name, 3, "WS3600 $dev started";
  203. $hash->{DeviceName} = $dev;
  204. $hash->{Timer} = $Timer;
  205. my $nt = gettimeofday() + $hash->{Timer};
  206. $nt -= $nt % $hash->{Timer}; # round
  207. Log3 $name, 3, "WS3600(Msg): $name initialized, setting callback timer to " . FmtTime($nt) . "(+ $Timer s)";
  208. RemoveInternalTimer($hash);
  209. InternalTimer($nt, "WS3600_Read", $hash, 0);
  210. $hash->{STATE} = "initialized";
  211. return undef;
  212. }
  213. #####################################
  214. sub
  215. WS3600_Undef($$)
  216. {
  217. my ($hash, $def) = @_;
  218. my $name = $hash->{NAME};
  219. RemoveInternalTimer($hash);
  220. $hash->{STATE}='undefined';
  221. Log3 $name, 3, "WS3600(Msg): $name shutdown complete";
  222. return undef;
  223. }
  224. #####################################
  225. sub
  226. WS3600_Read($)
  227. {
  228. my ($hash) = @_;
  229. my $name = $hash->{NAME};
  230. my $dev = $hash->{DeviceName};
  231. my @lines;
  232. my $tn = TimeNow();
  233. my $reading;
  234. my $AnythingRead = 0;
  235. $hash->{LastRead} = $tn;
  236. readingsBeginUpdate($hash);
  237. if(defined($defs{$name}{READINGS}{"State"})) {
  238. readingsBulkUpdate($hash,"State", 0xFF);
  239. }
  240. # Log 4-GetLogLevel($name,0), "WS3600(Dbg): (4) Info";
  241. # Log 3-GetLogLevel($name,0), "WS3600(Msg): (3) Msg";
  242. # Log 2-GetLogLevel($name,0), "WS3600(Wng): (2) Warning";
  243. # Log 1-GetLogLevel($name,0), "WS3600(Err): (1) Error";
  244. # Log3 $name, 4, "WS3600(Dbg): $name Read started using \"$dev\"";
  245. Log3 $name, 3, "WS3600(Msg): $name Read started";
  246. @lines = `$dev`; # call external program
  247. foreach my $inputline ( @lines ) {
  248. $inputline =~ s/\s+$//;
  249. my ($rawreading, $val, $val2) = split(/ /, $inputline);
  250. if(defined($rawreading)) {
  251. my $logmsg = "WS3600(Dbg): $name read $inputline|$rawreading|$val";
  252. $logmsg .= "|$val2" if(defined($val2));
  253. Log3 $name, 4, $logmsg;
  254. # Log3 $name, 4, "WS3600(Dbg): $name read $inputline|$rawreading|$val|$val2";
  255. if(defined($TranslatedCodes{$rawreading})) {
  256. $reading = $TranslatedCodes{$rawreading};
  257. readingsBulkUpdate($hash,$reading, $val);
  258. $AnythingRead = 1;
  259. }
  260. # write Date/Time-Records
  261. elsif(defined($TranslatedDateTimeCodes{$rawreading})) {
  262. $reading = $TranslatedDateTimeCodes{$rawreading};
  263. readingsBulkUpdate($hash,$reading, $val . " " . $val2);
  264. $AnythingRead = 1;
  265. }
  266. # append Time-Record to Date-Record (managed by same Name)
  267. elsif(defined($TranslatedTimeCodes{$rawreading})) {
  268. $reading = $TranslatedTimeCodes{$rawreading};
  269. $defs{$name}{READINGS}{$reading}{VAL} .= " " . $val;
  270. $defs{$name}{READINGS}{$reading}{TIME} = $tn;
  271. $AnythingRead = 1;
  272. }
  273. }
  274. }
  275. if($AnythingRead) {
  276. $hash->{STATE} = "T: " . $defs{$name}{READINGS}{"Temp-outside"}{VAL}
  277. . " H: " . $defs{$name}{READINGS}{"rel-Humidity-outside"}{VAL}
  278. . " W: " . $defs{$name}{READINGS}{"Wind-Speed"}{VAL}
  279. . " R: " . $defs{$name}{READINGS}{"Rain-total"}{VAL}
  280. . " Ti: " . $defs{$name}{READINGS}{"Temp-inside"}{VAL}
  281. . " Hi: " . $defs{$name}{READINGS}{"rel-Humidity-inside"}{VAL};
  282. $hash->{CHANGED}[0] = $hash->{STATE};
  283. }
  284. else {
  285. $hash->{STATE} = "no data received";
  286. }
  287. readingsEndUpdate($hash,1);
  288. # Call us in n seconds again.
  289. my $nt = gettimeofday() + $hash->{Timer};
  290. $nt -= $nt % $hash->{Timer}; # round
  291. RemoveInternalTimer($hash);
  292. InternalTimer($nt, "WS3600_Read", $hash, 0);
  293. return $hash->{STATE};
  294. }
  295. 1;
  296. =pod
  297. =begin html
  298. <a name="WS3600"></a>
  299. <h3>WS3600</h3>
  300. <ul>
  301. Defines a weather station, which is queried by means of an external
  302. program. That program is executed by FHEM and is expected to deliver the
  303. data at stdout in the format of a WS3600 series weather station (details
  304. see below).<br>
  305. <br>
  306. <a name="WS3600define"></a> <b>Define</b>
  307. <ul>
  308. <code>define &lt;name&gt; WS3600 "&lt;wsreaderprog&gt;
  309. [&lt;options&gt;]" [&lt;interval&gt;]</code> <br>
  310. <br>
  311. <ul>
  312. <dl>
  313. <dt>&lt;wsreaderprog&gt;</dt>
  314. <dd>full path to the executable which queries the weatherstation
  315. (for WS3600 series fetch3600 should be used)</dd>
  316. <dt>&lt;options&gt;</dt>
  317. <dd>options for &lt;wsreaderprog&gt;, if necessary</dd>
  318. <dt>&lt;interval&gt;</dt>
  319. <dd>this optional parameter is the time between subsequent calls to
  320. &lt;wsreaderprog&gt;. It defaults to 60s.</dd>
  321. </dl>
  322. </ul>
  323. <br>
  324. Supported Stations are:<br>
  325. <ul>
  326. <li>WS3600 series weather station (Europe Supplies, technotrade, etc;
  327. refer to <a href="http://wiki.wetterstationen.info/index.php?title=LaCrosse_WS3600">Wetterstationen.info</a>
  328. (german) for details on this model) with fetch3600 from the
  329. toolchain <a href="http://open3600.fast-mail.nl/tiki-index.php">open3600</a>).
  330. Fetch3600 delivers the current readings line by line as
  331. reading-value-pairs. These are read periodically and translated into
  332. more readable names for FHEM by the module WS3600.pm. </li>
  333. <li><a href="http://wiki.wetterstationen.info/index.php?title=LaCrosse_WS2300">WS2300</a>
  334. with toolchain <a href="http://www.lavrsen.dk/twiki/bin/view/Open2300/WebHome">open2300</a>,
  335. because it is rather similar to the WS3600.</li>
  336. <li><a href="http://wiki.wetterstationen.info/index.php?title=WS1080">WS1080</a>
  337. (and other stations which come with the EasyWeather windows
  338. application) with <a href="https://code.google.com/p/fowsr/">fowsr</a>
  339. (version 2.0 or above)</li>
  340. </ul>
  341. <br>
  342. Currently, it is expected that the WS is attached to the local computer
  343. and &lt;wsreaderprog&gt; is run locally. Basically the executable called
  344. needs to supply on stdout an output similar to what fetch3600 returns;
  345. how to implement a "networked setup" is left as an excercise to the
  346. reader. <br>
  347. For the records, this is an output of fetch3600:<br>
  348. <div>
  349. <pre>Date 14-Nov-2009
  350. Time 10:50:22
  351. Ti 22.8
  352. Timin 20.8
  353. Timax 27.9
  354. TTimin 10:27
  355. DTimin 15-10-2009
  356. TTimax 23:31
  357. DTimax 20-08-2009
  358. To 14.2
  359. Tomin -0.4
  360. Tomax 35.6
  361. TTomin 07:03
  362. DTomin 15-10-2009
  363. TTomax 16:52
  364. DTomax 20-08-2009
  365. DP 9.2
  366. DPmin -2.2
  367. DPmax 20.3
  368. TDPmin 07:03
  369. DDPmin 15-10-2009
  370. TDPmax 11:58
  371. DDPmax 20-08-2009
  372. RHi 48
  373. RHimin 32
  374. RHimax 57
  375. TRHimin 17:03
  376. DRHimin 21-10-2009
  377. TRHimax 22:24
  378. DRHimax 07-10-2009
  379. RHo 72
  380. RHomin 27
  381. RHomax 96
  382. TRHomin 16:41
  383. DRHomin 20-08-2009
  384. TRHomax 06:28
  385. DRHomax 02-11-2009
  386. WS 0.0
  387. DIRtext WSW
  388. DIR0 247.5
  389. DIR1 247.5
  390. DIR2 247.5
  391. DIR3 247.5
  392. DIR4 247.5
  393. DIR5 247.5
  394. WC 14.2
  395. WCmin -0.4
  396. WCmax 35.6
  397. TWCmin 07:03
  398. DWCmin 15-10-2009
  399. TWCmax 16:52
  400. DWCmax 20-08-2009
  401. WSmin 0.0
  402. WSmax 25.6
  403. TWSmin 10:44
  404. DWSmin 14-11-2009
  405. TWSmax 19:08
  406. DWSmax 24-09-2009
  407. R1h 0.00
  408. R1hmax 24.34
  409. TR1hmax 22:34
  410. DR1hmax 07-10-2009
  411. R24h 0.00
  412. R24hmax 55.42
  413. TR24hmax 07:11
  414. DR24hmax 08-10-2009
  415. R1w 29.00
  416. R1wmax 95.83
  417. TR1wmax 00:00
  418. DR1wmax 12-10-2009
  419. R1m 117.58
  420. R1mmax 117.58
  421. TR1mmax 00:00
  422. DR1mmax 01-11-2009
  423. Rtot 3028.70
  424. TRtot 03:29
  425. DRtot 18-09-2005
  426. RP 992.200
  427. AP 995.900
  428. RPmin 970.300
  429. RPmax 1020.000
  430. TRPmin 05:25
  431. DRPmin 04-11-2009
  432. TRPmax 09:19
  433. DRPmax 11-09-2009
  434. Tendency Falling
  435. Forecast Cloudy</pre>
  436. </div>
  437. There is no expectation on the readings received from the fetch3600
  438. binary; so, in essence, if you have a similar setup (unsupported,
  439. attached weather station and a means to get it's reading into an output
  440. similar to above's), you <em>should be able</em> to use WS3600.pm with
  441. a custom written script to interface FHEM with your station as well.
  442. WS3600.pm <em>only recognizes the above readings</em> (and translates
  443. these into, e. g., <code>Temp-inside</code> for <code>Ti</code> for
  444. use within FHEM), other lines are silently dropped on the floor. Note:
  445. To step down the number of readings date and time records will now be
  446. merged to one reading containing date and time. This now also allows
  447. records with merged date / time values delivered from
  448. &lt;wsreaderprog&gt; - detected by prefix <code>DT</code> (e.g. <code>Date</code>
  449. + <code>Time</code> --&gt; <code>DTime</code>, <code>DRPmin</code> +
  450. <code>TRPmin</code> --&gt; <code>DTRPmin</code> and so on). <br>
  451. fetch3600 is available as binary for the Windows OS as well, <em>but
  452. operation under that OS isn't tested yet.</em> <br>
  453. <br>
  454. Examples:
  455. <ul>
  456. <code>define myWS3600 W3600 /usr/local/bin/fetch360</code><br>
  457. <code>define myWS1080 W3600 "/usr/local/bin/fowsr -c" 300</code><br>
  458. </ul>
  459. <br>
  460. </ul>
  461. <a name="WS3600set"></a> <b>Set</b>
  462. <ul>
  463. N/A
  464. </ul>
  465. <br>
  466. <a name="WS3600get"></a> <b>Get</b>
  467. <ul>
  468. N/A
  469. </ul>
  470. <br>
  471. <a name="WS3600attr"></a> <b>Attributes</b>
  472. <ul>
  473. <li><a href="#model">model</a>&nbsp;&nbsp;&nbsp;&nbsp; WS3600, WS2300,
  474. WS1080 (not used for anything, yet)</li>
  475. </ul>
  476. <br>
  477. </ul>
  478. =end html
  479. =begin html_DE
  480. <a name="WS3600"></a>
  481. <h3>WS3600</h3>
  482. <ul>
  483. Definiert eine Wetterstation, die über ein externes Programm ausgelesen
  484. wird. Dieses Programm wird zyklisch durch FHEM aufgerufen. Es muss die
  485. Daten im gleichen Format wie fetch3600 (Details siehe unten) auf der
  486. Standardausgabe liefern.<br>
  487. <br>
  488. <a name="WS3600define"></a> <b>Define</b>
  489. <ul>
  490. <code>define &lt;name&gt; WS3600 "&lt;wsreaderprog&gt;
  491. [&lt;options&gt;]" [&lt;interval&gt;]</code> <br>
  492. <br>
  493. <ul>
  494. <dl>
  495. <dt>&lt;wsreaderprog&gt;</dt>
  496. <dd>kompletter Pfad zum Ausleseprogramm (für Wetterstationen Typ
  497. WS3600 fetch3600 verwenden)</dd>
  498. <dt>&lt;options&gt;</dt>
  499. <dd>Kommandozeilenparameter für &lt;wsreaderprog&gt;, falls
  500. erforderlich</dd>
  501. <dt>&lt;interval&gt;</dt>
  502. <dd>optionaler Parameter für das Aufrufintervall [s]. Defaultwert
  503. ist 60s.</dd>
  504. </dl>
  505. </ul>
  506. <br>
  507. &nbsp; Unterstützte Stationen sind:<br>
  508. <ul>
  509. <li>WS3600 Serie (Europe Supplies, technotrade, usw.; s.a. <a href="http://wiki.wetterstationen.info/index.php?title=LaCrosse_WS3600">Wetterstationen.info</a>
  510. (deutsch) für Details) in Verbindung mit fetch3600 aus dem Paket <a
  511. href="http://open3600.fast-mail.nl/tiki-index.php">open3600</a>).
  512. Fetch3600 liefert die aktuellen Werte zeilenweise als
  513. Name-Wert-Paare. Diese werden durch FHEM zyklisch eingelesen, mit
  514. besser lesbaren Bezeichnungen versehen und als Readings zur
  515. Verfügung gestellt. </li>
  516. <li><a href="http://wiki.wetterstationen.info/index.php?title=LaCrosse_WS2300">WS2300</a>
  517. Serie in Verbindung mit dem Paket <a href="http://www.lavrsen.dk/twiki/bin/view/Open2300/WebHome">open2300</a>
  518. (ähnlich zu open3600).</li>
  519. <li><a href="http://wiki.wetterstationen.info/index.php?title=WS1080">WS1080</a>
  520. (und andere Stationen, die mit der Windows-Software "Easy Weather"
  521. ausgeliefert werden) in Verbindung mit <a href="https://code.google.com/p/fowsr/">fowsr</a>
  522. (ab Version 2.0)</li>
  523. </ul>
  524. <br>
  525. Es wird vorausgesetzt, dass die Wetterstation am lokalen Computer
  526. angeschlossen ist und &lt;wsreaderprog&gt; deshalb lokal läuft.
  527. &lt;wsreaderprog&gt; muss grundsätzlich eine zu fetch3600 vergleichbare
  528. Ausgabe auf der Standardausgabe liefern. <br>
  529. Als Beispiel für das erwartete Format hier die Ausgabe von fetch3600:<br>
  530. <div>
  531. <pre>Date 14-Nov-2009
  532. Time 10:50:22
  533. Ti 22.8
  534. Timin 20.8
  535. Timax 27.9
  536. TTimin 10:27
  537. DTimin 15-10-2009
  538. TTimax 23:31
  539. DTimax 20-08-2009
  540. To 14.2
  541. Tomin -0.4
  542. Tomax 35.6
  543. TTomin 07:03
  544. DTomin 15-10-2009
  545. TTomax 16:52
  546. DTomax 20-08-2009
  547. DP 9.2
  548. DPmin -2.2
  549. DPmax 20.3
  550. TDPmin 07:03
  551. DDPmin 15-10-2009
  552. TDPmax 11:58
  553. DDPmax 20-08-2009
  554. RHi 48
  555. RHimin 32
  556. RHimax 57
  557. TRHimin 17:03
  558. DRHimin 21-10-2009
  559. TRHimax 22:24
  560. DRHimax 07-10-2009
  561. RHo 72
  562. RHomin 27
  563. RHomax 96
  564. TRHomin 16:41
  565. DRHomin 20-08-2009
  566. TRHomax 06:28
  567. DRHomax 02-11-2009
  568. WS 0.0
  569. DIRtext WSW
  570. DIR0 247.5
  571. DIR1 247.5
  572. DIR2 247.5
  573. DIR3 247.5
  574. DIR4 247.5
  575. DIR5 247.5
  576. WC 14.2
  577. WCmin -0.4
  578. WCmax 35.6
  579. TWCmin 07:03
  580. DWCmin 15-10-2009
  581. TWCmax 16:52
  582. DWCmax 20-08-2009
  583. WSmin 0.0
  584. WSmax 25.6
  585. TWSmin 10:44
  586. DWSmin 14-11-2009
  587. TWSmax 19:08
  588. DWSmax 24-09-2009
  589. R1h 0.00
  590. R1hmax 24.34
  591. TR1hmax 22:34
  592. DR1hmax 07-10-2009
  593. R24h 0.00
  594. R24hmax 55.42
  595. TR24hmax 07:11
  596. DR24hmax 08-10-2009
  597. R1w 29.00
  598. R1wmax 95.83
  599. TR1wmax 00:00
  600. DR1wmax 12-10-2009
  601. R1m 117.58
  602. R1mmax 117.58
  603. TR1mmax 00:00
  604. DR1mmax 01-11-2009
  605. Rtot 3028.70
  606. TRtot 03:29
  607. DRtot 18-09-2005
  608. RP 992.200
  609. AP 995.900
  610. RPmin 970.300
  611. RPmax 1020.000
  612. TRPmin 05:25
  613. DRPmin 04-11-2009
  614. TRPmax 09:19
  615. DRPmax 11-09-2009
  616. Tendency Falling
  617. Forecast Cloudy</pre>
  618. </div>
  619. Welche der vorgenannten Wertepaare durch &lt;wsreaderprog&gt;&nbsp;
  620. geliefert werden, ist egal. Jedes bekannte wird übersetzt (z.B. <code>Ti</code>
  621. nach <code>Temp-inside</code>) und als Reading angezeigt, alle
  622. unbekannten werden kommentarlos verworfen. Mittels geeignetem Programm
  623. oder Script sollte sich also jede beliebige Wetterstation anschließen
  624. lassen. <br>
  625. Anmerkung: Um die Anzahl Readings zu reduzieren, werden jetzt Date- und
  626. Time-Wertepaare zusammengefasst. Es ist jetzt auch zulässig, dass
  627. &lt;wsreaderprog&gt; schon kombinierte Wertepaare liefert. Diese sind
  628. mit dem Prefix <code>DT</code> zu kennzeichnen, also z.B. <code>Date</code>
  629. + <code>Time</code> --&gt; <code>DTime</code>, <code>DRPmin</code> +
  630. <code>TRPmin</code> --&gt; <code>DTRPmin</code> usw.).<br>
  631. <em>Fetch3600 ist auch unter Windows verfügbar, ob das Zusammenspiel mit
  632. FHEM dort auch funktioniert, wurde noch nicht getestet.</em> <br>
  633. <br>
  634. Beispiele:
  635. <ul>
  636. <code>define myWS3600 W3600 /usr/local/bin/fetch360</code><br>
  637. <code>define myWS1080 W3600 "/usr/local/bin/fowsr -c" 300</code><br>
  638. </ul>
  639. <br>
  640. </ul>
  641. <a name="WS3600set"></a> <b>Set</b>
  642. <ul>
  643. N/A
  644. </ul>
  645. <br>
  646. <a name="WS3600get"></a> <b>Get</b>
  647. <ul>
  648. N/A
  649. </ul>
  650. <br>
  651. <a name="WS3600attr"></a> <b>Attributes</b>
  652. <ul>
  653. <li><a href="#model">model</a>&nbsp;&nbsp;&nbsp;&nbsp; WS3600, WS2300,
  654. WS1080 (z.Zt (noch) ohne Wirkung)</li>
  655. </ul>
  656. <br>
  657. </ul>
  658. =end html_DE
  659. =cut