Autor Thema: ReadingsGroup mit Perl im Attribut  (Gelesen 713 mal)

Offline ms_steini

  • Full Member
  • ***
  • Beiträge: 249
ReadingsGroup mit Perl im Attribut
« am: 05 August 2020, 20:22:36 »
Im AutoShutterControl Wiki gibt es ein ReadingsGroup Beispiel für Zeiten, das habe ich so übernommen und sieht auch ganz gut aus.
defmod rg_ASC_Rolllaeden_Times readingsGroup <Gerät>,<Stand>,<Time_Up_Early  >,<Time_Up_WE  >,<Time_Up_Late  >,<Time_Down_Early>,<Time_Down_Late>,<Mode_Down>,<Mode_Up> (Rollo_.*|Jalousie_.*)..:(level|dim|position),!?ASC_Time_Up_Early,!?ASC_Time_Up_WE_Holiday,!?ASC_Time_Up_Late,!?ASC_Time_Down_Early,!?ASC_Time_Down_Late,!?ASC_Mode_Down,!?ASC_Mode_Up
attr rg_ASC_Rolllaeden_Times commands {level => 'pct:selectnumbers,0,5,100,0,lin', \
dim => 'dim:selectnumbers,0,5,99,0,lin',\
position => 'pct:selectnumbers,0,5,99,0,lin',\
ASC_Mode_Down => 'ASC_Mode_Down:always,absent,off',\
ASC_Mode_Up => 'ASC_Mode_Up:always,absent,off',\
ASC_Time_Down_Early => 'ASC_Time_Down_Early:time', \
ASC_Time_Down_Late  => 'ASC_Time_Down_Late:time',\
ASC_Time_Up_Early => 'ASC_Time_Up_Early:time', \
ASC_Time_Up_Late =>'ASC_Time_Up_Late:time',\
ASC_Time_Up_WE_Holiday =>'ASC_Time_Up_WE_Holiday:time'}
attr rg_ASC_Rolllaeden_Times room Rollladen

In den Attributen ASC_Time_Up_Early  & ASC_Time_Up_Late vom Device habe ich Perl-Code verwendet und da wird in der ReadingsGroup nichts angezeigt, das Feld bleibt leer.
attr EG.Rollo.Buero.Fenster ASC_Time_Up_Early { (ReadingsVal('SchichtplanView', 't_005_summary', '') eq 'Nachtdienst' ? AttrVal('EG.Rollo.Buero.Fenster', 'ASC_Time_Up_Early_shift', ''):'06:00') }
attr EG.Rollo.Buero.Fenster ASC_Time_Up_Early_shift 11:00
attr EG.Rollo.Buero.Fenster ASC_Time_Up_Late { (ReadingsVal('SchichtplanView', 't_005_summary', '') eq 'Nachtdienst' ? AttrVal('EG.Rollo.Buero.Fenster', 'ASC_Time_Up_Late_shift', ''):'09:15') }
attr EG.Rollo.Buero.Fenster ASC_Time_Up_Late_shift 11:15

gibt es da eine elegante Lösung?