Richtige Reihenfolge der Befehle nach eine templist Änderung

Begonnen von bforpc, 03 März 2016, 10:23:20

Vorheriges Thema - Nächstes Thema

bforpc

Wie oder wo schreibst du dieses Script hind und wie wird es ausgeführt?

bfo

Zitat von: dancatt am 18 März 2016, 15:10:42
Gefallen tut mir das überhaupt nicht. Ich setze das aktuell so um:

sub aktualisiereHeizung($)
{
my($temperaturprofil) = @_;

Log 3, "aktualisiereHeizung() temperaturprofil[$temperaturprofil]";

if ($temperaturprofil eq "Aus") {
fhem("set .*_Clima\$ controlManu off");
                fhem("set 1_02_WZ_Wandthermostat_Climate controlManu off");
} else {
if ($temperaturprofil =~ m/^Sommer/) {
fhem("attr 1_02_WZ_Wandthermostat_Climate tempListTmpl FHEM/SommerKonstant.cfg:1_02_WZ");
fhem("attr 2_03_SZ_Heizungsthermostat_Clima tempListTmpl FHEM/SommerKonstant.cfg:2_03_SZ");
fhem("attr 3_03_M2_Heizungsthermostat_Clima tempListTmpl FHEM/SommerKonstant.cfg:3_03_M2");
if ($temperaturprofil eq "SommerAbwesend") {
fhem("set 1_02_WZ_Wandthermostat_Climate regSet weekPrgSel prog1");
fhem("attr hminfo configTempFile SommerAbwesend.cfg,SommerAnwesend.cfg,SommerArbeit.cfg,WinterAbwesend.cfg,WinterAnwesend.cfg,WinterArbeit.cfg,SommerKonstant.cfg,WinterKonstant.cfg");
} elsif ($temperaturprofil eq "SommerAnwesend") {
fhem("set 1_02_WZ_Wandthermostat_Climate regSet weekPrgSel prog2");
fhem("attr hminfo configTempFile SommerAnwesend.cfg,SommerArbeit.cfg,WinterAbwesend.cfg,WinterAnwesend.cfg,WinterArbeit.cfg,SommerKonstant.cfg,WinterKonstant.cfg,SommerAbwesend.cfg");
} elsif ($temperaturprofil eq "SommerArbeit") {
fhem("set 1_02_WZ_Wandthermostat_Climate regSet weekPrgSel prog3");
fhem("attr hminfo configTempFile SommerArbeit.cfg,WinterAbwesend.cfg,WinterAnwesend.cfg,WinterArbeit.cfg,SommerKonstant.cfg,WinterKonstant.cfg,SommerAbwesend.cfg,SommerAnwesend.cfg");
}
} elsif ($temperaturprofil =~ m/^Winter/) {
fhem("attr 1_02_WZ_Wandthermostat_Climate tempListTmpl FHEM/WinterKonstant.cfg:1_02_WZ");
fhem("attr 2_03_SZ_Heizungsthermostat_Clima tempListTmpl FHEM/WinterKonstant.cfg:2_03_SZ");
fhem("attr 3_03_M2_Heizungsthermostat_Clima tempListTmpl FHEM/WinterKonstant.cfg:3_03_M2");
if ($temperaturprofil eq "WinterAbwesend") {
fhem("set 1_02_WZ_Wandthermostat_Climate regSet weekPrgSel prog1");
fhem("attr hminfo configTempFile WinterAbwesend.cfg,WinterAnwesend.cfg,WinterArbeit.cfg,SommerKonstant.cfg,WinterKonstant.cfg,SommerAbwesend.cfg,SommerAnwesend.cfg,SommerArbeit.cfg");
} elsif ($temperaturprofil eq "WinterAnwesend") {
fhem("set 1_02_WZ_Wandthermostat_Climate regSet weekPrgSel prog2");
fhem("attr hminfo configTempFile WinterAnwesend.cfg,WinterArbeit.cfg,SommerKonstant.cfg,WinterKonstant.cfg,SommerAbwesend.cfg,SommerAnwesend.cfg,SommerArbeit.cfg,WinterAbwesend.cfg");
} elsif ($temperaturprofil eq "WinterArbeit") {
fhem("set 1_02_WZ_Wandthermostat_Climate regSet weekPrgSel prog3");
fhem("attr hminfo configTempFile WinterArbeit.cfg,SommerKonstant.cfg,WinterKonstant.cfg,SommerAbwesend.cfg,SommerAnwesend.cfg,SommerArbeit.cfg,WinterAbwesend.cfg,WinterAnwesend.cfg");
}
}

fhem("set hminfo tempListG restore");
fhem("set .*_Clima\$ controlMode auto");
fhem("save");
}
}


