def execute(self, module, input):
     # only possible if we are sleeping
     if getItemState("State_Presence").intValue() == 2:
         # sometimes the "Lights_FF" state switches back and forth for a couple of milliseconds when set "Lights_FF" state to OFF
         if itemLastUpdateOlderThen("State_Presence",
                                    getNow().minusSeconds(5)):
             postUpdate("State_Presence", 1)
             sendNotification(u"System", u"Guten Morgen")
    def execute(self, module, input):
        if getItemState("State_Notify") == ON:
            itemName = input['event'].getItemName()
            item = getItem(itemName)

            group = itemName
            if group.startswith("Door"):
                group = u"Tür"
            else:
                group = u"Fenster"

            sendNotification(
                group,
                u"{} {}".format(item.getLabel(),
                                input['event'].getItemState().toString()))
Esempio n. 3
0
    def execute(self, module, input):
        group = "Fehler"
        active = []

        if getItemState("roomba_status").toString() == "Stuck" or getItemState(
                "roomba_full") == ON:
            active.append("Roomba")

        if getItemState("MowerStatus").intValue() == 7 or getItemState(
                "MowerStatus").intValue() == 8:
            active.append("Mower")

        if len(active) == 0:
            active.append("Alles normal")
            group = "Info"

        msg = ", ".join(active)

        if postUpdateIfChanged("RoboterStatus", msg):
            sendNotification("Roboter " + group, msg)
    def execute(self, module, input):
        group = u"Fehler"
        active = []

        if getItemState("Ventilation_Filter_Error_I").intValue() > 0 \
                or getItemState("Ventilation_Filter_Error_E").intValue() > 0 \
                or getItemState("Ventilation_Error_Message").toString() != "Ok":
            active.append(u"Lüftung")

        if getItemState("Heating_Common_Fault").intValue() > 0:
            active.append(u"Heizung")

        if getItemState("State_Server").intValue() > 1:
            active.append(u"Server")

        refDate = getNow().minusMinutes(1440)  # last 24 hours

        if itemLastUpdateOlderThen("Temperature_FF_Livingroom", refDate) \
                or itemLastUpdateOlderThen("Temperature_FF_Boxroom", refDate) \
                or itemLastUpdateOlderThen("Temperature_FF_Guestroom", refDate) \
                or itemLastUpdateOlderThen("Temperature_FF_GuestWC", refDate) \
                or itemLastUpdateOlderThen("Temperature_FF_Floor", refDate) \
                or itemLastUpdateOlderThen("Temperature_FF_Utilityroom", refDate) \
                or itemLastUpdateOlderThen("Temperature_FF_Garage", refDate) \
                or itemLastUpdateOlderThen("Temperature_SF_Bedroom", refDate) \
                or itemLastUpdateOlderThen("Temperature_SF_Dressingroom", refDate) \
                or itemLastUpdateOlderThen("Temperature_SF_Child1", refDate) \
                or itemLastUpdateOlderThen("Temperature_SF_Child2", refDate) \
                or itemLastUpdateOlderThen("Temperature_SF_Bathroom", refDate) \
                or itemLastUpdateOlderThen("Temperature_SF_Floor", refDate) \
                or itemLastUpdateOlderThen("Temperature_SF_Attic", refDate):
            active.append("Sensors")

        if len(active) == 0:
            active.append(u"Alles normal")
            group = u"Info"

        msg = u", ".join(active)

        if postUpdateIfChanged("MainStatus", msg):
            sendNotification(group, msg)
    def execute(self, module, input):
        itemName = input['event'].getItemName()
        itemState = input['event'].getItemState()

        sendNotification(u"{}".format(itemName), u"{}".format(itemState))

        holgerPhone = itemState if itemName == "State_Holger_Presence" else getItemState(
            "State_Holger_Presence")
        sandraPhone = itemState if itemName == "State_Sandra_Presence" else getItemState(
            "State_Sandra_Presence")

        if holgerPhone == ON or sandraPhone == ON:
            # only possible if we are away
            if getItemState("State_Presence").intValue() == 0:
                postUpdate("State_Presence", 1)
                sendNotification(u"Tür", u"Willkommen")
        else:
            # only possible if we are present and not sleeping
            if getItemState("State_Presence").intValue() == 1:
                postUpdate("State_Presence", 0)
                lightMsg = u" - LICHT an" if getItemState(
                    "Lights_Indoor") != OFF else u""
                windowMsg = u" - FENSTER offen" if getItemState(
                    "Openingcontacts") != CLOSED else u""

                sendNotification(
                    u"Tür", u"Auf Wiedersehen{}{}".format(lightMsg, windowMsg))
 def execute(self, module, input):
     sendNotification("Roomba", getItemState("roomba_StatusFormatted").toString())
 def execute(self, module, input):
     sendNotification("Roomba", u"Es ist ein Fehler aufgetreten")
 def execute(self, module, input):
     sendNotification("Roomba", u"Behälter ist voll")
Esempio n. 9
0
    def execute(self, module, input):
        if itemStateOlderThen("Bell_Last_Change", getNow().minusSeconds(30)):
            sendNotification("Klingel", "Es klingelt",
                             "https://smartmarvin.de/cameraStrasseImage")

        postUpdate("Bell_Last_Change", DateTimeType())