70_WS3600.pm 22 KB

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