Watchdog - Definition - Anfängerfrage

Begonnen von Bronze, 15 September 2026, 20:46:07

Vorheriges Thema - Nächstes Thema

Bronze

Hallo,

mit diesem Code einer Watchdog-Definition bekomme ich die Fehlermeldung:

WRONG TIMESPEC, must be HH:MM

 [rgr_Bewohner:presence] eq "absent" 00:01 [rgr_Bewohner:presence] eq "present" msg push...

Muss man Klammern setzen?

VG

KölnSolar

Siehst Du da was von eq ?
Zitatdefine <name> watchdog <regexp1> <timespec> <regexp2> <command>

Start an arbitrary FHEM command if after <timespec> receiving an event matching <regexp1> no event matching <regexp2> is received.
The syntax for <regexp1> and <regexp2> is the same as the regexp for notify.
<timespec> is HH:MM[:SS]
<command> is a usual fhem command like used in the at or notify

Examples:
# Request data from the FHT80 _once_ if we do not receive any message for
# 15 Minutes.
define w watchdog FHT80 00:15:00 SAME set FHT80 date
# Request data from the FHT80 _each_ time we do not receive any message for
# 15 Minutes, i.e. reactivate the watchdog after it triggered. Might be
# dangerous, as it can trigger in a loop.
define w watchdog FHT80 00:15:00 SAME set FHT80 date;; trigger w .
# Shout once if the HMS100-FIT is not alive
define w watchdog HMS100-FIT 01:00:00 SAME "alarm-fit.sh"
# Send mail if the window is left open
define w watchdog contact1:open 00:15 contact1:closed "mail_me close window1"
attr w regexp1WontReactivate
Notes:
if <regexp1> is . (dot), then activate the watchdog at definition time. Else it will be activated when the first matching event is received.
<regexp1> resets the timer of a running watchdog, to avoid it use the regexp1WontReactivate attribute.
if <regexp2> is SAME, then it will be the same as the first regexp, and it will be reactivated, when it is received.
trigger <watchdogname> . will activate the trigger if its state is defined, and set it into state defined if its state is active (Next:...) or triggered. You always have to reactivate the watchdog with this command once it has triggered (unless you restart fhem)
a generic watchdog (one watchdog responsible for more devices) is currently not possible.
with modify all parameters are optional, and will not be changed if not specified.
The variables $DEV, $NAME, $EVENT, $EVTPART*, $TYPE and $SELF are available in the executed code, see the notify documentation for details.
RPi5/3/2 Trixie-SamsungAV_E/N-RFXTRX-IT-RSL-NC5462-Oregon-CUL433-GT-TMBBQ-01e-CUL868-FS20-EMGZ-1W(GPIO)-DS18B20-CO2-USBRS232-USBRS422-Betty_Boop-EchoDot-OBIS(Easymeter-Q3/EMH-KW8)-PCA301(S'duino)-Deebot(mqtt2)-ecovacs(mqtt2)-zigbee2mqtt