Hallo zusammen,
ich habe in meiner alten Installation zwei weekdaytimer.
define ElchMorgends WeekdayTimer Elch 06:45:00|on {sunrise_abs('HORIZON=-2',0,"07:15","08:40")}|off
attr ElchMorgends commandTemplate set $NAME $EVENT
attr ElchMorgends room Garten
define ElchAbends WeekdayTimer Elch Mo-So|{sunset_abs('HORIZON=-2',0,"15:30","22:30")}|on Mo-So|23:30|off
attr ElchAbends commandTemplate set $NAME $EVENT
attr ElchAbends room Garten
Für die Neuinstallation dachte ich ich könnte diese zusammenfassen mit:
define ElchTimer WeekdayTimer Elch 06:45:00|on {sunrise_abs( HORIZON=-2 ,0, 07:15 , 08:40 )}|off Mo-So|{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}|on Mo-So|23:30|off
attr ElchTimer commandTemplate set $NAME $EVENT
attr ElchTimer icon time_timer
attr ElchTimer room Garten->hinten
aber so richtig zu funktionieren scheint das nicht, das log wirft mir Fehler wie diesen:
2025.12.09 00:00:05 3: [ElchTimer] Can't modify constant item in scalar assignment at (eval 220172) line 1, near "2 ," syntax error at (eval 220172) line 1, near "07:" Illegal octal digit '8' at (eval 220172) line 1, at end of line >>>{ my $date=1765580405;{sunrise_abs( HORIZON=-2 ,0, 07:15 , 08:40 )}}<<<
2025.12.09 00:00:05 1: ERROR evaluating { my $date=1765407605;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}: Can't modify constant item in scalar assignment at (eval 220173) line 1, near "2 ,"
syntax error at (eval 220173) line 1, near "15:"
2025.12.09 00:00:05 3: [ElchTimer] Can't modify constant item in scalar assignment at (eval 220173) line 1, near "2 ," syntax error at (eval 220173) line 1, near "15:" >>>{ my $date=1765407605;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}<<<
2025.12.09 00:00:05 1: ERROR evaluating { my $date=1765321205;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}: Can't modify constant item in scalar assignment at (eval 220174) line 1, near "2 ,"
syntax error at (eval 220174) line 1, near "15:"
2025.12.09 00:00:05 3: [ElchTimer] Can't modify constant item in scalar assignment at (eval 220174) line 1, near "2 ," syntax error at (eval 220174) line 1, near "15:" >>>{ my $date=1765321205;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}<<<
2025.12.09 00:00:05 1: ERROR evaluating { my $date=1765234805;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}: Can't modify constant item in scalar assignment at (eval 220175) line 1, near "2 ,"
syntax error at (eval 220175) line 1, near "15:"
2025.12.09 00:00:05 3: [ElchTimer] Can't modify constant item in scalar assignment at (eval 220175) line 1, near "2 ," syntax error at (eval 220175) line 1, near "15:" >>>{ my $date=1765234805;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}<<<
2025.12.09 00:00:05 1: ERROR evaluating { my $date=1765321205;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}: Can't modify constant item in scalar assignment at (eval 220176) line 1, near "2 ,"
syntax error at (eval 220176) line 1, near "15:"
2025.12.09 00:00:05 3: [ElchTimer] Can't modify constant item in scalar assignment at (eval 220176) line 1, near "2 ," syntax error at (eval 220176) line 1, near "15:" >>>{ my $date=1765321205;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}<<<
2025.12.09 00:00:05 1: ERROR evaluating { my $date=1765407605;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}: Can't modify constant item in scalar assignment at (eval 220177) line 1, near "2 ,"
syntax error at (eval 220177) line 1, near "15:"
2025.12.09 00:00:05 3: [ElchTimer] Can't modify constant item in scalar assignment at (eval 220177) line 1, near "2 ," syntax error at (eval 220177) line 1, near "15:" >>>{ my $date=1765407605;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}<<<
2025.12.09 00:00:05 1: ERROR evaluating { my $date=1765494005;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}: Can't modify constant item in scalar assignment at (eval 220178) line 1, near "2 ,"
syntax error at (eval 220178) line 1, near "15:"
2025.12.09 00:00:05 3: [ElchTimer] Can't modify constant item in scalar assignment at (eval 220178) line 1, near "2 ," syntax error at (eval 220178) line 1, near "15:" >>>{ my $date=1765494005;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}<<<
2025.12.09 00:00:05 1: ERROR evaluating { my $date=1765580405;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}: Can't modify constant item in scalar assignment at (eval 220179) line 1, near "2 ,"
syntax error at (eval 220179) line 1, near "15:"
2025.12.09 00:00:05 3: [ElchTimer] Can't modify constant item in scalar assignment at (eval 220179) line 1, near "2 ," syntax error at (eval 220179) line 1, near "15:" >>>{ my $date=1765580405;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}<<<
2025.12.09 00:00:05 1: ERROR evaluating { my $date=1765234805;{sunrise_abs( HORIZON=-2 ,0, 07:15 , 08:40 )}}: Can't modify constant item in scalar assignment at (eval 220188) line 1, near "2 ,"
syntax error at (eval 220188) line 1, near "07:"
Illegal octal digit '8' at (eval 220188) line 1, at end of line
2025.12.09 00:00:05 3: [ElchTimer] Can't modify constant item in scalar assignment at (eval 220188) line 1, near "2 ," syntax error at (eval 220188) line 1, near "07:" Illegal octal digit '8' at (eval 220188) line 1, at end of line >>>{ my $date=1765234805;{sunrise_abs( HORIZON=-2 ,0, 07:15 , 08:40 )}}<<<
2025.12.09 00:00:05 1: ERROR evaluating { my $date=1765234805;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}: Can't modify constant item in scalar assignment at (eval 220189) line 1, near "2 ,"
syntax error at (eval 220189) line 1, near "15:"
2025.12.09 00:00:05 3: [ElchTimer] Can't modify constant item in scalar assignment at (eval 220189) line 1, near "2 ," syntax error at (eval 220189) line 1, near "15:" >>>{ my $date=1765234805;{sunset_abs( HORIZON=-2 ,0, 15:30 , 22:30 )}}<<<
2025.12.09 00:00:05 3: CUL433 IT_set: Elch off
2025.12.09 00:00:05 3: CUL433 IT_set: Elch on
auch würde ich gerne über ein reading vielleicht ein symbol setzen devstateicon um zu sehen ob ein oder ausgeschaltet.
Gruß
Micha
Ungeprüft fällt auf, dass in der neuen Fassung die Anführungszeichen fehlen...
Dankeschön ;-) das habe ich dann gleich mal ungeprüft korrigiert :-(
sieht jetzt auch besser aus, allerdings wird mir das abendliche Ein- ausschalten nicht angezeigt.
DEF
Elch 06:45:00|on {sunrise_abs('HORIZON=-2',0,"07:15","08:40")}|off Mo-So {sunset_abs('HORIZON=-2',0,"15:30","22:30")}|on Mo-So|23:30|off
DEVICE
Elch
FUUID
6925705a-f33f-be1a-9b8e-450e3bf9854ee7eb
GlobalDaylistSpec
LANGUAGE
en
NAME
ElchTimer
NR
185
Profil 0: Sunday
06:45:00 on, 07:55:44 off,
Profil 1: Monday
06:45:00 on, 07:55:44 off,
Profil 2: Tuesday
06:45:00 on, 07:55:44 off,
Profil 3: Wednesday
06:45:00 on, 07:55:44 off,
Profil 4: Thursday
06:45:00 on, 07:55:44 off,
Profil 5: Friday
06:45:00 on, 07:55:44 off,
Profil 6: Saturday
06:45:00 on, 07:55:44 off,
Gruß
Micha
Vielleicht schaust du dir das noch mal selbst kritisch an...
Vermutlich willst Du mit dem Torpfosten winken https://wiki.fhem.de/wiki/WeekdayTimer und mir sagen das was ich machen will geht gar nicht und ich muss es wieder in eine morgens / abends Variante auftrennen ?!
Zitat von: mfeske am 09 Dezember 2025, 11:27:49Vermutlich willst Du mit dem Torpfosten winken https://wiki.fhem.de/wiki/WeekdayTimer und mir sagen das was ich machen will geht gar nicht und ich muss es wieder in eine morgens / abends Variante auftrennen ?!
Nein. Deine Syntax ist offensichtlich falsch...
Tipp: Einfach mal das Modul YAAHM ansehen.
LG
pah
Zitat von: Prof. Dr. Peter Henning am 09 Dezember 2025, 14:37:32Tipp: Einfach mal das Modul YAAHM ansehen.
LG
pah
Korrigiert das offenkundig kaputte Syntax automatisch?
*duckundweg*
ZitatKorrigiert das offenkundig kaputte Syntax automatisch?
*duckundweg*
Nein, aber da braucht man so etwas auch nicht. Allerdings besteht dann immer noch das Problem der kaputten Rechtschreibung "Morgends"
*duck und Beta-User nach vorne schieb*
pah
Ich habe es leider nicht anders hinbekommen und konnte die beiden nicht in einem vereinen. Es blieb bei den beiden.
ElchTimerMorning
Internals:
COMMAND
CONDITION
DEF Elch 06:45:00|on {sunrise_abs('HORIZON=-2',0,"07:15","08:40")}|off
DEVICE Elch
FUUID 6925705a-f33f-be1a-9b8e-450e3bf9854ee7eb
GlobalDaylistSpec
LANGUAGE en
NAME ElchTimerMorning
NR 174
Profil 0: Sunday 06:45:00 on, 08:08:29 off,
Profil 1: Monday 06:45:00 on, 08:08:29 off,
Profil 2: Tuesday 06:45:00 on, 08:08:29 off,
Profil 3: Wednesday 06:45:00 on, 08:08:29 off,
Profil 4: Thursday 06:45:00 on, 08:08:29 off,
Profil 5: Friday 06:45:00 on, 08:08:29 off,
Profil 6: Saturday 06:45:00 on, 08:08:29 off,
STATE active
STILLDONETIME 0
TYPE WeekdayTimer
eventCount 4
setModifier
READINGS:
2025-12-29 16:51:42 currValue off
2025-12-12 15:11:08 disabled 0
2025-12-29 16:51:42 nextUpdate 2025-12-30 06:45:00
2025-12-29 16:51:42 nextValue on
2025-12-29 16:51:42 state active
SWITCHINGTIMES:
06:45:00|on
{sunrise_abs('HORIZON=-2',0,"07:15","08:40")}|off
TIMER:
ElchTimerMorning_midnight:
HASH ElchTimerMorning
MODIFIER midnight
NAME ElchTimerMorning_midnight
SETTIMERATMIDNIGHT 1
helper:
daysRegExp (su|mo|tu|we|th|fr|sa|\$we|\!\$we)
daysRegExpMessage (su|mo|tu|we|th|fr|sa|$we|!$we)
SWITCHINGTIME:
0:
06:45:00 on
08:08:29 off
1:
06:45:00 on
08:08:29 off
2:
06:45:00 on
08:08:29 off
3:
06:45:00 on
08:08:29 off
4:
06:45:00 on
08:08:29 off
5:
06:45:00 on
08:08:29 off
6:
06:45:00 on
08:08:29 off
WEDAYS:
5 1
6 1
profil:
1:
EPOCH 1766987100
PARA on
TIME 06:45:00
WE_Override
DAYS:
0
1
2
3
4
5
6
2:
EPOCH 1766992109
PARA off
TIME {sunrise_abs('HORIZON=-2',0,"07:15","08:40")}
WE_Override
DAYS:
0
1
2
3
4
5
6
profile_IDX:
0:
06:45:00 1
08:08:29 2
1:
06:45:00 1
08:08:29 2
2:
06:45:00 1
08:08:29 2
3:
06:45:00 1
08:08:29 2
4:
06:45:00 1
08:08:29 2
5:
06:45:00 1
08:08:29 2
6:
06:45:00 1
08:08:29 2
Attributes:
commandTemplate set $NAME $EVENT
disable 0
icon time_timer
room Garten->hintenElchTimerEvening
Internals:
COMMAND
CONDITION
DEF Elch {sunset_abs('HORIZON=-2',0,"15:30","22:30")}|on Mo-So|23:30|off
DEVICE Elch
FUUID 6937fb4e-f33f-be1a-295a-b3d67ba7dcc3752b
GlobalDaylistSpec
LANGUAGE en
NAME ElchTimerEvening
NR 176
Profil 0: Sunday 16:09:15 on, 23:30:00 off,
Profil 1: Monday 16:09:15 on, 23:30:00 off,
Profil 2: Tuesday 16:09:15 on, 23:30:00 off,
Profil 3: Wednesday 16:09:15 on, 23:30:00 off,
Profil 4: Thursday 16:09:15 on, 23:30:00 off,
Profil 5: Friday 16:09:15 on, 23:30:00 off,
Profil 6: Saturday 16:09:15 on, 23:30:00 off,
STATE active
STILLDONETIME 0
TYPE WeekdayTimer
eventCount 4
setModifier
READINGS:
2025-12-29 16:51:42 currValue on
2025-12-29 16:51:42 nextUpdate 2025-12-29 23:30:00
2025-12-29 16:51:42 nextValue off
2025-12-29 16:51:42 state active
SWITCHINGTIMES:
{sunset_abs('HORIZON=-2',0,"15:30","22:30")}|on
0123456|23:30|off
TIMER:
ElchTimerEvening_2:
HASH ElchTimerEvening
MODIFIER 2
NAME ElchTimerEvening_2
ElchTimerEvening_midnight:
HASH ElchTimerEvening
MODIFIER midnight
NAME ElchTimerEvening_midnight
SETTIMERATMIDNIGHT 1
helper:
daysRegExp (su|mo|tu|we|th|fr|sa|\$we|\!\$we)
daysRegExpMessage (su|mo|tu|we|th|fr|sa|$we|!$we)
SWITCHINGTIME:
0:
16:09:15 on
23:30:00 off
1:
16:09:15 on
23:30:00 off
2:
16:09:15 on
23:30:00 off
3:
16:09:15 on
23:30:00 off
4:
16:09:15 on
23:30:00 off
5:
16:09:15 on
23:30:00 off
6:
16:09:15 on
23:30:00 off
WEDAYS:
5 1
6 1
profil:
1:
EPOCH 1767020955
PARA on
TIME {sunset_abs('HORIZON=-2',0,"15:30","22:30")}
WE_Override
DAYS:
0
1
2
3
4
5
6
2:
EPOCH 1767047400
PARA off
TIME 23:30
WE_Override
DAYS:
0
1
2
3
4
5
6
profile_IDX:
0:
16:09:15 1
23:30:00 2
1:
16:09:15 1
23:30:00 2
2:
16:09:15 1
23:30:00 2
3:
16:09:15 1
23:30:00 2
4:
16:09:15 1
23:30:00 2
5:
16:09:15 1
23:30:00 2
6:
16:09:15 1
23:30:00 2
Attributes:
commandTemplate set $NAME $EVENT
icon time_timer
room Garten->hinten
Trotzdem herzlichen Dank Euch und einen guten Rutsch.