Hallo Zusammen,
hier mal eine Funktion zum Überwachen mehrerer Kontakte, ähnlich structure.
Es können beim jeweiligen Status User-Commands ausgeführt werden, bzw. der Rückgabewert für andere Funktionen genutzt werden.
# To use checkContacts define a Dummy for displaying and configuration, and call this function with checkContacts('dummyName')
# define DisplayAndConfigurationDummy dummy
# attr DisplayAndConfigurationDummy userattr searchRegExp checkType goodState:closed,open goodCommand badCommand unknownCommand contactsDelimiter
#
# searchRegExp - the RegExp attr to find the contacts
# checkType - optional type check of device, e.g. CUL_HM
# goodState - optional which state is good, closed or open
# goodCommand,badCommand,unknownCommand - optional if defined commands will be executed on corresponding state, you can use wildcard %contacts% which will be replaced with the corresponding devAlias or if not exists the devName.
# contactsDelimiter - optional delimiter between found devices
#
# returns count of unknown+bad devices, if all is good return is 0
#
Gruß Claudiu
Aus aktuellem Anlass, mal ne aktuelle Version, glaub paar Kleinigkeiten hatten sich geändert...