88_xs1Dev.pm 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. #################################################################
  2. # $Id: 88_xs1Dev.pm 16394 2018-03-12 23:09:47Z HomeAuto_User $
  3. #################################################################
  4. # logisches Modul - einzelnes Gerät, über das mit physikalisches
  5. # Modul kommuniziert werden kann
  6. #
  7. # note / ToDo´s:
  8. #
  9. #
  10. #
  11. #################################################################
  12. package main;
  13. # Laden evtl. abhängiger Perl- bzw. FHEM-Module
  14. use strict;
  15. use warnings; # Warnings
  16. use POSIX;
  17. use Time::Local;
  18. use SetExtensions;
  19. sub xs1Dev_Initialize($) {
  20. my ($hash) = @_;
  21. $hash->{Match} = "[x][s][1][D][e][v][_][A][k][t][o][r]_[0-6][0-9].*|[x][s][1][D][e][v][_][S][e][n][s][o][r]_[0-6][0-9].*"; ## zum testen - https://regex101.com/
  22. $hash->{DefFn} = "xs1Dev_Define";
  23. $hash->{AttrFn} = "xs1Dev_Attr";
  24. $hash->{ParseFn} = "xs1Dev_Parse";
  25. $hash->{SetFn} = "xs1Dev_Set";
  26. $hash->{UndefFn} = "xs1Dev_Undef";
  27. $hash->{AttrList} = "debug:0,1 ".
  28. "IODev ".
  29. "useSetExtensions:0,1 ".
  30. $readingFnAttributes;
  31. $hash->{AutoCreate} = { "xs1Dev_Sensor_.*" => { GPLOT => "temp4hum4:Temp/Hum,", FILTER=>"%NAME", } };
  32. }
  33. sub xs1Dev_Define($$) {
  34. my ($hash, $def) = @_;
  35. my @arg = split("[ \t][ \t]*", $def);
  36. # 0 1 2 3 4
  37. return "Usage: define <NAME> xs1Dev <Typ> <ID> IODev= | wrong number of arguments" if( @arg != 5);
  38. return "Usage: define <NAME> xs1Dev <Typ> <ID> IODev= | wrong IODev argument" if not ( $arg[4] =~ m/IODev=([^\s]*)[a-zA-Z0-9]/);
  39. return "Usage: define <NAME> xs1Dev <Typ> <ID> | wrong ID, must be 1-64" if ( $arg[3] <1 || $arg[3] >64);
  40. return "Usage: define <NAME> xs1Dev <Typ> <ID> | wrong Typ, must be A or S" if ( $arg[2] ne "A" && $arg[2] ne "S");
  41. splice( @arg, 1, 1 );
  42. my $iodev;
  43. my $i = 0;
  44. #### Schleife (Durchlauf der Argumente @arg) wo IODev= gefiltert wird aus define | Dispatch
  45. foreach my $param ( @arg ) {
  46. if( $param =~ m/IODev=([^\s]*)/ ) {
  47. $iodev = $1;
  48. splice( @arg, $i, 3 );
  49. last;
  50. }
  51. $i++;
  52. }
  53. ###########################################################################################
  54. my $name = $hash->{NAME}; ## Der Definitionsname, mit dem das Gerät angelegt wurde.
  55. my $typ = $hash->{TYPE}; ## Der Modulname, mit welchem die Definition angelegt wurde.
  56. #Log3 $name, 3, "$typ: Define arguments 0:$arg[0] | 1:$arg[1] | 2:$arg[2] | 3:$arg[3]";
  57. # Parameter Define
  58. my $xs1_ID = $arg[2]; ## Zusatzparameter 1 bei Define - ggf. nur in Sub
  59. my $xs1_typ1 = $arg[1]; ## A || S
  60. my $Device = $xs1_typ1.$xs1_ID; ## A02 || S05
  61. my $Device_count = 0;
  62. my $Device_exist;
  63. ### Check A02 || S05 bereits definiert
  64. foreach my $d (sort keys %defs) {
  65. if(defined($defs{$d}) && defined($defs{$d}{ID}) && $defs{$d}{ID} eq $Device) {
  66. $Device_count++;
  67. $Device_exist = $d;
  68. Log3 $name, 3, "$typ: $d $Device_count";
  69. }
  70. }
  71. return "The xs1 <ID> $Device is already definded: $Device_exist" if ($Device_count != 0);
  72. $hash->{ID} = $xs1_typ1.$xs1_ID; ## A02 || S05
  73. $modules{xs1Dev}{defptr}{$xs1_typ1.$xs1_ID} = $hash; ## !!! Adresse rückwärts dem Hash zuordnen (für ParseFn)
  74. my $debug = AttrVal($hash->{NAME},"debug",0);
  75. AttrVal($hash->{NAME},"useSetExtensions",0);
  76. $hash->{STATE} = "Defined"; ## Der Status des Modules nach Initialisierung.
  77. $hash->{TIME} = time(); ## Zeitstempel, derzeit vom anlegen des Moduls
  78. $hash->{VERSION} = "1.16"; ## Version
  79. $hash->{xs1_name} = "undefined"; ## Aktor | Sensor Name welcher def. im xs1
  80. $hash->{xs1_typ} = "undefined"; ## xs1_Typ switch | hygrometer | temperature ...
  81. if ($xs1_typ1 eq "A"){
  82. $hash->{xs1_function1} = "undefined"; ## xs1_Funktion zugeordnete Funktion 1
  83. $hash->{xs1_function2} = "undefined"; ## xs1_Funktion zugeordnete Funktion 2
  84. $hash->{xs1_function3} = "undefined"; ## xs1_Funktion zugeordnete Funktion 3
  85. $hash->{xs1_function4} = "undefined"; ## xs1_Funktion zugeordnete Funktion 4
  86. }
  87. # Attribut gesetzt
  88. $attr{$name}{room} = "xs1" if( not defined( $attr{$name}{room} ) );
  89. AssignIoPort($hash,$iodev) if( !$hash->{IODev} ); ## sucht nach einem passenden IO-Gerät (physikalische Definition)
  90. if(defined($hash->{IODev}->{NAME})) {
  91. Log3 $name, 4, "xs1Dev: $name - I/O device is " . $hash->{IODev}->{NAME};
  92. }
  93. # GENERELL in FHEM auf LOG1 genommen von Rudi
  94. # else {
  95. # Log3 $name, 3, "xs1Dev: $name - no I/O device";
  96. # }
  97. # if(defined($hash->{IODev}->{xs1_ip})) { ## IP von xs1Bridge - Device aus HASH
  98. # $hash->{xs1_ip} = $hash->{IODev}->{xs1_ip};
  99. # }
  100. return undef;
  101. }
  102. sub xs1Dev_Attr()
  103. {
  104. my ($cmd,$name,$attrName,$attrValue) = @_;
  105. my $hash = $defs{$name};
  106. my $typ = $hash->{TYPE};
  107. my $debug = AttrVal($hash->{NAME},"debug",0);
  108. Debug " $name: Attr | Attributes $attrName = $attrValue" if($debug);
  109. }
  110. sub xs1Dev_Set ($$@)
  111. {
  112. my ( $hash, $name, @args ) = @_;
  113. my $xs1_ID = $hash->{ID};
  114. #my $name = $hash->{NAME};
  115. my $cmd = $args[0];
  116. my $debug = AttrVal($hash->{NAME},"debug",0);
  117. my $xs1_typ = $hash->{xs1_typ};
  118. my $Aktor_ID = substr($xs1_ID,1,2); ## A01 zu 01
  119. my $cmd2; ## notwendig für Switch Funktionsplatz xs1
  120. return "no set value specified" if(int(@args) < 1);
  121. if ($xs1_typ ne "temperature" && $xs1_typ ne "hygrometer") {
  122. my @xs1_function =(); ## Funktionen in ARRAY schreiben
  123. push (@xs1_function, $hash->{xs1_function1});
  124. push (@xs1_function, $hash->{xs1_function2});
  125. push (@xs1_function, $hash->{xs1_function3});
  126. push (@xs1_function, $hash->{xs1_function4});
  127. my $cmdList = "";
  128. my $cmdListNew = "";
  129. my $SetExtensionsReady = 0;
  130. foreach (@xs1_function) { ## cmdList aus ARRAY xs1_function zusammenstellen
  131. ($cmdList)=split(/;/);
  132. $cmdListNew .= " ".$cmdList if ($cmdList ne "-");
  133. $SetExtensionsReady++ if ($cmdList eq "on" || $cmdList eq "off");
  134. }
  135. Debug " -------------- ERROR CHECK - START --------------" if($debug);
  136. #### Set cmdList bei switch || dimmer || shutter || timerswitch
  137. $cmdList = $cmdListNew if($xs1_typ eq "switch" || $xs1_typ eq "dimmer" || $xs1_typ eq "shutter" || $xs1_typ eq "timerswitch");
  138. #$cmdList .= "dim:slider,0,6.25,100 dimup dimdown" if ($xs1_typ eq "dimmer");
  139. my $cmdFound = index($cmdListNew, $cmd); ## check cmd in cmdListNew
  140. Debug " $name: Set | xs1_typ=$xs1_typ SetExtensionsReady=$SetExtensionsReady cmdList=$cmdList" if($debug);
  141. if ($cmdList ne "") { ## Set nur bei definierten Typ
  142. if(AttrVal($name,"useSetExtensions",undef) || AttrVal($name,"useSetExtensions","0" && $SetExtensionsReady > 0)) {
  143. $cmd =~ s/([.?*])/\\$1/g;
  144. if($cmdList !~ m/\b$cmd\b/) {
  145. unshift @args, $name;
  146. return SetExtensions($hash, $cmdList, @args);
  147. }
  148. SetExtensionsCancel($hash);
  149. } else {
  150. ############## Funktion switch ##############
  151. if($xs1_typ eq "switch") {
  152. Debug " $name: Set | xs1_function 1=$xs1_function[0] 2=$xs1_function[1] 3=$xs1_function[2] 4=$xs1_function[3]" if($debug);
  153. if ($cmdFound >= 0) { ## cmdFound in welchem Funktionsplatz xs1
  154. for my $i (0 .. 3) {
  155. if ($xs1_function[$i] eq $cmd) {
  156. $cmd2 = "function=".($i+1);
  157. Debug " $name: Set | cmd=$cmd cmd2=$cmd2 on xs1_function place".($i+1) if($debug);
  158. }
  159. }
  160. }
  161. return "Wrong set argument, choose one of $cmdList" if($cmdFound < 0);
  162. }
  163. ############## Funktion dimmer ##############
  164. elsif ($xs1_typ eq "dimmer") {
  165. Debug " $name: Set | xs1_typ=$xs1_typ cmd=$cmd" if ( not defined ($args[0]) );
  166. Debug " $name: Set | xs1_typ=$xs1_typ cmd=$cmd args0=".$args[0] if ( defined ($args[0]) && $cmd ne "?");
  167. #return "Unknown argument ?, choose one of $cmdList" if($args[0] eq "?"); ### geht - ALT
  168. return SetExtensions($hash, $cmdList, $name, $cmd, @args); ### TEST - NEU
  169. if($cmd eq "dim") { ## dim
  170. return "Please value between 0 to 100" if($args[0] !~ /^([0-9]{1,2}+$|^[1][0][0]$|[0-9]{1,2}\.[0-9]{1}$)/); # 0-100 mit einer Kommastelle
  171. $cmd = $cmd.sprintf("%02d", $args[0])."%" if ($args[0] >= 1 && $args[0] <= 9);
  172. $cmd = $cmd.$args[0]."%" if (length $args[0] != 1);
  173. $cmd = "off" if ($args[0] == 0); ## dim00% als off
  174. } elsif ($cmd eq "dimup" || $cmd eq "dimdown") { ## dimup + dimdown
  175. if (defined $args[0]) {
  176. if ($args[0] >= 0 && $args[0] <= 100) {
  177. $cmd = $cmd." ".$args[0];
  178. } else {
  179. return "value not in range | 0-100";
  180. }
  181. } else { ## OLD - NEW State auslesen einbauen mit ReadVal - XS! Kontrollieren !!!
  182. my $oldState = ReadingsVal($name, "state" , "unknown");
  183. (my $TempState) = $oldState =~ /[0-9]{1,2}/g ;
  184. my $newState;
  185. if ($cmd eq "dimdown" && $TempState >= 1) {
  186. $newState = $TempState - 1 ;
  187. } elsif ($cmd eq "dimdown" && $TempState <= 99) {
  188. $newState = $TempState + 1 if ($cmd eq "dimup");
  189. }
  190. $cmd = $cmd." $newState";
  191. }
  192. }
  193. }
  194. ############## Funktion shutter || timerswitch ##############
  195. elsif ($xs1_typ eq "shutter" || $xs1_typ eq "timerswitch") {
  196. Debug " $name: Set | xs1_function 1=$xs1_function[0] 2=$xs1_function[1] 3=$xs1_function[2] 4=$xs1_function[3]" if($debug);
  197. if ($cmdFound >= 0) { ## cmdFound in welchem Funktionsplatz xs1
  198. for my $i (0 .. 3) {
  199. if ($xs1_function[$i] eq $cmd) {
  200. $cmd2 = "function=".($i+1);
  201. Debug " $name: Set | cmd=$cmd cmd2=$cmd2 on xs1_function place".($i+1) if($debug);
  202. }
  203. }
  204. }
  205. return "Wrong set argument, choose one of $cmdList" if($cmdFound < 0);
  206. }
  207. ############## alles Andere ##############
  208. elsif ($xs1_typ ne "undefined") {
  209. Log3 $name, 2, "$name: Set | xs1_typ=$xs1_typ are not supported. Please inform me!";
  210. return "xs1_typ=$xs1_typ are not supported. Please inform me!";
  211. }
  212. }
  213. }
  214. if(defined($hash->{IODev}->{NAME})) {
  215. if ($xs1_typ eq "switch" || $xs1_typ eq "dimmer" || $xs1_typ eq "shutter" || $xs1_typ eq "timerswitch") {
  216. Debug " $name: Set IOWrite | xs1_ID=$xs1_ID xs1_typ=$xs1_typ cmd=$cmd cmd2=$cmd2" if($debug && $xs1_typ ne "temperature" && $xs1_typ ne "hygrometer");
  217. IOWrite($hash, $xs1_ID, $xs1_typ, $cmd, $cmd2);
  218. readingsSingleUpdate($hash, "state", $cmd , 1);
  219. }
  220. #else {
  221. #Log3 $name, 2, "$name: Device NOT SUPPORTED for Dispatch. In xs1 disabled.";
  222. #}
  223. } else {
  224. return "no IODev define. Please define xs1Bridge.";
  225. }
  226. Debug " $name: Set | xs1_ID=$xs1_ID xs1_typ=$xs1_typ" if($debug);
  227. Debug " -------------- ERROR CHECK - END --------------" if($debug);
  228. }
  229. return undef;
  230. }
  231. sub xs1Dev_Parse($$) ## Input Data from 88_xs1Bridge
  232. {
  233. my ( $io_hash, $data) = @_; ## $io_hash = ezControl -> def. Name von xs1Bridge
  234. my ($xs1Dev,$xs1_readingsname,$xs1_ID,$xs1_typ2,$xs1_value,$xs1_f1,$xs1_f2,$xs1_f3,$xs1_f4,$xs1_name) = split("#", $data);
  235. my $xs1_typ1 = substr($xs1_readingsname,0,1); ## A || S
  236. my $def = $modules{xs1Dev}{defptr}{$xs1_typ1.$xs1_ID};
  237. $def = $modules{xs1Dev}{defptr}{$xs1_typ1.$xs1_ID} if(!$def); ## {xs1Dev}{defptr}{A02}
  238. my $hash = $def;
  239. $hash->{xs1_typ} = $xs1_typ2;
  240. $hash->{xs1_name} = $xs1_name;
  241. my $IODev = $io_hash->{NAME};
  242. my $name = $hash->{NAME}; ## xs1Dev_Aktor_01
  243. my $typ = $hash->{TYPE}; ## xs1Dev
  244. $typ = "xs1Dev" if (!$def); ## Erstanlegung
  245. ###### Define and values update ######
  246. #Log3 $typ, 3, "$typ: Parse | Data: $xs1Dev | $xs1_readingsname | $xs1_ID | $xs1_typ2 | $xs1_value | $xs1_typ1 | $IODev" if (!$def);
  247. if(!$def) {
  248. # "UNDEFINED xs1Dev_Aktor_12 xs1Dev A 12"
  249. Log3 $name, 3, "$typ: Unknown device ".$xs1Dev."_".$xs1_readingsname."_"."$xs1_ID $xs1_ID $xs1_typ1 IODev=$IODev, please define it";
  250. return "UNDEFINED xs1Dev"."_".$xs1_readingsname."_"."$xs1_ID xs1Dev $xs1_typ1 $xs1_ID IODev=$IODev";
  251. } else {
  252. #Log3 $name, 3, "$typ: device $xs1_readingsname"."_"."$xs1_ID xs1_value:$xs1_value xs1_typ2:$xs1_typ2";
  253. AssignIoPort($hash, $io_hash); ## sucht nach einem passenden IO-Gerät (physikalische Definition)
  254. if ($xs1_readingsname eq "Aktor") { ## zugeordnete xs1_Funktionen
  255. $hash->{xs1_function1} = $xs1_f1;
  256. $hash->{xs1_function2} = $xs1_f2;
  257. $hash->{xs1_function3} = $xs1_f3;
  258. $hash->{xs1_function4} = $xs1_f4;
  259. }
  260. #### Typ switch | on | off mod for FHEM Default
  261. if ($xs1_typ2 eq "switch") {
  262. if ($xs1_value == 0) { $xs1_value = "off"; }
  263. elsif ($xs1_value == 100) { $xs1_value = "on"; }
  264. readingsSingleUpdate($hash, "state", $xs1_value ,1); # Aktor | Sensor Update value
  265. ## RegEx devStateIcon da Symbole nicht gleich benannt -> dim_up | dim_down
  266. if ($hash->{xs1_function1} eq "dim_up" || $hash->{xs1_function2} eq "dim_up" || $hash->{xs1_function3} eq "dim_up" || $hash->{xs1_function4} eq "dim_up" ||
  267. $hash->{xs1_function1} eq "dim_down" || $hash->{xs1_function2} eq "dim_down" || $hash->{xs1_function3} eq "dim_down" || $hash->{xs1_function4} eq "dim_down" ) {
  268. $attr{$name}{devStateIcon} = "dim_up:dimup dim_down:dimdown" if( not defined( $attr{$name}{devStateIcon} ) );
  269. }
  270. }
  271. #### Typ temperature
  272. elsif ($xs1_typ2 eq "temperature") {
  273. my $xs1_value_new = "T: ".$xs1_value; ## temperature mod for FHEM Default
  274. readingsBeginUpdate($hash);
  275. readingsBulkUpdate($hash, "state", $xs1_value_new);
  276. readingsBulkUpdate($hash, "temperature", $xs1_value);
  277. readingsEndUpdate($hash, 1);
  278. }
  279. #### Typ hygrometer
  280. elsif ($xs1_typ2 eq "hygrometer") {
  281. my $xs1_value_new = "H: ".$xs1_value; ## hygrometer mod for FHEM Default
  282. readingsBeginUpdate($hash);
  283. readingsBulkUpdate($hash, "state", $xs1_value_new);
  284. readingsBulkUpdate($hash, "humidity", $xs1_value);
  285. readingsEndUpdate($hash, 1);
  286. }
  287. #### Typ dimmer
  288. elsif ($xs1_typ2 eq "dimmer") {
  289. ## RegEx devStateIcon da Symbole nicht durchweg von 0 - 100 | dim_up | dim_down
  290. $attr{$name}{devStateIcon} = "dim0[1-6]\\D%:dim06% dim[7-9]\\D|dim[1][0-2]%:dim12% dim[1][3-8]%:dim18% \n"
  291. ."dim[1][9]|dim[2][0-5]%:dim25% dim[2][6-9]|dim[3][0-1]%:dim31% dim[3][2-7]%:dim37% \n"
  292. ."dim[3][8-9]|dim[4][0-3]%:dim43% dim[4][4-9]|dim[5][0]%:dim50% dim[5][1-6]%:dim56% \n"
  293. ."dim[5][7-9]|dim[6][0-2]%:dim62% dim[6][3-8]%:dim68% dim[6][9]|dim[7][0-5]%:dim75% \n"
  294. ."dim[7][6-9]|dim[8][0-1]%:dim81% dim[8][2-7]%:dim87% dim[8][8-9]|dim[9][0-3]%:dim93% \n"
  295. ."dim[9][4-9]|dim[1][0][0]%:dim100% dim[_][u][p]:dimup dim[_][d][o]:dimdown" if( not defined( $attr{$name}{devStateIcon} ) );
  296. if ($xs1_value ne "0.0") {
  297. $xs1_value = "dim".sprintf("%02d", $xs1_value)."%";
  298. } elsif ($xs1_value eq "0.0") {
  299. $xs1_value = "off";
  300. }
  301. readingsSingleUpdate($hash, "state", $xs1_value ,1);
  302. }
  303. #### Typ shutter | on | off mod for FHEM Default
  304. elsif ($xs1_typ2 eq "shutter") {
  305. if ($xs1_value == 0) { $xs1_value = "off"; }
  306. elsif ($xs1_value == 100) { $xs1_value = "on"; }
  307. readingsSingleUpdate($hash, "state", $xs1_value ,1);
  308. }
  309. #### Typ timerswitch | on | off mod for FHEM Default
  310. elsif ($xs1_typ2 eq "timerswitch") {
  311. if ($xs1_value == 0) { $xs1_value = "off"; }
  312. elsif ($xs1_value == 100) { $xs1_value = "on"; }
  313. readingsSingleUpdate($hash, "state", $xs1_value ,1);
  314. }
  315. }
  316. return $name;
  317. }
  318. sub xs1Dev_Undef($$)
  319. {
  320. my ( $hash, $name) = @_;
  321. my $typ = $hash->{TYPE};
  322. delete($modules{xs1Dev}{defptr}{$hash->{ID}});
  323. Log3 $name, 3, "$typ: Device with Name $name delete";
  324. return undef;
  325. }
  326. # Eval-Rückgabewert für erfolgreiches
  327. # Laden des Moduls
  328. 1;
  329. # Beginn der Commandref
  330. =pod
  331. =item summary Control of the devices which defined in xs1
  332. =item summary_DE Steuerung des Ger&auml;te welche im xs1 definiert sind
  333. =begin html
  334. <a name="xs1Dev"></a>
  335. <h3>xs1Dev</h3>
  336. <ul>
  337. This module works with the xs1Bridge module. (The <code>xs1_control</code> attribute in the xs1Bridge module must be set to 1!) <br>
  338. It communicates with this and creates all actuators of the xs1 as a device in FHEM. So you can control the actuators of the xs1 from the FHEM. <br><br>
  339. The module was developed based on the firmware version v4-Beta of the xs1. There may be errors due to different adjustments within the manufacturer's firmware.
  340. <br><br>
  341. <a name="xs1Dev_define"></a>
  342. <b>Define</b><br>
  343. <ul>
  344. <code>define &lt;name&gt; xs1Dev &lt;Typ&gt; &lt;ID&gt; IODev=&lt;NAME&gt;</code>
  345. <br><br>
  346. It is not possible to create the module without specifying type and ID of xs1.
  347. <ul>
  348. <li><code>&lt;ID&gt;</code> is internal id in xs1.</li>
  349. </ul>
  350. <ul>
  351. <li><code>&lt;Typ&gt;</code> is the abbreviation A for actuators or S for sensors.</li>
  352. </ul><br>
  353. example:
  354. <ul>
  355. define xs1Dev_Aktor_02 xs1Dev A 02 IODev=ezControl
  356. </ul>
  357. </ul><br>
  358. <b>Set</b>
  359. <ul><code>set &lt;name&gt; &lt;value&gt; </code></ul><br>
  360. in which <code>value</code> one of the following values:<br>
  361. <ul><code>
  362. dim06% dim12% dim18% dim25% dim31% dim37% dim43% dim50% dim56% dim62% dim68% dim75% dim81% dim87% dim93% dim100%<br>
  363. dimdown<br>
  364. dimup<br>
  365. dimupdown<br>
  366. off<br>
  367. off-for-timer<br>
  368. on<br>
  369. on-for-timer<br>
  370. </code></ul><br>
  371. <b>Get</b><br>
  372. <ul>N/A</ul><br>
  373. <a name="xs1_attr"></a>
  374. <b>Attributes</b>
  375. <ul>
  376. <li>debug (0,1)<br>
  377. This brings the module into a very detailed debug output in the logfile. Thus, program parts can be controlled and errors can be checked.<br>
  378. (Default, debug 0)
  379. </li>
  380. <li>useSetExtensions (0,1)<br>
  381. Toggles the SetExtensions on or off.<br>
  382. (Default, useSetExtensions 0)
  383. </li>
  384. </ul><br>
  385. <b>Explanation:</b>
  386. <ul>
  387. <li>abstract Internals:</li>
  388. <ul>
  389. xs1_function(1-4): defined function in the device<br>
  390. xs1_name: defined name in the device<br>
  391. xs1_typ: defined type in the device<br>
  392. </ul><br>
  393. <li>The following xs1 device types are already integrated: dimmer | shutter | switch | timerswitch</li>
  394. </ul>
  395. </ul>
  396. =end html
  397. =begin html_DE
  398. <a name="xs1Dev"></a>
  399. <h3>xs1Dev</h3>
  400. <ul>
  401. Dieses Modul arbeitet mit dem Modul xs1Bridge zusammen. (Das Attribut <code>xs1_control</code> im Modul xs1Bridge muss auf 1 gestellt sein!) <br>
  402. Es kommuniziert mit diesem und legt sämtliche Aktoren des xs1 als Device im FHEM an. So kann man vom FHEM aus, die Aktoren der xs1 steuern.
  403. <br><br>
  404. Das Modul wurde entwickelt basierend auf dem Firmwarestand v4-Beta des xs1. Es kann aufgrund von unterschiedlichen Anpassungen innerhalb der Firmware des Herstellers zu Fehlern kommen.
  405. <br><br>
  406. <a name="xs1Dev_define"></a>
  407. <b>Define</b><br>
  408. <ul>
  409. <code>define &lt;name&gt; xs1Dev &lt;Typ&gt; &lt;ID&gt; IODev=&lt;NAME&gt;</code>
  410. <br><br>
  411. Ein anlegen des Modules ohne Angabe des Typ und der ID vom xs1 ist nicht möglich.
  412. <ul>
  413. <li><code>&lt;ID&gt;</code> ist interne ID im xs1.</li>
  414. </ul>
  415. <ul>
  416. <li><code>&lt;Typ&gt;</code> ist der Kürzel A für Aktoren oder S für Sensoren.</li>
  417. </ul><br>
  418. Beispiel:
  419. <ul>
  420. define xs1Dev_Aktor_02 xs1Dev A 02 IODev=ezControl
  421. </ul>
  422. </ul><br>
  423. <b>Set</b>
  424. <ul><code>set &lt;name&gt; &lt;value&gt; </code></ul><br>
  425. Wobei <code>value</code> einer der folgenden Werte sein kann:<br>
  426. <ul><code>
  427. dim06% dim12% dim18% dim25% dim31% dim37% dim43% dim50% dim56% dim62% dim68% dim75% dim81% dim87% dim93% dim100%<br>
  428. dimdown<br>
  429. dimup<br>
  430. dimupdown<br>
  431. off<br>
  432. off-for-timer<br>
  433. on<br>
  434. on-for-timer<br>
  435. </code></ul><br>
  436. <b>Get</b><br>
  437. <ul>N/A</ul><br>
  438. <a name="xs1_attr"></a>
  439. <b>Attribute</b>
  440. <ul>
  441. <li>debug (0,1)<br>
  442. Dies bringt das Modul in eine sehr ausf&uuml;hrliche Debug-Ausgabe im Logfile. Somit lassen sich Programmteile kontrollieren und Fehler &uuml;berpr&uuml;fen.<br>
  443. (Default, debug 0)
  444. </li>
  445. <li>useSetExtensions (0,1)<br>
  446. Schaltet die SetExtensions ein bzw. aus.<br>
  447. (Default, useSetExtensions 0)
  448. </li>
  449. </ul><br>
  450. <b>Erl&auml;uterung:</b>
  451. <ul>
  452. <li>Auszug Internals:</li>
  453. <ul>
  454. xs1_function(1-4): definierte Funktion im Ger&auml;t<br>
  455. xs1_name: definierter Name im Ger&auml;t<br>
  456. xs1_typ: definierter Typ im Ger&auml;t<br>
  457. </ul><br>
  458. <li>Folgende xs1-Ger&aumltetypen sind bereits integriert: dimmer | shutter | switch | timerswitch</li>
  459. </ul>
  460. </ul>
  461. =end html_DE
  462. =cut