95_remotecontrol.pm 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. ##############################################
  2. # $Id: 95_remotecontrol.pm 10724 2016-02-04 18:17:33Z ulimaass $
  3. # 95_remotecontrol
  4. #
  5. ################################################################
  6. #
  7. # Copyright notice
  8. #
  9. # (c) 2013 Copyright: Ulrich Maass
  10. #
  11. # This file is part of fhem.
  12. #
  13. # Fhem is free software: you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation, either version 2 of the License, or
  16. # (at your option) any later version.
  17. #
  18. # Fhem 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. # You should have received a copy of the GNU General Public License
  24. # along with fhem. If not, see <http://www.gnu.org/licenses/>.
  25. #
  26. # Disclaimer: The Author takes no responsibility whatsoever
  27. # for damages potentially done by this program.
  28. #
  29. ################################################################################
  30. #
  31. # Implementation:
  32. # 1 - set WEB rereadicons
  33. # 2 - define rc1 remotecontrol (defines fresh remotecontrol, has no keys defined yet)
  34. # 3a- get rc1 layout (display list of available "keybiard"-layouts)
  35. # 3 - set rc1 layout samsung (assigns standard-key-layout for e.g. samsungTV)
  36. # 4 - set rc1 makeweblink (creates a weblink weblink_rc1)
  37. # 4a- for testing: attr rc1 room TestRemote , attr weblink_rc1 room TestRemote
  38. # 5 - set rc1 makenotify <executingDevice> (creates a notify of the form: define notify_rc1 notify rc1 set <executingDevice> $EVENT)
  39. #
  40. # Published June 23, 2013
  41. # bugfix "use strict" upon foreign makenotify - June 24, 2013
  42. # converted to UNIX-LF - June 25, 2013
  43. # fixed minor html-bug - June 26, 2013
  44. # added css-tags rc_body and rc_button - June 27, 2013
  45. # deleted leading \n at beginning of html-code - June 30, 2013
  46. # fhemweb-detailscreen of remotecontrol now displays a preview, added htmlNoTable for RC_attr2html(), added RC_summaryFn incl attr rc_devStateIcon
  47. package main;
  48. use strict;
  49. use warnings;
  50. #########################
  51. # Forward declaration
  52. sub RC_Define();
  53. sub RC_Set($@);
  54. sub RC_Get($@);
  55. sub RC_Attr(@);
  56. sub RC_array2attr($@);
  57. sub RC_attr2html($@);
  58. sub RC_layout_delete($);
  59. sub RC_layout_samsung();
  60. sub RC_layout_itunes();
  61. sub RC_detailFn($$$$);
  62. sub RC_webCmdFn($$$);
  63. sub RC_summaryFn($$$$);
  64. #####################################
  65. # Initialize module
  66. sub
  67. remotecontrol_Initialize($)
  68. {
  69. my ($hash) = @_;
  70. $hash->{GetFn} = "RC_Get";
  71. $hash->{SetFn} = "RC_Set";
  72. $hash->{AttrFn} = "RC_Attr";
  73. $hash->{DefFn} = "RC_Define";
  74. $hash->{AttrList} = "rc_iconpath rc_iconprefix loglevel:0,1,2,3,4,5,6 rc_devStateIcon:0,1 ".
  75. "row00 row01 row02 row03 row04 row05 row06 row07 row08 row09 ".
  76. "row10 row11 row12 row13 row14 row15 row16 row17 row18 row19";
  77. $hash->{FW_detailFn} = "RC_detailFn"; # displays rc preview in fhemweb detail-screen
  78. $hash->{FW_summaryFn} = "RC_summaryFn"; # displays rc instead of status icon in fhemweb room-view
  79. $data{webCmdFn}{remotecontrol} = "RC_webCmdFn"; # displays rc instead of device-commands on the calling device
  80. $data{RC_layout}{samsung} = "RC_layout_samsung";
  81. $data{RC_layout}{itunes} = "RC_layout_itunes";
  82. # $data{RC_layout}{enigma} = "RC_layout_enigma";
  83. # $data{RC_makenotify}{enigma} = "RC_makenotify_enigma";
  84. }
  85. #####################################
  86. # Initialize every new instance
  87. sub
  88. RC_Define()
  89. {
  90. my ($hash, $def) = @_;
  91. $hash->{STATE} = "initialized";
  92. $hash->{".htmlCode"} = "";
  93. return undef;
  94. }
  95. #####################################
  96. # Ensure htmlcode is created from scratch after an attribute value has been changed
  97. sub
  98. RC_Attr(@)
  99. {
  100. my @a = @_;
  101. my $hash = $defs{$a[1]};
  102. $hash->{".htmlCode"} = "";
  103. return;
  104. }
  105. #####################################
  106. # Digest set-commands
  107. sub
  108. RC_Set($@)
  109. {
  110. my ($hash, @a) = @_;
  111. my $nam = $a[0];
  112. my $cmd = (defined($a[1]) ? $a[1] : ""); #command
  113. my $par = (defined($a[2]) ? $a[2] : ""); #parameter
  114. ## set layout
  115. if ($cmd eq "layout") {
  116. if ($par eq "delete") {
  117. RC_layout_delete($nam);
  118. $hash->{".htmlCode"} = "";
  119. } else { # layout
  120. my $layoutlist = "";
  121. my @rows;
  122. foreach my $fn (sort keys %{$data{RC_layout}}) {
  123. $layoutlist .= $fn."\n";
  124. next if ($fn ne $par);
  125. no strict "refs";
  126. @rows = &{$data{RC_layout}{$fn}}($fn);
  127. use strict "refs";
  128. }
  129. if ($#rows > 0) {
  130. RC_layout_delete($nam);
  131. RC_array2attr($nam, @rows);
  132. $hash->{".htmlCode"} = "";
  133. } else {
  134. return "Missing or invalid parameter \"$par\" for set ... layout. Use one of\n".
  135. "delete\n".$layoutlist;
  136. }
  137. }
  138. ## set makeweblink
  139. } elsif ($cmd eq "makeweblink") {
  140. my $wname = $a[2] ? $a[2] : "weblink_".$nam;
  141. fhem("define $wname weblink htmlCode {fhem(\"get $hash->{NAME} htmlcode\", 1)}");
  142. Log 2, "[remotecontrol] Weblink created: $wname";
  143. return "Weblink created: $wname";
  144. ## set makenotify
  145. } elsif ($cmd eq "makenotify") {
  146. if ($a[2]) {
  147. my $ndev = $a[2];
  148. my $fn = $defs{$ndev}{TYPE} ? $defs{$ndev}{TYPE} : undef;
  149. if (defined($fn) && defined($data{RC_makenotify}{$fn})) { #foreign makenotify
  150. no strict "refs";
  151. my $msg = &{$data{RC_makenotify}{$fn}}($nam,$ndev);
  152. use strict "refs";
  153. return $msg;
  154. } else {
  155. my $nname="notify_$nam";
  156. fhem("define $nname notify $nam set $ndev ".'$EVENT',1);
  157. Log 2, "[remotecontrol] Notify created: $nname";
  158. return "Notify created: $nname";
  159. }
  160. } else {
  161. return "set $nam makenotify <executingdevice>:\n name of executing device missing.";
  162. }
  163. ## set ?
  164. } elsif ($cmd eq "?") {
  165. my $ret = "Unknown argument $cmd choose one of makeweblink makenotify state .remotecontrol:remotecontrol layout:";
  166. foreach my $fn (sort keys %{$data{RC_layout}}) {
  167. $ret .= $fn . ",";
  168. }
  169. $ret =~ s/[:,]$//;
  170. return $ret;
  171. ## set state <command>
  172. } else {
  173. Log GetLogLevel($nam,4), "[remotecontrol] set $nam $cmd $par";
  174. readingsSingleUpdate($hash,"state",$cmd,1) if (!$par);
  175. }
  176. }
  177. #####################################
  178. # Digest get-commands
  179. sub
  180. RC_Get($@)
  181. {
  182. my ($hash, @a) = @_;
  183. my $arg = (defined($a[1]) ? $a[1] : ""); #command
  184. my $name = $hash->{NAME};
  185. ## get htmlcode
  186. if($arg eq "htmlcode") {
  187. $hash->{".htmlCode"} = RC_attr2html($name) if ($hash->{".htmlCode"} eq "");
  188. return $hash->{".htmlCode"};
  189. ## get layout
  190. } elsif ($arg eq "layout") {
  191. my $layoutlist = "Available predefined layouts are:\n";
  192. foreach my $fn (sort keys %{$data{RC_layout}}) {
  193. $layoutlist .= $fn."\n";
  194. }
  195. return $layoutlist;
  196. ## get -> error
  197. } else {
  198. return "Unknown argument $arg choose one of: htmlcode layout";
  199. }
  200. }
  201. #####################################
  202. # Convert all rowXX-attribute-values into htmlcode
  203. sub
  204. RC_attr2html($@) {
  205. my ($name,$htmlNoTable) = @_;
  206. my $iconpath = AttrVal("$name","rc_iconpath","icons/remotecontrol");
  207. my $iconprefix = AttrVal("$name","rc_iconprefix","");
  208. my $rc_html;
  209. my $row;
  210. $rc_html = "<div class=\"remotecontrol\">";
  211. # $rc_html = "<div class=\"remotecontrol\" id=\"$name\">"; # provokes update by longpoll
  212. $rc_html.= '<table class="rc_body">' if (!$htmlNoTable);
  213. foreach my $rownr (0..19) {
  214. $rownr = sprintf("%2.2d",$rownr);
  215. $row = AttrVal("$name","row$rownr",undef);
  216. next if (!$row);
  217. $rc_html .= "<tr>\n" if (!$htmlNoTable);
  218. my @btn = split (",",$row);
  219. foreach my $btnnr (0..$#btn) {
  220. $rc_html .= '<td class="rc_button">';# if (!$htmlNoTable);
  221. if ($btn[$btnnr] ne "") {
  222. my $cmd;
  223. my $img;
  224. if ($btn[$btnnr] =~ /(.*?):(.*)/) { # button has format <command>:<image>
  225. $cmd = $1;
  226. $img = $2;
  227. } else { # button has format <command> or is empty
  228. $cmd = $btn[$btnnr];
  229. $img = $btn[$btnnr];
  230. }
  231. if ($img =~ m/\.svg/) { # convert svg-images
  232. $img = FW_makeImage($img, $cmd, "rc-button");
  233. } else {
  234. $img = "<img src=\"$FW_ME/$iconpath/$iconprefix$img\">";
  235. }
  236. if ($cmd || $cmd eq "0") {
  237. $cmd = "cmd.$name=set $name $cmd";
  238. $rc_html .= "<a onClick=\"FW_cmd('$FW_ME$FW_subdir?XHR=1&$cmd')\">$img</a>";
  239. } else {
  240. $rc_html .= $img;
  241. }
  242. }
  243. $rc_html .= "</td>";# if (!$htmlNoTable);
  244. $rc_html .= "\n";
  245. }
  246. $rc_html .= "</tr>\n" if (!$htmlNoTable);
  247. }
  248. $rc_html .= "</table>" if (!$htmlNoTable);
  249. $rc_html .= "</div>";
  250. return $rc_html;
  251. }
  252. #####################################
  253. # Delete all rowXX-attributes
  254. sub
  255. RC_layout_delete($) {
  256. my $name = shift;
  257. foreach my $rownr (0..19) {
  258. $rownr = sprintf("%2.2d",$rownr);
  259. fhem("deleteattr $name row$rownr",1);
  260. }
  261. }
  262. #####################################
  263. # Convert array-values into rowXX-attribute-values
  264. sub
  265. RC_array2attr($@)
  266. {
  267. my ($name, @row) = @_;
  268. my $ret;
  269. foreach my $rownr (0..21) {
  270. next if (!$row[$rownr]);
  271. $rownr = sprintf("%2.2d",$rownr);
  272. if ($row[$rownr] =~ m/^attr (.*?)\s(.*)/) {
  273. $ret = fhem("attr $name $1 $2");
  274. } else {
  275. $ret = fhem("attr $name row$rownr $row[$rownr]") if ($row[$rownr]);
  276. }
  277. }
  278. }
  279. ##################
  280. #remotecontrol-specific fhemweb detail-screen
  281. sub
  282. RC_detailFn($$$$) {
  283. my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
  284. my $hash = $defs{$d};
  285. $hash->{".htmlCode"} = RC_attr2html($d) if ($hash->{".htmlCode"} eq "");
  286. return $hash->{".htmlCode"};
  287. }
  288. ##################
  289. #remotecontrol-specific webCmdFn to be used
  290. # calling module needs to provide ".remotecontrol:remotecontrol" in its return to 'set <device> ?'
  291. sub
  292. RC_webCmdFn($$$) {
  293. my ($FW_wname, $d, $FW_room, $cmd, $values) = @_;
  294. return undef if($values !~ m/remotecontrol/);
  295. my @args = split("[ \t]+", $cmd);
  296. return RC_attr2html($args[1],1) if ($args[1]);
  297. return undef;
  298. }
  299. ##################
  300. #remotecontrol-specific summaryFn to be used
  301. # displays the remote on the remote-device itself in FHEMWEB room-overview
  302. sub
  303. RC_summaryFn($$$$) {
  304. my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
  305. my $hash = $defs{$d};
  306. my $name = $hash->{NAME};
  307. return undef if (AttrVal($name,"rc_devStateIcon",1) != 1);
  308. return RC_attr2html($name);
  309. }
  310. #####################################
  311. # Default-layout for samsung
  312. sub
  313. RC_layout_samsung() {
  314. my $ret;
  315. my @row;
  316. $row[0]="POWEROFF,TV,HDMI";
  317. $row[1]=":blank,:blank,:blank";
  318. $row[2]="1,2,3";
  319. $row[3]="4,5,6";
  320. $row[4]="7,8,9";
  321. $row[5]=":blank,0,PRECH";
  322. $row[6]=":blank,:blank,:blank";
  323. $row[7]="VOLUP:UP,MUTE,CHUP";
  324. $row[8]=":VOL,:blank,:PROG";
  325. $row[9]="VOLDOWN:DOWN,CH_LIST,CHDOWN";
  326. $row[10]="MENU,:blank,GUIDE";
  327. $row[11]=":blank,:blank,:blank";
  328. $row[12]="TOOLS,UP,INFO";
  329. $row[13]="LEFT,ENTER,RIGHT";
  330. $row[14]="RETURN,DOWN,EXIT";
  331. $row[15]="attr rc_iconpath icons/remotecontrol";
  332. $row[16]="attr rc_iconprefix black_btn_";
  333. # unused available commands
  334. # AD PICTURE_SIZE SOURCE
  335. # CONTENTS W_LINK
  336. # RSS MTS SRS CAPTION TOPMENU SLEEP ESAVING
  337. # PLAY PAUSE REWIND FF REC STOP
  338. # PIP_ONOFF ASPECT
  339. return @row;
  340. }
  341. #####################################
  342. # Default-layout for itunes
  343. sub
  344. RC_layout_itunes() {
  345. my $ret;
  346. my @row;
  347. $row[0]="play:PLAY,pause:PAUSE,prev:REWIND,next:FF,quieter:VOLDOWN,louder:VOLUP";
  348. $row[1]="attr rc_iconpath icons/remotecontrol";
  349. $row[2]="attr rc_iconprefix black_btn_";
  350. # unused available commands
  351. return @row;
  352. }
  353. 1;
  354. =pod
  355. =begin html
  356. <a name="remotecontrol"></a>
  357. <h3>remotecontrol</h3>
  358. <ul>
  359. Displays a graphical remote control. Buttons (=icons) can be chosen and arranged. Predefined layouts are available for e.g. Samsung-TV or iTunes.
  360. Any buttonclick can be forwarded to the actual fhem-device. For further explanation, please check the <a href="http://www.fhemwiki.de/wiki/Remotecontrol">Wiki-Entry</a>.<br>
  361. <a name="remotecontroldefine"></a><br>
  362. <b>Define</b>
  363. <ul>
  364. <code>define &lt;rc-name&gt; remotecontrol</code><br><br>
  365. Typical steps to implement a remotecontrol:<br>
  366. <table>
  367. <tr><td><code>define rc1 remotecontrol</code></td><td><code># defines a "blank" remotecontrol</code></td></tr>
  368. <tr><td><code>get rc1 layout</code></td><td><code># displays all available predefined layouts</code></td></tr>
  369. <tr><td><code>set rc1 layout samsung</code></td><td><code># assigns keys for a SamsungTV</code></td></tr>
  370. <tr><td><code>set rc1 makenotify myTV</code></td><td><code># creates notify_rc1 which forwards every buttonclick to myTV for execution</code></td></tr>
  371. <tr><td><b>Note:</b> keys can be changed at any time, it is not necessary to redefine the weblink</td></tr>
  372. <tr><td><code>attr rc1 row15 VOLUP,VOLDOWN</code></td></tr>
  373. </table>
  374. </ul>
  375. <a name="remotecontrolset"></a><br>
  376. <b>Set</b>
  377. <ul>
  378. <li><code>set &lt;rc-name&gt; layout [delete|&lt;layoutname&gt;]</code><br>
  379. <code>layout delete</code> deletes all rowXX-attributes<br>
  380. <code>layout &lt;layoutname&gt;</code> assigns a predefined layout to rowXX-attributes</li>
  381. <li><code>set &lt;rc-name&gt; makeweblink [&lt;name&gt;]</code><br>
  382. creates a weblink to display the graphical remotecontrol. Default-name is weblink_&lt;rc-name&gt; .</li>
  383. <li><code>set &lt;rc-name&gt; makenotify &lt;executingDevice&gt;</code><br>
  384. creates a notify to trigger &lt;executingDevice&gt; every time a button has been pressed. name is notify_&lt;rc-name&gt; .</li>
  385. </ul>
  386. <a name="remotecontrolget"></a><br>
  387. <b>Get</b>
  388. <ul>
  389. <code>get &lt;rc-name&gt; [htmlcode|layout]</code><br>
  390. <li><code>htmlcode</code> displays htmlcode for the remotecontrol on fhem-page</li>
  391. <li><code>layout</code> shows which predefined layouts ae available</li>
  392. </ul>
  393. <a name="remotecontrolattr"></a><br>
  394. <b>Attributes</b>
  395. <ul>
  396. <li><a href="#loglevel">loglevel</a></li>
  397. <li><a name="rc_iconpath">rc_iconpath</a><br>
  398. path for icons, default is "icons" . The attribute-value will be used for all icon-files except .svg .</li>
  399. <li><a name="rc_iconprefix">rc_iconprefix</a><br>
  400. prefix for icon-files, default is "" . The attribute-value will be used for all icon-files except .svg .</li>
  401. <li>Note: Icon-names (button-image-file-names) will be composed as <code>fhem/&lt;rc_iconpath&gt;/&lt;rc_iconprefix&gt;&lt;command|image&gt;</code><br>
  402. For .svg -icons, the access sequence is according to the FHEMWEB-attribute iconPath, default is openautomation:fhemSVG:default .</li>
  403. <li><a name="rc_devStateIcon">rc_devStateIcon</a><br>
  404. In FHEMWEB-room-overview, displays the button-layout on the rc-device itself. Default is 1, set to 0 is the remotecontrol-device should not display its buttons in FHEMWEB roomview.</li>
  405. <br>
  406. <li><a href="#rowXX">rowXX</a><br>
  407. <code>attr &lt;rc-name&gt; rowXX &lt;command&gt;[:&lt;image&gt;][,&lt;command&gt;[:&lt;image&gt;]][,...]</code><br>
  408. Comma-separated list of buttons/images per row. Any number of buttons can be placed in one row. For each button, use</li>
  409. <ul>
  410. <li><code>&lt;command&gt;</code> is the command that will trigger the event after a buttonclick. Case sensitive.</li>
  411. <li><code>&lt;image&gt;</code> is the filename of the image</li><br>
  412. <li>Per button for the remotecontrol, use</li>
  413. <li><code>&lt;command&gt;</code> where an icon with the name <rc_iconprefix>&lt;command&gt; is displayed<br>
  414. Example:<br>
  415. <code>attr rc1 rc_iconprefix black_btn_ # used for ALL icons on remotecontrol rc1</code><br>
  416. <code>attr rc1 row00 VOLUP </code><br>
  417. icon is <code>black_btn_VOLUP</code>, a buttonclick creates the event <code>VOLUP</code>
  418. </li>
  419. or
  420. <li><code>&lt;command&gt;:&lt;image&gt;</code> where an icon with the name <code>&lt;rc_iconprefix&gt;&lt;image&gt;</code> is displayed<br>
  421. Example: <br>
  422. <code>row00=LOUDER:VOLUP</code><br>
  423. icon is <code>black_btn_VOLUP</code>, a buttonclick creates the event <code>LOUDER</code>
  424. <br>
  425. Examples:<br>
  426. <code>attr rc1 row00 1,2,3,TV,HDMI</code><br>
  427. <code>attr rc2 row00 play:PLAY,pause:PAUSE,louder:VOLUP,quieter:VOLDOWN</code><br>
  428. </li>
  429. <li><b>Hint:</b> use :blank for a blank space, use e.g. :blank,:blank,:blank for a blank row</li>
  430. </ul>
  431. </ul>
  432. </ul>
  433. =end html
  434. =begin html_DE
  435. <a name="remotecontrol"></a>
  436. <h3>remotecontrol</h3>
  437. <ul>
  438. Erzeugt eine graphische Fernbedienung. Buttons (=icons) können frei ausgewählt und angeordnet werden. Vordefinierte layouts sind verfügbar für z.B. Samsung-TV und iTunes.
  439. Jeder "Knopfdruck" kann an das entsprechende fhem-Gerät weitergegeben werden.<br>
  440. Weitere Erklaerungen finden sich im <a href="http://www.fhemwiki.de/wiki/Remotecontrol">Wiki-Eintrag</a>.<br>
  441. <a name="remotecontroldefine"></a><br>
  442. <b>Define</b>
  443. <ul>
  444. <code>define &lt;rc-name&gt; remotecontrol</code><br><br>
  445. Typische Schritte zur Einrichtung:<br>
  446. <table>
  447. <tr><td><code>define rc1 remotecontrol</code></td><td><code># erzeugt eine "leere" remotecontrol</code></td></tr>
  448. <tr><td><code>get rc1 layout</code></td><td><code># zeigt alle vorhandenen vordefinierten layouts an</code></td></tr>
  449. <tr><td><code>set rc1 layout samsung</code></td><td><code># laedt das layout für SamsungTV</code></td></tr>
  450. <tr><td><code>set rc1 makenotify myTV</code></td><td><code># erzeugt notify_rc1, das jeden Tastendruck an myTV weitergibt</code></td></tr>
  451. <tr><td><b>Hinweis:</b>die Tastenbelegung kann jederzeit geaendert werden, ohne dass der weblink erneut erzeugt werden muss.</td></tr>
  452. <tr><td><code>attr rc1 row15 VOLUP,VOLDOWN</code></td></tr>
  453. </table>
  454. </ul>
  455. <a name="remotecontrolset"></a><br>
  456. <b>Set</b>
  457. <ul>
  458. <li><code>set &lt;rc-name&gt; layout [delete|&lt;layoutname&gt;]</code><br>
  459. <code>layout delete</code> loescht alle rowXX-Attribute<br>
  460. <code>layout &lt;layoutname&gt;</code> laedt das vordefinierte layout in die rowXX-Attribute</li>
  461. <li><code>set &lt;rc-name&gt; makeweblink [&lt;name&gt;]</code><br>
  462. erzeugt einen weblink zur Anzeige der remotecontrol in FHEMWEB oder FLOORPLAN. Default-Name ist weblink_&lt;rc-name&gt; .</li>
  463. <li><code>set rc1 makenotify mySamsungTV</code><br>
  464. erzeugt <code>notify_rc1</code> das jeden Tastendruck an mySamsungTV zur Ausfuehrung weitergibt</li>
  465. </ul>
  466. <a name="remotecontrolattr"></a><br>
  467. <b>Attribute</b>
  468. <ul>
  469. <li><a href="#loglevel">loglevel</a></li>
  470. <li><a name="rc_iconpath">rc_iconpath</a><br>
  471. Pfad für icons, default ist "icons" . Der Attribut-Wert wird für alle icon-Dateien verwendet ausser .svg .</li>
  472. <li><a name="rc_iconprefix">rc_iconprefix</a><br>
  473. Prefix für icon-Dateien, default ist "" . Der Attribut-Wert wird für alle icon-Dateien verwendet ausser .svg .</li>
  474. <li>Note: Icon-Namen (Tasten-Bild-Datei-Namen) werden zusammengesetzt als fhem/&lt;rc_iconpath&gt;/&lt;rc_iconprefix&gt;&lt;command|image&gt;<br>
  475. Fuer .svg -icons ist die Zugriffsfolge gemaess dem FHEMWEB-Attribut iconPath, default ist openautomation:fhemSVG:default .
  476. </li>
  477. <li><a name="rc_devStateIcon">rc_devStateIcon</a><br>
  478. Zeigt das button-layout auf dem remotecontrol-device selbst in der FHEMWEB-Raumansicht an. Default ist 1, durch setzen auf 0 erscheint in der FHEMWEB-Raumansciht nicht das layout, sondern nur der Status "Initialized".</li>
  479. <br>
  480. <li><a href="#rowXX">rowXX</a><br>
  481. <code>attr &lt;rc-name&gt; rowXX &lt;command&gt;[:&lt;image&gt;]</code><br>
  482. Komma-separarierte Liste von Tasten/Icons je Tastaturzeile. Eine Tastaturzeile kann beliebig viele Tasten enthalten.</li><br>
  483. <li>&lt;command&gt; ist der event, der bei Tastendruck ausgelöst wird. Gross/Kleinschreibung beachten.</li>
  484. <li>&lt;image&gt; ist der Dateiname des als Taste angezeigten icons</li>
  485. <li>Verwenden Sie je Taste</li>
  486. <li>&lt;command&gt; wobei als Taste/icon <code><rc_iconprefix>&lt;command&gt;</code> angezeigt wird<br>
  487. Beispiel:<br>
  488. <code>attr rc1 rc_iconprefix black_btn_ # gilt für alle Tasten/icons</code><br>
  489. <code>attr rc1 row00 VOLUP</code><br>
  490. -> icon ist <code>black_btn_VOLUP</code>, ein Tastendruck erzeugt den event <code>VOLUP</code>
  491. </li><br>
  492. oder
  493. <li>&lt;command&gt;:&lt;image&gt; wobei als Taste/icon &lt;rc_iconprefix&gt;&lt;image&gt; angezeigt wird.<br>
  494. Beispiel:<br>
  495. <code>attr rc1 row00 LOUDER:VOLUP</code><br>
  496. icon ist black_btn_VOLUP, ein Tastendruck erzeugt den event LOUDER<br>
  497. Beispiele:
  498. <code>attr rc1 row00 1,2,3,TV,HDMI</code><br>
  499. <code>attr rc2 row00 play:PLAY,pause:PAUSE,louder:VOLUP,quieter:VOLDOWN</code><br>
  500. </li>
  501. <li><b>Hinweis:</b> verwenden Sie :blank für eine 'leere Taste', oder z.B. :blank,:blank,:blank für eine Abstands-Leerzeile.</li>
  502. </ul>
  503. </ul>
  504. =end html_DE
  505. =cut