Ver Fonte

Add support for MQTT2 reading:
- LWT

erdoking há 7 anos atrás
pai
commit
26c8c232d9

+ 4 - 0
local/share/check_mk/checks/fhem

@@ -170,6 +170,8 @@ def check_fhem(item, params, info):
                 ('fertility',           'fertility',            '',                 '',                1,          1),
                 ('lux',                 'lux',                  'lx',               '',                1,          1),
                 ('moisture',            'moisture',             u'%',               '',                1,          1),
+                ## MQTT2
+                ('LWT',                 'LWT',                  '',                 '',                1,          0),
 
              ##  key                            title                           unit                channel            show        perfd
              ##  -------                        -------                         -------             -------            ----        -----
@@ -409,6 +411,8 @@ factory_settings["fhem_default_params"] = {
         ## MAX!
         "var_mode"                     : ("auto"),         # like controlMode on HomeMatic devices 
         "var_window"                   : ("ignore"),       # like contact on HomeMatic devices
+        ## MQTT2
+        "var_lwt"                      : ("ignore"),       # LWT - the last will
         ## LUXTRONIK2
         "level_ambientTemperature_max"          : (26, 30),         # warn/crit for max. ambientTemperature
         "level_ambientTemperature_min"          : (15, 12),         # warn/crit for min. ambientTemperature

+ 30 - 0
local/share/check_mk/web/plugins/wato/fhem.py

@@ -827,8 +827,38 @@ register_check_parameters(
               )),
 
 
+              ## ----------------------------------------------------
+              ## Sub-category MQTT2
+              ## ----------------------------------------------------
+              ('mqtt2_params', Dictionary(
+               title = "MQTT2",
+               help = _("MQTT2 specific parameter"),
+               allow_empty = False,
+               elements = [
+                       ## LWT - Der Letzte Wille, das Testament (reading)
+                       ("var_lwt",
+                         Alternative(
+                            title = _('LWT (r: LWT)'),
+                            style = "dropdown",
+                            allow_empty = False,
+                            help = _("Check state of reading 'LWT' (default: ignore) "),
+                            elements = [
+                                FixedValue(
+                                    'Online',
+                                    totext = "Online",
+                                    title = _("Online"),
+                                ),
+                                TextAscii(
+                                    title = _("custom"),
+                                    label = _("custom:"),
+                                    size = 50,
+                                ),
+                           ]
 
+                        )),
 
+               ]
+              )),
              ],
             )),