Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Balkontür länger geöffnet

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Balkontür länger geöffnet

    This topic has been deleted. Only users with topic management privileges can see it.
    • amg_666
      amg_666 @lustig29 last edited by

      @lustig29 und wie hast du das bisher umgesetz? Script? Im iobroker oder in homematic?
      Ich hatte so ein ähnliches Problem, dass die Temperatur nach einer gewissen Zeit wieder hochgeht obwohl Fenster noch auf war. Das lag aber an Homematic Logik...

      Also poste mal deine Lösung/deine Scripte dann kann man mal schauen

      L Squelsh 2 Replies Last reply Reply Quote 0
      • L
        lustig29 @amg_666 last edited by

        @amg_666 Screenshot_20201030_160855_com.android.chrome.jpg

        amg_666 Ocrim 2 Replies Last reply Reply Quote 0
        • amg_666
          amg_666 @lustig29 last edited by amg_666

          @lustig29 Hm, sieht eigentlich richtig aus, ich geh mal davon aus, dass deine Merkervariablen alle eindeutig sind, also wirklich eine pro Raum.
          Bau doch in das Skript mal ein paar debug Anweisungen ein, damit du im logfile nachlesen kannst ob ein Schliessen überhaupt erkannt wurde und welchen Wert Merker_Temperatur_xxxx da hat.

          Arbeitest du mit Alias? Bei mir heisst der Datenpunkt vom HM Thermostat anders, SetPointTemperature kenne ich gar nicht:
          hm-rpc.0.LEQxxxxxxx.4.SET_TEMPERATURE

          1 Reply Last reply Reply Quote 0
          • Squelsh
            Squelsh @amg_666 last edited by

            Hi @amg_666,

            ich habe das selbe Prob: Ist ein Fenster lange auf, stellt der Thermostat wieder die hohe Temperatur ein und heizt damit die Umwelt.

            Komischerweise zeigt der Thermostat DENNOCH das Fenstersymbol an. Ich denke daher, dass es nicht an meiner Script-Logik hängt. Der Support von Homatic will damit natürlich nichts zu tun haben, da ich IoBroker einsetze...

            Was war denn bei dir der Fehler?

            VG,
            Andy

            Mein Jave-Script kann ich gerne hier rein packen:

            
            const myRooms = getEnums("rooms");
            
            
            // iterate through all sensors of a room and check, if any window/door is open
            // returns true, if any window is open, false if all windows are closed:
            function isAnyWindowInRoomOpen(str_roomName)
            {
                let anyInRoomOpen = false;
                $('channel[state.id=opened](rooms=' + str_roomName + ')(functions=funcSecurity)').each(function(id) {
            
                        let myObj = getObject(id);
                        let singleSensorState = getState(id);
                        myLog(1, "isAnyWindowInRoomOpen():: " + myObj.common.name + " is " + singleSensorState.val);
            
                        anyInRoomOpen = anyInRoomOpen || singleSensorState.val;
            
                    });
            
                myLog(2, "isAnyWindowInRoomOpen(): " + str_roomName + " has an open window? " + anyInRoomOpen);
                return anyInRoomOpen;
            }
            
            // creates state variables for each room if a window is open
            function setupStates()
            {
                let anyInFlatOpen = false;
                
                for( let myRoom of myRooms)
                {
                    let myRoomName = myRoom.id.split(".")[2];
            
                    let anyInRoomOpen = isAnyWindowInRoomOpen(myRoomName);
                    anyInFlatOpen = anyInFlatOpen || anyInRoomOpen;
            
                    
            
                    myLog(3, "setupStates():: Initializing room " + myRoomName + ".anyWindowOpen to: " + anyInRoomOpen);
                    createState('roomstates.' + myRoomName + '.anyWindowOpen', anyInRoomOpen, true, {
                        read: true,
                        write: true,
                        name: 'Ist ein Fenster geöffnet',
                        desc: 'Ist ein Fenster geöffnet',
                        type: 'boolean'
                    });
                }
            
                myLog(3, "setupStates(): Initializing flatWindowOpen to: " + anyInFlatOpen);
                createState("flatWindowOpen", anyInFlatOpen, true, {
                    read: true, 
                    write: true, 
                    name: "Is true, if any window or door in appartment is open", 
                    type: "boolean", 
                    def: false
                });
            }
            
            // subscribe to all contact sensor changes and set a timer if something changes:
            function setupWindowSubscriptions()
            {
                $('[state.id=opened](functions=funcSecurity)').on(function (obj) {
                    myLog(1, "setupWindowSubscriptions(): Contact " + obj.common.name + " changed to: " + obj.state.val);
                    // reconstruct sensor ID
                    let strArr_splittedId = obj.id.split(".");
                    let uri_sensorId = strArr_splittedId[0] + "." + strArr_splittedId[1] + "." + strArr_splittedId[2];
                    let obj_sensor = getObject(uri_sensorId);
                    
                    setTimeout(reCheckState, shortTimeOpen, uri_sensorId, obj.state.val);
                    
                });
            
            }
            
            
            // triggered short time after window state changes to see, if change is still present
            // if so, toggle the state of the whole room
            function reCheckState(uri_sensorId, bool_stateToCheck)
            {
                let sensorState = getState(uri_sensorId + ".opened");
                //whatIs("checkStillOpen: sensorState = ", sensorState);
                if(sensorState.val == bool_stateToCheck)
                {
                    myLog(2, "reCheckState: State unchanged after " + (shortTimeOpen / 1000) + " seconds.");
                    let obj_room = whichRoom(uri_sensorId);
                    let str_roomName = obj_room.enumIds[0].split(".")[2];
            
                    let bool_roomState = isAnyWindowInRoomOpen(str_roomName);
            
                    setState('javascript.0.roomstates.' + str_roomName + '.anyWindowOpen', bool_roomState);
                    
                } else {
                    myLog(2 ,"reCheckState: State changed within " + (shortTimeOpen / 1000) + " seconds. Ignoring.");
                }
            }
            
            
            function whichRoom(obj) {
                let dp = getObject(obj,"rooms");
                //myLog("room fct: devname = " + obj + " dp " + dp.enumIds[0]);
                return dp;
            }
            
            // monitors if a room's "any window is open" state changed:
            function setupRoomStateSubscriptions()
            {
                // this only triggers if new state != oldState so it ignores false positives.
                // and only sends triggers to the heating, if necessary:
                $('[state.id=anyWindowOpen]').on(function (obj) {
                    reactOnRoomStateChange(obj.id.split(".")[3], obj.state.val);
                });
            
                //perhaps use $ but define any "true" state as trigger.
            }
            
            function reactOnRoomStateChange(room, isAnyWindowOpen)
            {
                myLog(2, "reactOnRoomStateChange(): A window in room " + room + " changed its state. Any window is open? " + isAnyWindowOpen);
                
                let windowInAppartmentOpen = false;
                for( let myRoom of myRooms)
                {
                    let myRoomName = myRoom.id.split(".")[2];
                    let status = getState('roomstates.' + myRoomName + '.anyWindowOpen').val;
                    myLog(1, "reactOnRoomStateChange():: Status of single room " + myRoomName + " is " + status);
                    windowInAppartmentOpen = windowInAppartmentOpen || status;
            
                }
            
                myLog(3, "reactOnRoomStateChange(): Set flatWindowOpen to: " + windowInAppartmentOpen);
                setState("javascript.0.flatWindowOpen", windowInAppartmentOpen);
            
            }
            
            setupStates();
            setupWindowSubscriptions();
            setupRoomStateSubscriptions();
            
            amg_666 L 2 Replies Last reply Reply Quote 0
            • amg_666
              amg_666 @Squelsh last edited by

              @Squelsh Ne, bei mir war es ein simpler Logik-Fehler: Ich steuere meine (Homematic-) Thermostaten über ein Homematic Script und ich hatte da einfach einen logischen Fehler drin: Das Script läuft alle 20 Minuten und hat nicht geprüft ob ein Fenster offen ist. Effekt: Ich öffne z.B. im Bad ein Fenster, dann regelt der Bad-Heizkörper runter. Und nach spätestens 20 Minuten bügelt das Script da drüber und stellt die geplante Temperatur wieder ein.

              Eine Idee habe ich nicht, was bei dir der Fehler sein könnte. Stehen die Thermostate auf "Manu Modus" oder auf "Auto Modus"? Wenn du in HM was mit Skripten "manipulieren" willst, dann sollten die Device auf "Manu" stehen, da hatte ich mal ein Problem, weiss aber nicht ob dir das weiterhilft...

              Squelsh 1 Reply Last reply Reply Quote 0
              • Ocrim
                Ocrim @lustig29 last edited by

                @lustig29
                Wie sieht denn dein Hauptprogramm aus, mit dem du die Thermostate auf die Heiztemperatur setzt?

                Squelsh 1 Reply Last reply Reply Quote 0
                • L
                  lustig29 @Squelsh last edited by

                  @Squelsh Bei mir ist ja das Problem, das bei geöffneter und dann wieder geschlossener Tür die 12 Grad (Fenster offen Temperatur) stehen bleiben und nicht die zuvor eingestellte Raumtemperatur.

                  1 Reply Last reply Reply Quote 0
                  • Squelsh
                    Squelsh @amg_666 last edited by

                    Danke @amg_666! Bisher stelle ich sie nicht auf Manuell um. Das teste ich auf jeden Fall mal.

                    1 Reply Last reply Reply Quote 0
                    • Squelsh
                      Squelsh @Ocrim last edited by

                      Sorry @Ocrim, hatte das falsche Script gepostet. Das was da ist, setzt ein Flag pro Zimmer.
                      Und dieses Script hier reagiert darauf:

                      
                      // monitors if a room's "any window is open" state changed:
                      function setupRoomStateSubscriptions()
                      {
                          // this only triggers if new state != oldState so it ignores false positives.
                          // and only sends triggers to the heating, if necessary:
                          $('[state.id=anyWindowOpen]').on(function (obj) {
                              reactOnRoomStateChange(obj.id.split(".")[3], obj.state.val);
                          });
                      
                          //perhaps use $ but define any "true" state as trigger.
                      }
                      
                      function reactOnRoomStateChange(roomname_str, anyWindowOpen_bool)
                      {
                          myLog(3, "reactOnRoomStateChange(): AnyWindowOpen state of room " + roomname_str + " changed to " + anyWindowOpen_bool)
                          $('channel(rooms=' + roomname_str + ')[state.id=*.WINDOW_STATE](functions=funcHeating)').setState(toInt(anyWindowOpen_bool))
                      }
                      
                      
                      
                      setupRoomStateSubscriptions();
                      
                      

                      Werde da jetzt mal noch einbauen, dass zuerst auf manuellen Modus umgeschaltet wird. Dann Fenster-Status setzen. Vllt hilft das.

                      1 Reply Last reply Reply Quote 0
                      • Squelsh
                        Squelsh last edited by

                        Falls hier jemand in Zukunft das selbe Problem hat: Bei mir hat es geholfen, die temperaturabhängige Fenster-Auf-Erkennung der Thermostate auszuschalten. Das geht in via CCU in den Einstellungen der Homematic IP Thermostate.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        830
                        Online

                        32.0k
                        Users

                        80.4k
                        Topics

                        1.3m
                        Posts

                        4
                        11
                        616
                        Loading More Posts
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes
                        Reply
                        • Reply as topic
                        Log in to reply
                        Community
                        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                        The ioBroker Community 2014-2023
                        logo