Beschattungssteuerung aus Beispiel im wiki DOIF/uiTable

Begonnen von ZeitlerW, 27 November 2017, 15:12:28

Vorheriges Thema - Nächstes Thema

ZeitlerW

Hallo Ellert??

im wiki hast du als Beispiel für "veränderte Detailansicht" ein Frontend zu Beschattungssteuerung gepostet. https://wiki.fhem.de/w/images/b/b8/Attributesfirst.png

Könntest Du bitte den dahinter liegenden Code posten (sowohl uiTable, als auch Beschattungs Logik). ... ich würde da gerne etwas abkupfern ;)


Vielen Dank

lG
Wolfgang

Ellert

Der Code steht in der 98_DOIF.pm und demnächst in doif.js
  my $jsh = "<script type=\"text/javascript\"> \$(window).ready(function(){";
  my $jsc = "    \$('.makeTable.wide.internals').before(\$('.makeTable.wide.attributes'));
      \$('.makeTable.wide.attributes').before(\$(\"[cmd='attr']\"));
      \$(\"a:contains('uiTable')\").closest('td').attr('valign','top');" if ($hash->{uitable}{attributesfirst} && !$FW_room);
  # $jsc .= "\$('#$d').closest('tr').css('display','none');" if ($FW_room !~ "all" && defined $hash->{uitable}{shownodeviceline} && $FW_room =~ /$hash->{uitable}{shownodeviceline}/);
  # $jsc .= "\$('#$d').remove();" if ($hash->{uitable}{shownostate});
  my $jsf = "  });</script>";
  $ret .= $jsh.$jsc.$jsf if ($jsc);

Es gibt keine Logik dazu, es ist nur ein uiTable-Experiment :)
defmod RollStrg DOIF (#1)
attr RollStrg checkReadingEvent 1
attr RollStrg do always
attr RollStrg room 0_Test
attr RollStrg uiTable {\
  $ATTRIBUTESFIRST=1;;\
  $SHOWNOSTATE=1;;\
\
  $TPL{position} = "select,on,33,66,off";;\
\
  $TPL{rollicon} = "iconLabel,on,fts_shutter_10,";;\
  $TPL{rollicon} .= "33,fts_shutter_30,";;\
  $TPL{rollicon} .= "66,fts_shutter_60,";;\
  $TPL{rollicon} .= "off,fts_shutter_100";;\
  \
  $TPL{iconsw} = "iconSwitch,on,fts_shutter_10\@grey,";;\
  $TPL{iconsw} .= "33,fts_shutter_30\@red,";;\
  $TPL{iconsw} .= "66,fts_shutter_60\@black,";;\
  $TPL{iconsw} .= "off,fts_shutter_100\@blue";;\
\
  $TPL{azimut} = "knob,min:0,max:360,width:50,height:50,step:1,lineCap:round,angleOffset:180,cursor:3,thickness:.3";;\
  $TPL{temp} = "selectnumbers,15,.5,25,1,lin";;\
  $TPL{sonne} = "selectnumbers,1,.0625,140000,0,log10";;\
  $TPL{wait} = "selectnumbers,0,60,1800,0,lin";;\
\
  $TPL{onoff} = "iconSwitch,on,off,off,on";;\
  \
  $TR{0} = "class='odd' style='font-weight:bold'";;\
  $TD{0}{0} = "colspan=2 style='border-right-style:solid;; border-right-width:1px'";;\
  $TD{1}{1} = "style='border-right-style:solid;; border-right-width:1px'";;\
  $TD{1}{5} = "colspan=2";;\
  $TD{2,4,6,8,10}{1} = "rowspan=2 style='border-right-style:solid;; border-right-width:1px'";;\
  $TD{2,4,6,8,10}{0,2..5} = "rowspan=2";;\
  $TD{0}{1} = "colspan=7";;\
  $TD{12,15}{0} = "colspan=4";;\
  $TD{14}{1} = "colspan=3"\
}\
"Manuell"|"Sonnenschutz"\
"Raum"|"Pos"|"Azi<sub>Ein</sub>/°"|"Azi<sub>Aus</sub>/°"|\
"Tin<sub>Ein</sub>/°C"|"Tout<sub>Ein</sub>/°C"|"Sonne/lx"|"Tverz/s"\
\
"Wohnen"|WID([$SELF:Wohnen],$TPL{position})|\
WID([$SELF:W_azi_on],$TPL{azimut})|WID([$SELF:W_azi_off],$TPL{azimut})|\
WID([$SELF:W_temp_ion],$TPL{temp})|WID([$SELF:W_temp_aon],$TPL{temp})|\
"Ein"|WID([$SELF:W_sonne_on],$TPL{sonne})|WID([$SELF:W_verz_on],$TPL{wait})\
"Aus"|WID([$SELF:W_sonne_off],$TPL{sonne})|WID([$SELF:W_verz_off],$TPL{wait})\
\
"Bad"|WID([$SELF:Bad],$TPL{position})|\
WID([$SELF:B_azi_on],$TPL{azimut})|WID([$SELF:B_azi_off],$TPL{azimut})|\
WID([$SELF:B_temp_ion],$TPL{temp})|WID([$SELF:B_temp_aon],$TPL{temp})|\
"Ein"|WID([$SELF:B_sonne_on],$TPL{sonne})|WID([$SELF:B_verz_on],$TPL{wait})\
"Aus"|WID([$SELF:B_sonne_off],$TPL{sonne})|WID([$SELF:B_verz_off],$TPL{wait})\
\
"Küche"|WID([$SELF:Kueche],$TPL{position})|\
WID([$SELF:K_azi_on],$TPL{azimut})|WID([$SELF:K_azi_off],$TPL{azimut})|\
WID([$SELF:K_temp_ion],$TPL{temp})|WID([$SELF:K_temp_aon],$TPL{temp})|\
"Ein"|WID([$SELF:K_sonne_on],$TPL{sonne})|WID([$SELF:K_verz_on],$TPL{wait})\
"Aus"|WID([$SELF:K_sonne_off],$TPL{sonne})|WID([$SELF:K_verz_off],$TPL{wait})\
\
"Schlafen"|WID([$SELF:Schlafen],$TPL{position})|\
WID([$SELF:S_azi_on],$TPL{azimut})|WID([$SELF:S_azi_off],$TPL{azimut})|\
WID([$SELF:S_temp_ion],$TPL{temp})|WID([$SELF:S_temp_aon],$TPL{temp})|\
"Ein"|WID([$SELF:S_sonne_on],$TPL{sonne})|WID([$SELF:S_verz_on],$TPL{wait})\
"Aus"|WID([$SELF:S_sonne_off],$TPL{sonne})|WID([$SELF:S_verz_off],$TPL{wait})\
\
"Kind"|WID([$SELF:Kind],$TPL{position})|\
WID([$SELF:Ki_azi_on],$TPL{azimut})|WID([$SELF:Ki_azi_off],$TPL{azimut})|\
WID([$SELF:Ki_temp_ion],$TPL{temp})|WID([$SELF:Ki_temp_aon],$TPL{temp})|\
"Ein"|WID([$SELF:Ki_sonne_on],$TPL{sonne})|WID([$SELF:Ki_verz_off],$TPL{wait})\
"Aus"|WID([$SELF:Ki_sonne_off],$TPL{sonne})|WID([$SELF:Ki_verz_on],$TPL{wait})

setstate RollStrg cmd_1
setstate RollStrg 2017-11-26 16:21:31 B_azi_off 249
setstate RollStrg 2017-10-28 18:59:54 B_azi_on 80
setstate RollStrg 2017-10-24 23:35:46 B_sonne_off 27384
setstate RollStrg 2017-10-24 23:34:57 B_sonne_on 48697
setstate RollStrg 2017-10-24 23:37:33 B_temp_aon 18.0
setstate RollStrg 2017-10-24 23:36:54 B_temp_ion 23.0
setstate RollStrg 2017-10-24 23:36:32 B_verz_off 1200
setstate RollStrg 2017-10-24 23:36:07 B_verz_on 300
setstate RollStrg 2017-11-13 09:59:22 K_azi_off 80
setstate RollStrg 2017-10-24 21:11:32 K_azi_on 98
setstate RollStrg 2017-10-24 23:36:00 K_sonne_off 27384
setstate RollStrg 2017-10-24 23:35:10 K_sonne_on 48697
setstate RollStrg 2017-10-24 23:37:36 K_temp_aon 17.5
setstate RollStrg 2017-10-24 23:36:58 K_temp_ion 23.0
setstate RollStrg 2017-10-24 23:36:36 K_verz_off 1140
setstate RollStrg 2017-10-24 23:36:13 K_verz_on 300
setstate RollStrg 2017-11-25 01:44:23 Ki_azi_off 258
setstate RollStrg 2017-10-28 18:59:53 Ki_azi_on 91
setstate RollStrg 2017-10-24 21:12:20 Ki_sonne_off 27384
setstate RollStrg 2017-10-24 21:11:50 Ki_sonne_on 48697
setstate RollStrg 2017-10-24 21:12:37 Ki_temp_aon 17.5
setstate RollStrg 2017-10-24 21:12:32 Ki_temp_ion 23.0
setstate RollStrg 2017-10-24 21:12:05 Ki_verz_off 300
setstate RollStrg 2017-10-24 21:12:10 Ki_verz_on 1140
setstate RollStrg 2017-11-25 01:44:23 S_azi_off 219
setstate RollStrg 2017-10-24 21:11:33 S_azi_on 98
setstate RollStrg 2017-10-24 23:35:53 S_sonne_off 23714
setstate RollStrg 2017-10-24 23:35:17 S_sonne_on 48697
setstate RollStrg 2017-10-24 23:37:45 S_temp_aon 18.5
setstate RollStrg 2017-10-24 23:37:13 S_temp_ion 23.0
setstate RollStrg 2017-10-24 23:36:40 S_verz_off 1140
setstate RollStrg 2017-10-24 23:36:17 S_verz_on 300
setstate RollStrg 2017-11-25 01:44:24 W_azi_off 249
setstate RollStrg 2017-10-28 18:59:54 W_azi_on 99
setstate RollStrg 2017-10-24 23:35:40 W_sonne_off 27384
setstate RollStrg 2017-10-24 23:34:45 W_sonne_on 48697
setstate RollStrg 2017-10-24 23:37:30 W_temp_aon 17.5
setstate RollStrg 2017-10-24 23:36:49 W_temp_ion 23.0
setstate RollStrg 2017-10-24 23:36:26 W_verz_off 1140
setstate RollStrg 2017-10-24 23:36:03 W_verz_on 300
setstate RollStrg 2017-11-27 22:47:23 cmd 1
setstate RollStrg 2017-11-27 22:47:23 cmd_event set_cmd_1
setstate RollStrg 2017-11-27 22:47:23 cmd_nr 1
setstate RollStrg 2017-11-27 22:47:23 state cmd_1

ZeitlerW

Moin,

vielen Dank dafür. Da muss ich mich halt selbst um die Logik kümmern.
Das mit der uiTable hilft mir schon sehr weiter.

Heißt das, dass du auch die doif.js erweitert hast?

lG
Wolfgang

Ellert