Hallo,
ich hab das erste mal das Problem, dass userReadings bei restart verschwinden, hier konkret state1 und state2
define KuRolloRunter at *{Value("SimStopTime")} set ku_rollo_lang g1 on\
attr KuRolloRunter userReadings state1 {(split(" ", ReadingsVal("KuRolloRunter","state","")))[0]}, state2 {(split(" ", ReadingsVal("KuRolloRunter","state","")))[1]}
# CFGFN
# COMMAND set ku_rollo_lang g1 on
#
# DEF *{Value("SimStopTime")} set ku_rollo_lang g1 on
#
# FUUID 6540b464-f33f-b5ae-2110-861c8d25d03b28e4
# NAME KuRolloRunter
# NR 703
# NTM 21:15:00
# PERIODIC yes
# RELATIVE no
# REP -1
# STATE Next: 21:15:00
# TIMESPEC {Value("SimStopTime")}
# TRIGGERTIME 1698783300
# TRIGGERTIME_FMT 2023-10-31 21:15:00
# TYPE at
# eventCount 2
# READINGS:
# 2023-10-31 09:06:04 state Next: 21:15:00
# 2023-10-31 09:06:04 state1 Next:
# 2023-10-31 09:06:04 state2 21:15:00
#
setstate KuRolloRunter Next: 21:15:00
setstate KuRolloRunter 2023-10-31 09:06:04 state Next: 21:15:00
setstate KuRolloRunter 2023-10-31 09:06:04 state1 Next:
setstate KuRolloRunter 2023-10-31 09:06:04 state2 21:15:00
egal dachte ich, dann setze ich sie einfach mittels n_global_INITIALIZED jedesmal beim Neustart neu, geht aber leider nicht :( Geht das so nicht oder ist die Syntax falsch?
define n_global_INITIALIZED notify global:INITIALIZED {\
fhem("set SimStopTime 21:15:00");;\
fhem("set ZufallsTimer_.* inactive");;\
fhem("attr KuRolloRunter userReadings state1 {(split(\" \", ReadingsVal(\"KuRolloRunter\",\"state\",\"\")))[0]}, state2 {(split(\" \", ReadingsVal(\"KuRolloRunter\",\"state\",\"\")))[1]}");;\
}
attr n_global_INITIALIZED room GlobaleVariablen
# DEF global:INITIALIZED {
# fhem("set SimStopTime 21:15:00");
# fhem("set ZufallsTimer_.* inactive");
# fhem("attr KuRolloRunter userReadings state1 {(split(\" \", ReadingsVal(\"KuRolloRunter\",\"state\",\"\")))[0]}, state2 {(split(\" \", ReadingsVal(\"KuRolloRunter\",\"state\",\"\")))[1]}");
#}
# FUUID 64b12357-f33f-b5ae-8c2c-94a6a748a549c727
# NAME n_global_INITIALIZED
# NOTIFYDEV global
# NR 683
# NTFY_ORDER 50-n_global_INITIALIZED
# REGEXP global:INITIALIZED
# STATE 2023-10-31 09:01:31
# TRIGGERTIME 1698739300.43055
# TYPE notify
# READINGS:
# 2023-10-31 09:01:28 state active
# 2023-10-31 09:01:31 triggeredByDev global
# 2023-10-31 09:01:31 triggeredByEvent INITIALIZED
#
setstate n_global_INITIALIZED 2023-10-31 09:01:31
setstate n_global_INITIALIZED 2023-10-31 09:01:28 state active
setstate n_global_INITIALIZED 2023-10-31 09:01:31 triggeredByDev global
setstate n_global_INITIALIZED 2023-10-31 09:01:31 triggeredByEvent INITIALIZED
Solange die userReadings nicht im statefile gespeichert wurden und nach dem restart noch kein event auftrat, der die userReadings wieder neu erzeugt, ist es völlig normal, dass die readings nach einem Neustart nicht mehr vorhanden sind.
Bei mir wird aus diesem Grund das statefile (und nur dieses, nicht die gesamte Konfiguration!) alle 30 Minuten automatisch gespeichert.
Ich lass jetzt das statefile periodisch speichern, trotzdem verschwinden die beiden o.a. userReadings bei restart :o
[code]define saveStateFile at +*00:30:00 {WriteStatefile()}
# COMMAND {WriteStatefile()}
# DEF +*00:30:00 {WriteStatefile()}
# FUUID 6540d0d8-f33f-b5ae-07aa-8611a7cdee122399
# NAME saveStateFile
# NR 703
# NTM 12:52:41
# PERIODIC yes
# RELATIVE yes
# REP -1
# STATE Next: 12:52:41
# TIMESPEC 00:30:00
# TRIGGERTIME 1698753161.90638
# TRIGGERTIME_FMT 2023-10-31 12:52:41
# TYPE at
# READINGS:
# 2023-10-31 12:22:41 state Next: 12:52:41
#
setstate saveStateFile Next: 12:52:41
setstate saveStateFile 2023-10-31 12:22:41 state Next: 12:52:41
[/code]
Hallo,
welches Modul nutzt Du den für das Device KuRolloRunter?
Grüße Jörg
Das ist ein KNX Device, das set ku_rollo_lang g1 on startet das ru terfahren
Zitat von: JoWiemann am 31 Oktober 2023, 12:56:04welches Modul nutzt Du den für das Device KuRolloRunter?
Zitat von: grappa24 am 31 Oktober 2023, 13:14:42Das ist ein KNX Device
Kann man glauben, muss man aber nicht.
Ich behaupte, KuRolloRunter ist ein at.
# NAME KuRolloRunter
...
# TYPE at
"state" wird an vielen Stellen in FHEM mittels regexp speziell behandelt, egal ob da noch eine Zahl dahintersteht oder nicht. Das fängt schon beim Speichern an.
Benenne die doch mal in "status1" und "status2" um und teste, ob das Problem dann auch noch besteht.
Zitat von: betateilchen am 31 Oktober 2023, 13:23:48Benenne die doch mal in "status1" und "status2" um und teste, ob das Problem dann auch noch besteht.
Leider ja ...
Ich habs jetzt im n_global_INITIALIZED untergebracht, da hat nur noch ein "set active" gefehlt, damit die userReadings auch angelegt werden.