MadMax-FHEM

In die 99_myUtils.pm (oder wie immer du sie ganannt hast ;-)  ) würde ich mal ganz schwer annehmen...

Aber der Frage zu urteilen hast du wohl noch keine...


http://www.fhemwiki.de/wiki/99_myUtils_anlegen
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

bforpc

#17
Jup... kannte ich noch nicht.

Habe es mal überflogen. Wie rufe ich dann eine Routine aus fehm oder Konsole auf (hab diese info nicht in der Anleitung gefunden).

Darüber hinaus ist mir die Syntax  (vermutlich perl) nicht geläufig, so dass mir diese Programmierung nicht viel helfen kann, um meine Temperaturprofile anzupassen.
Gibts da bereits vorgefertigte scripte für das neuladen der templisten?

Bfo

dancatt

Korrekt.

zusätzlich dazu noch ein dummy:

Internals:
   CFGFN
   NAME       dummy_Temperaturprofil
   NR         262
   STATE      WinterAnwesend
   TYPE       dummy
   Readings:
     2016-03-18 09:10:11   state           WinterAnwesend
Attributes:
   icon       sani_heating_temp
   room       0_02_Heizung
   setList    state:uzsuSelectRadio,Aus,SommerAbwesend,SommerAnwesend,SommerArbeit,WinterAbwesend,WinterAnwesend,WinterArbeit
   webCmd     state


und ein doif:

Internals:
   CFGFN
   DEF        ([dummy_Temperaturprofil:""])
({aktualisiereHeizung(ReadingsVal("dummy_Temperaturprofil","state",0))})
DOELSE ()
   NAME       doif_Temperaturprofil
   NR         263
   NTFY_ORDER 50-doif_Temperaturprofil
   STATE      cmd_1
   TYPE       DOIF
   Readings:
     2016-03-18 09:10:11   Device          dummy_Temperaturprofil
     2016-03-18 09:10:19   cmd_event       dummy_Temperaturprofil
     2016-03-18 09:10:19   cmd_nr          1
     2016-03-18 09:10:11   e_dummy_Temperaturprofil_events WinterAnwesend
     2016-03-18 09:10:19   error           {aktualisiereHeizung(ReadingsVal("dummy_Temperaturprofil","state",0))}: configDB saved.
     2016-03-18 09:10:19   state           cmd_1
   Condition:
     0          EventDoIf('dummy_Temperaturprofil',$hash,'',1)
   Devices:
     0           dummy_Temperaturprofil
     all         dummy_Temperaturprofil
   Do:
     0:
       0          {aktualisiereHeizung(ReadingsVal("dummy_Temperaturprofil","state",0))}
     1:
       0
   Helper:
     globalinit 1
     last_timer 0
     sleeptimer -1
   Itimer:
   Regexp:
     All:
   State:
   Trigger:
     all         dummy_Temperaturprofil
Attributes:
   loglevel   6
   room       0_02_Heizung
Cubietruck: FHEM-Server 6.0

Homematic: HM-USB-CFG2, HM-CFG-LAN, HM-LC-SW1-FM, HM-LC-Sw1-Pl-DN-R1, HM-CC-RT-DN, HM-TC-IT-WM-W-EU, HM-SEC-SC-2, HM-SEC-SD, HM-PB-6-WM55

bforpc