Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Luftfeuchtigkeit zu hoch Skript

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Luftfeuchtigkeit zu hoch Skript

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

      @totocotonio:

      Kannst du mir sagen warum mein script nicht läuft.

      Nein, ich kann keinen Fehler entdecken. Hoffentlich hast Du es nicht unter der Gruppe global erstellt ? Falls doch, dann ändere es; falls nicht, dann poste bitte den Javascript-Code ohne die letzte Zeile in Code tags.

      EDIT: Den Trigger auf die Luftfeuchte ändere besser auf "wurde geändert", damit nicht unnötig oft getriggert wird.

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

        Hi,

        hier der Code es ist in der Gruppe Common.

        var cnt, Intervall;
        
        on({id: "hm-rpc.0.NEQ1804131.1.HUMIDITY"/*Raumthermostat Badezimmer.HUMIDITY*/, change: "ne"}, function (obj) {
          var value = obj.state.val;
          var oldValue = obj.oldState.val;
          if (getState("hm-rpc.0.OEQ0427990.1.STATE").val == false && (obj.state ? obj.state.val : "") >= 55 && (obj.oldState ? obj.oldState.val : "") < 55) {
            setStateDelayed("alexa2.0.Echo-Devices.G090LF1181350LT7.Commands.speak"/*speak*/, 'Fenster öffnen und Badezimmer Tür schließen', 3000, false);
            console.log('test');
            cnt = 0;
            Intervall = setInterval(function () {
              setStateDelayed("alexa2.0.Echo-Devices.G090LF1181350LT7.Commands.speak"/*speak*/, 'Fenster öffnen und Badezimmer Tür schließen', 3000, false);
              cnt = (typeof cnt == 'number' ? cnt : 0) + 1;
              if (cnt >= 10) {
                (function () {if (Intervall) {clearInterval(Intervall); Intervall = null;}})();
              }
            }, 120000);
          }
        });
        on({id: "hm-rpc.0.OEQ0427990.1.STATE"/*Fenster Badezimmer TFK.STATE*/, val: true}, function (obj) {
          var value = obj.state.val;
          var oldValue = obj.oldState.val;
          (function () {if (Intervall) {clearInterval(Intervall); Intervall = null;}})();
        });
        
        1 Reply Last reply Reply Quote 0
        • paul53
          paul53 last edited by

          Auch im Javascript-Code sind keine Fehler zu erkennen. Gibt das Skript keinen Log "test" aus, wenn sich die Luftfeuchte von < 55 % auf >= 55 % ändert und das Fenster geschlossen ist ? Wie testet Du die Funktion ?

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

            Hi,

            ich teste es indem ich das Raumthermostat anhauche und so die Luftfeuchtigkeit erhöhe.

            Fenster natürlich zu.

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

              @totocotonio:

              ich teste es indem ich das Raumthermostat anhauche und so die Luftfeuchtigkeit erhöhe. `
              Dann sollte es funktionieren, wenn der Grenzwert von 55 %rH das erste Mal überschritten wird. Bau mal ein zusätzliches Debug von Wert vor das falls ein, um zu sehen, welche Werte getriggert werden.

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

                1626_feuchtigkeit.jpg

                So debug eingebaut, Luftfeuchtigkeit "hochgetrieben".

                KEINE Meldung im LOG :roll:

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

                  Um zu sehen, ob überhaupt getriggert wird, setze einen Debug-Block als allererstes in den Trigger (<u>vor</u> falls) und binde an den Debug-Block den Wert des Trigger-Datenpunktes an (nicht einen Text "wert").

                  EDIT: Stelle die Debug-Blöcke auf "info" !

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

                    var cnt, Intervall;
                    
                    on({id: "hm-rpc.0.NEQ1804131.1.HUMIDITY"/*Raumthermostat Badezimmer.HUMIDITY*/, change: "ne"}, function (obj) {
                      var value = obj.state.val;
                      var oldValue = obj.oldState.val;
                      console.debug('');
                      if (getState("hm-rpc.0.OEQ0427990.1.STATE").val == false && (obj.state ? obj.state.val : "") >= 51 && (obj.oldState ? obj.oldState.val : "") <= 51) {
                        console.debug('');
                        setStateDelayed("alexa2.0.Echo-Devices.G090LF1181350LT7.Commands.speak"/*speak*/, 'Luftfeuchtigkeit im Bad zu hoch Fenster öffnen ', 3000, false);
                        cnt = 0;
                        Intervall = setInterval(function () {
                          setStateDelayed("alexa2.0.Echo-Devices.G090LF1181350LT7.Commands.speak"/*speak*/, 'Luftfeuchtigkeit im Bad zu hoch Fenster öffnen ', 3000, false);
                          cnt = (typeof cnt == 'number' ? cnt : 0) + 1;
                          if (cnt >= 5) {
                            (function () {if (Intervall) {clearInterval(Intervall); Intervall = null;}})();
                          }
                        }, 120000);
                      }
                    });
                    on({id: "hm-rpc.0.OEQ0427990.1.STATE"/*Fenster Badezimmer TFK.STATE*/, val: true}, function (obj) {
                      var value = obj.state.val;
                      var oldValue = obj.oldState.val;
                      (function () {if (Intervall) {clearInterval(Intervall); Intervall = null;}})();
                    });
                    

                    1626_feuchtigkeit.jpg

                     <xml xmlns="http://www.w3.org/1999/xhtml"><block type="on" id="tx2BIvKz9i)Mwrq/gkpC" x="138" y="87"><field name="OID">hm-rpc.0.NEQ1804131.1.HUMIDITY</field>
                        <field name="CONDITION">ne</field>
                    
                        <statement name="STATEMENT"><block type="debug" id="1|{ab+|d6u+#X[;(a@t`"><field name="Severity">debug</field>
                            <value name="TEXT"><shadow type="text" id="a6dI2)2Q;Gy`A[R0UM.o"></shadow></value> 
                            <next><block type="controls_if" id="ea;ru#Sj4!t75(Ws{ZQb"><value name="IF0"><block type="logic_operation" id="Cf1IxquXYdsnlyo6mCv-" inline="false"><field name="OP">AND</field>
                                    <value name="A"><block type="logic_compare" id="g,~qc7rzm@K#tv/S-A(h"><field name="OP">EQ</field>
                                        <value name="A"><block type="get_value" id=")4F(.w/ZirY/;vRV;#+U"><field name="ATTR">val</field>
                                            <field name="OID">hm-rpc.0.OEQ0427990.1.STATE</field></block></value> 
                                        <value name="B"><block type="logic_boolean" id="AzW-MV%EKkE3(9P,:n*I"><field name="BOOL">FALSE</field></block></value></block></value> 
                                    <value name="B"><block type="logic_operation" id="h(2wcj=J4e6lQzSKf#dx" inline="false"><field name="OP">AND</field>
                                        <value name="A"><block type="logic_compare" id="p#*o_9ao9M^u4r_;7r;."><field name="OP">GTE</field>
                                            <value name="A"><block type="on_source" id="[WaAWp@KjGU,zEjOFrry"><field name="ATTR">state.val</field></block></value> 
                                            <value name="B"><block type="math_number" id="{?)yQooMPzJ+x]BR5{Z["><field name="NUM">51</field></block></value></block></value> 
                                        <value name="B"><block type="logic_compare" id="{u]C[jk(,a:01jcb~:4Y"><field name="OP">LTE</field>
                                            <value name="A"><block type="on_source" id=":+:|=f.@,~@;_Hh6(|R["><field name="ATTR">oldState.val</field></block></value> 
                                            <value name="B"><block type="math_number" id="C?+iC}K`PBoz^y1Go^k1"><field name="NUM">51</field></block></value></block></value></block></value></block></value> 
                                <statement name="DO0"><block type="debug" id="NJK/?KNU{)C-,XxFcpB("><field name="Severity">debug</field>
                                    <value name="TEXT"><shadow type="text" id="-h#=AT;0nfnzNoExPQYq"></shadow></value> 
                                    <next><block type="control" id=":SQ6@BV=,I!oX!z07MO/"><mutation delay_input="true"></mutation>
                                        <field name="OID">alexa2.0.Echo-Devices.G090LF1181350LT7.Commands.speak</field>
                                        <field name="WITH_DELAY">TRUE</field>
                                        <field name="DELAY_MS">3</field>
                                        <field name="UNIT">sec</field>
                                        <field name="CLEAR_RUNNING">FALSE</field>
                                        <value name="VALUE"><block type="text" id="6)rM~]c9snQTZ|.k#V9p"><field name="TEXT">Luftfeuchtigkeit im Bad zu hoch Fenster öffnen</field></block></value> 
                                        <next><block type="variables_set" id="~_#]M==F0e[,WH_Ff)?c"><field name="VAR">cnt</field>
                                            <value name="VALUE"><block type="math_number" id="yV]kOzu1_Jlm4p-=wS@D"><field name="NUM">0</field></block></value> 
                                            <next><block type="timeouts_setinterval" id="p.E@7|[Sz6n:f-Ev`bik"><field name="NAME">Intervall</field>
                                                <field name="INTERVAL">2</field>
                                                <field name="UNIT">min</field>
                                                <statement name="STATEMENT"><block type="control" id="l6d;^df6}Ewv6l0GSc9B"><mutation delay_input="true"></mutation>
                                                    <field name="OID">alexa2.0.Echo-Devices.G090LF1181350LT7.Commands.speak</field>
                                                    <field name="WITH_DELAY">TRUE</field>
                                                    <field name="DELAY_MS">3</field>
                                                    <field name="UNIT">sec</field>
                                                    <field name="CLEAR_RUNNING">FALSE</field>
                                                    <value name="VALUE"><block type="text" id="NRlEfC/R:(5tby3Lu1Uu"><field name="TEXT">Luftfeuchtigkeit im Bad zu hoch Fenster öffnen</field></block></value> 
                                                    <next><block type="math_change" id="CH,`a@ru/-lYtkRATL4i"><field name="VAR">cnt</field>
                                                        <value name="DELTA"><shadow type="math_number" id="*[e}_pK;(u;^+Lch@G~)"><field name="NUM">1</field></shadow></value> 
                                                        <next><block type="controls_if" id="Q[5j;V)L7yh|NF4J%755"><value name="IF0"><block type="logic_compare" id=".)qf#Cwt#i+*!.@VO.+B"><field name="OP">GTE</field>
                                                                <value name="A"><block type="variables_get" id="x{%i}R=^i=dGuujU#H`,"><field name="VAR">cnt</field></block></value> 
                                                                <value name="B"><block type="math_number" id="kI/+D^m;H|g*tgf6oBCG"><field name="NUM">5</field></block></value></block></value> 
                                                            <statement name="DO0"><block type="timeouts_clearinterval" id="T6Tr*FFDKOL|s(%[Fqo8"><field name="NAME">Intervall</field></block></statement></block></next></block></next></block></statement></block></next></block></next></block></next></block></statement></block></next></block></statement> 
                        <next><block type="on" id=";`,/Xn43pSG8lvR=|[?D"><field name="OID">hm-rpc.0.OEQ0427990.1.STATE</field>
                            <field name="CONDITION">true</field>
                    
                            <statement name="STATEMENT"><block type="timeouts_clearinterval" id="ssYV%YfZ_:-[%Spu9v:q"><field name="NAME">Intervall</field></block></statement></block></next></block></xml> 
                    

                    Ich bin wahrscheinlich zu blöd :x

                    Muss denn vielleicht der "vorherige Wert" kleiner gleich sein.

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

                      493_blockly_log_wert.jpg
                      @totocotonio:

                      Muss denn vielleicht der "vorherige Wert" kleiner gleich sein. `
                      Nein:

                      Wert > Grenzwert UND vorheriger Wert <= Grenzwert

                      oder

                      Wert >= Grenzwert UND vorheriger Wert < Grenzwert

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

                        Versuche es mal hiermit:

                        ! ````
                        <xml xmlns="http://www.w3.org/1999/xhtml"><block type="variables_set" id="L4@{TPImrb~6|Eq,^9s%" x="138" y="63"><field name="VAR">Grenzwert</field>
                        <value name="VALUE"><block type="math_number" id=")H=B7aTy72%KQ%V6abE2"><field name="NUM">51</field></block></value>
                        <next><block type="on" id="tx2BIvKz9i)Mwrq/gkpC"><field name="OID">hm-rpc.0.NEQ1804131.1.HUMIDITY</field>
                        <field name="CONDITION">ne</field>

                            <statement name="STATEMENT"><block type="debug" id="1|{ab+|d6u+#X[;(a@t`"><field name="Severity">log</field>
                                <value name="TEXT"><shadow type="text" id="a6dI2)2Q;Gy`A[R0UM.o"></shadow> 
                                  <block type="on_source" id="kC;MY*-`RkLqLjFw:Vx4"><field name="ATTR">state.val</field></block></value> 
                                <next><block type="controls_if" id="ea;ru#Sj4!t75(Ws{ZQb"><value name="IF0"><block type="logic_operation" id="Cf1IxquXYdsnlyo6mCv-" inline="false"><field name="OP">AND</field>
                                        <value name="A"><block type="logic_compare" id="g,~qc7rzm@K#tv/S-A(h"><field name="OP">EQ</field>
                                            <value name="A"><block type="get_value" id=")4F(.w/ZirY/;vRV;#+U"><field name="ATTR">val</field>
                                                <field name="OID">hm-rpc.0.OEQ0427990.1.STATE</field></block></value> 
                                            <value name="B"><block type="logic_boolean" id="AzW-MV%EKkE3(9P,:n*I"><field name="BOOL">FALSE</field></block></value></block></value> 
                                        <value name="B"><block type="logic_operation" id="h(2wcj=J4e6lQzSKf#dx" inline="false"><field name="OP">AND</field>
                                            <value name="A"><block type="logic_compare" id="p#*o_9ao9M^u4r_;7r;."><field name="OP">GTE</field>
                                                <value name="A"><block type="on_source" id="[WaAWp@KjGU,zEjOFrry"><field name="ATTR">state.val</field></block></value> 
                                                <value name="B"><block type="variables_get" id="PbZbL:ml-]vd^BZ~WybC"><field name="VAR">Grenzwert</field></block></value></block></value> 
                                            <value name="B"><block type="logic_compare" id="{u]C[jk(,a:01jcb~:4Y"><field name="OP">LT</field>
                                                <value name="A"><block type="on_source" id=":+:|=f.@,~@;_Hh6(|R["><field name="ATTR">oldState.val</field></block></value> 
                                                <value name="B"><block type="variables_get" id="@TmDuedVg8a2GF[1^ZEo"><field name="VAR">Grenzwert</field></block></value></block></value></block></value></block></value> 
                                    <statement name="DO0"><block type="debug" id="NJK/?KNU{)C-,XxFcpB("><field name="Severity">log</field>
                                        <value name="TEXT"><shadow type="text" id="-h#=AT;0nfnzNoExPQYq"><field name="TEXT">Grenzwert überschritten bei geschlossenem Fenster</field></shadow></value> 
                                        <next><block type="control" id=":SQ6@BV=,I!oX!z07MO/"><mutation delay_input="true"></mutation>
                                            <field name="OID">alexa2.0.Echo-Devices.G090LF1181350LT7.Commands.speak</field>
                                            <field name="WITH_DELAY">TRUE</field>
                                            <field name="DELAY_MS">3</field>
                                            <field name="UNIT">sec</field>
                                            <field name="CLEAR_RUNNING">FALSE</field>
                                            <value name="VALUE"><block type="text" id="6)rM~]c9snQTZ|.k#V9p"><field name="TEXT">Luftfeuchtigkeit im Bad zu hoch Fenster öffnen</field></block></value> 
                                            <next><block type="variables_set" id="~_#]M==F0e[,WH_Ff)?c"><field name="VAR">cnt</field>
                                                <value name="VALUE"><block type="math_number" id="yV]kOzu1_Jlm4p-=wS@D"><field name="NUM">0</field></block></value> 
                                                <next><block type="timeouts_setinterval" id="p.E@7|[Sz6n:f-Ev`bik"><field name="NAME">Intervall</field>
                                                    <field name="INTERVAL">2</field>
                                                    <field name="UNIT">min</field>
                                                    <statement name="STATEMENT"><block type="control" id="l6d;^df6}Ewv6l0GSc9B"><mutation delay_input="true"></mutation>
                                                        <field name="OID">alexa2.0.Echo-Devices.G090LF1181350LT7.Commands.speak</field>
                                                        <field name="WITH_DELAY">TRUE</field>
                                                        <field name="DELAY_MS">3</field>
                                                        <field name="UNIT">sec</field>
                                                        <field name="CLEAR_RUNNING">FALSE</field>
                                                        <value name="VALUE"><block type="text" id="NRlEfC/R:(5tby3Lu1Uu"><field name="TEXT">Luftfeuchtigkeit im Bad zu hoch Fenster öffnen</field></block></value> 
                                                        <next><block type="math_change" id="CH,`a@ru/-lYtkRATL4i"><field name="VAR">cnt</field>
                                                            <value name="DELTA"><shadow type="math_number" id="*[e}_pK;(u;^+Lch@G~)"><field name="NUM">1</field></shadow></value> 
                                                            <next><block type="controls_if" id="Q[5j;V)L7yh|NF4J%755"><value name="IF0"><block type="logic_compare" id=".)qf#Cwt#i+*!.@VO.+B"><field name="OP">GTE</field>
                                                                    <value name="A"><block type="variables_get" id="x{%i}R=^i=dGuujU#H`,"><field name="VAR">cnt</field></block></value> 
                                                                    <value name="B"><block type="math_number" id="kI/+D^m;H|g*tgf6oBCG"><field name="NUM">5</field></block></value></block></value> 
                                                                <statement name="DO0"><block type="timeouts_clearinterval" id="T6Tr*FFDKOL|s(%[Fqo8"><field name="NAME">Intervall</field></block></statement></block></next></block></next></block></statement></block></next></block></next></block></next></block></statement></block></next></block></statement> 
                            <next><block type="on" id=";`,/Xn43pSG8lvR=|[?D"><field name="OID">hm-rpc.0.OEQ0427990.1.STATE</field>
                                <field name="CONDITION">true</field>
                        
                                <statement name="STATEMENT"><block type="timeouts_clearinterval" id="ssYV%YfZ_:-[%Spu9v:q"><field name="NAME">Intervall</field></block></statement></block></next></block></next></block></xml> 
                        
                        1 Reply Last reply Reply Quote 0
                        • totocotonio
                          totocotonio last edited by

                          Hi,

                          danke für deine Hilfe. 😄

                          Ich installiere es mal und melde mich dann wieder .

                          Schönes Wochenende noch.

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

                            Hi,

                            also das LOG kommt schon mal. 😉

                            Jetzt warte ich mal ab ob auch die Ansage kommt.

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

                              Hi,

                              das Script läuft und funktioniert.

                              Danke für die Hilfe 😉

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

                                Hi, ich muss noch einmal nachhaken.

                                Diese Script läuft bei mir erfolgreich.

                                Nur heute habe ich festgestellt das wenn sich die Luftfeuchtigkeit nicht unter den Schwellwert ändert oder das Fenster aufgemacht wird, das die Durchsage immer weiter durchläuft.

                                Was kann ich denn dort einstellen, wenn ich zum Beispiel nicht zu Hause wäre oder generell das nach 3 durchsagen aufhört.
                                1626_luftfeuchtigkeit.jpg

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

                                  @totocotonio:

                                  das wenn sich die Luftfeuchtigkeit nicht unter den Schwellwert ändert oder das Fenster aufgemacht wird, das die Durchsage immer weiter durchläuft.

                                  Das kann eigentlich nur passieren, wenn die Feuchtigkeit um den Grenzwert schwankt, da andernfalls nach 3 Durchläufen abgebrochen wird.

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

                                    Ja so scheint es zu sein.

                                    Kann ich das Steuern.

                                    Ich habe mir im Moment damit geholfen das das ganze nur bis 22 Uhr geht.

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

                                    Support us

                                    ioBroker
                                    Community Adapters
                                    Donate

                                    600
                                    Online

                                    31.7k
                                    Users

                                    79.9k
                                    Topics

                                    1.3m
                                    Posts

                                    7
                                    33
                                    3357
                                    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