Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Unerklärliches Verhalten meiner Scripte

    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

    Unerklärliches Verhalten meiner Scripte

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

      Ok, ich mache ich. 🙂

      1 Reply Last reply Reply Quote 0
      • U
        UltraJochen last edited by

        Hier ist ein Ausschnitt aus dem log von heute Nacht.

        2019-08-20 05:00:51.711 - info: javascript.0 script.js.common.Licht.NachtlichtKommode: getAstroDate(pattern=sunset, date=Tue Aug 20 2019 05:00:51 GMT+0200 (CEST)) => Tue Aug 20 2019 20:37:33 GMT+0200 (CEST)
        2019-08-20 05:00:51.711 - info: javascript.0 script.js.common.Licht.NachtlichtKommode: setForeignState(id=deconz.0.Lights.5.on, state=false)
        2019-08-20 05:00:51.716 - info: deconz.0 setLightState: {"on": false} 5 deconz.0.Lights.5.on
        

        Jeweils im 5-Minuten-Turnus (der Aktualisierungsintervall vom Helligkeitssensor) schaltet das Licht. wohl weil das System denkt es wäre 20:37.

        Asgothian 1 Reply Last reply Reply Quote 0
        • Asgothian
          Asgothian Developer @UltraJochen last edited by

          @UltraJochen
          Kannst du bitte mal das aus dem blockly generierte script posten ?

          1 Reply Last reply Reply Quote 0
          • U
            UltraJochen last edited by

            Du meinst als Export?

            <xml xmlns="http://www.w3.org/1999/xhtml">
              <block type="on" id="g+UhoA,!24M((63y#zPd" x="-1712" y="-1012">
                <field name="OID">mqtt.0.LuxWinterG.Sensor_BH1750.Lux</field>
                <field name="CONDITION">any</field>
                <field name="ACK_CONDITION"></field>
                <statement name="STATEMENT">
                  <block type="controls_if" id="X@[;x,?{pO.p-rY_l-]B">
                    <mutation else="1"></mutation>
                    <value name="IF0">
                      <block type="logic_operation" id="zR-Jz8s|9-?2K-[U$t2O" inline="false">
                        <field name="OP">AND</field>
                        <value name="A">
                          <block type="time_compare_ex" id="m7w`Wn:88^2ZpJUUT(eW">
                            <mutation end_time="true" actual_time="true"></mutation>
                            <field name="USE_ACTUAL_TIME">TRUE</field>
                            <field name="OPTION">between</field>
                            <value name="START_TIME">
                              <shadow type="text" id="lSP%zSv}GiqI1Gmos-Q3">
                                <field name="TEXT">22:08</field>
                              </shadow>
                              <block type="time_astro" id="0dVzfV*R]+A;nZBqnNup">
                                <field name="TYPE">sunset</field>
                                <field name="OFFSET">-120</field>
                              </block>
                            </value>
                            <value name="END_TIME">
                              <shadow type="text" id="]a=5lhd4JFW2$k6J/Bhz">
                                <field name="TEXT">22:00</field>
                              </shadow>
                            </value>
                          </block>
                        </value>
                        <value name="B">
                          <block type="logic_compare" id="10M^V;LR.mi/yD[kfT}c">
                            <field name="OP">LTE</field>
                            <value name="A">
                              <block type="get_value" id="K9zR)-$`w*uIAliM/XZ;">
                                <field name="ATTR">val</field>
                                <field name="OID">mqtt.0.LuxWinterG.Sensor_BH1750.Lux</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="4@/~7.+9Nx$|2@^!d?Ej">
                                <field name="NUM">10</field>
                              </block>
                            </value>
                          </block>
                        </value>
                      </block>
                    </value>
                    <statement name="DO0">
                      <block type="control" id="wWbT4++85c$Gd4MwLTOk">
                        <mutation delay_input="false"></mutation>
                        <field name="OID">deconz.0.Lights.5.bri</field>
                        <field name="WITH_DELAY">FALSE</field>
                        <value name="VALUE">
                          <block type="math_number" id="PD@Pr:0Uk7dG}I9oVccp">
                            <field name="NUM">80</field>
                          </block>
                        </value>
                      </block>
                    </statement>
                    <statement name="ELSE">
                      <block type="control" id="B6([GexicV$OB6r33jLI">
                        <mutation delay_input="false"></mutation>
                        <field name="OID">deconz.0.Lights.5.on</field>
                        <field name="WITH_DELAY">FALSE</field>
                        <value name="VALUE">
                          <block type="logic_boolean" id="e.61YfNps%r2P`16LJR+">
                            <field name="BOOL">FALSE</field>
                          </block>
                        </value>
                      </block>
                    </statement>
                  </block>
                </statement>
              </block>
            </xml>
            
            Asgothian 1 Reply Last reply Reply Quote 0
            • Asgothian
              Asgothian Developer @UltraJochen last edited by

              @UltraJochen Nein, du kannst oben rechts auf den Knopf Screen Shot 2019-08-20 at 18.50.23 .png drücken um den JS code zu lesen

              A.

              U 1 Reply Last reply Reply Quote 0
              • U
                UltraJochen @Asgothian last edited by

                @Asgothian

                ahh, ok

                on({id: "mqtt.0.LuxWinterG.Sensor_BH1750.Lux"/*/LuxWinterG/Sensor_BH1750/Lux*/, change: "any"}, function (obj) {
                  var value = obj.state.val;
                  var oldValue = obj.oldState.val;
                  if (compareTime(getAstroDate("sunset", undefined, -120), '22:00', "between", null) && getState("mqtt.0.LuxWinterG.Sensor_BH1750.Lux").val <= 10) {
                    setState("deconz.0.Lights.5.bri"/*Kommode bri*/, 80);
                  } else {
                    setState("deconz.0.Lights.5.on"/*Kommode on*/, false);
                  }
                });
                
                Asgothian 1 Reply Last reply Reply Quote 0
                • Asgothian
                  Asgothian Developer @UltraJochen last edited by

                  @UltraJochen mm.. das ist die Variante ohne die log ausgaben.. kannst du nochmal die mit den Ausgaben posten ? Das Script sieht erst einmal ok aus.

                  A.

                  1 Reply Last reply Reply Quote 0
                  • U
                    UltraJochen last edited by

                    Achso, die Debug-Option habe ich noch nicht gebaut.
                    Das Script sieht für mich auch ok aus. Um es realistisch zu testen, müsste das angepasste Script dann ja auch die Nacht durchlaufen. Tagsüber (bzw. bis 22:00 funzt es super).

                    Wie ist denn diese Angabe im Log zu verstehen:

                    date=Tue Aug 20 2019 05:00:51 GMT+0200 (CEST)) => Tue Aug 20 2019 20:37:33 GMT+0200 (CEST)
                    
                    Asgothian paul53 2 Replies Last reply Reply Quote 0
                    • Asgothian
                      Asgothian Developer @UltraJochen last edited by

                      @UltraJochen
                      da muss ich passen - ich war davon aus gegangen das die Meldung von einem Logeintrag stammt.

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

                        @UltraJochen:

                        Wie ist denn diese Angabe im Log zu verstehen:

                        getAstroDate() liefert um 5:00 Uhr den Zeitpunkt des Sonnenuntergangs: 20:37:33 MESZ.

                        1 Reply Last reply Reply Quote 0
                        • U
                          UltraJochen last edited by UltraJochen

                          Ok, hier ist ein Eintrag wo sich die Lampe einschaltet:

                          2019-08-20 01:20:38.333 - info: javascript.0 script.js.common.Licht.NachtlichtKommode: getAstroDate(pattern=sunset, date=Tue Aug 20 2019 01:20:38 GMT+0200 (CEST)) => Mon Aug 19 2019 20:39:39 GMT+0200 (CEST)
                          2019-08-20 01:20:38.334 - info: javascript.0 script.js.common.Licht.NachtlichtKommode: getState(id=mqtt.0.LuxWinterG.Sensor_BH1750.Lux, timerId=undefined) => {"val":0,"ack":true,"ts":1566256838332,"q":0,"from":"system.adapter.mqtt.0","user":"system.user.admin","lc":1566240922188}
                          2019-08-20 01:20:38.334 - info: javascript.0 script.js.common.Licht.NachtlichtKommode: setForeignState(id=deconz.0.Lights.5.bri, state=80)
                          2019-08-20 01:20:38.339 - info: deconz.0 setLightState: {"bri": 80, "on": true} 5 deconz.0.Lights.5.bri
                          2019-08-20 01:20:38.341 - info: deconz.0 options: {"url":"http://192.168.178.34:8077/api/80A7A3FC4A/lights/5/state","method":"PUT","headers":"Content-Type\" : \"application/json","body":"{\"bri\": 80, \"on\": true}"}
                          
                          paul53 1 Reply Last reply Reply Quote 0
                          • paul53
                            paul53 @UltraJochen last edited by

                            @UltraJochen sagte:

                            Eintrag wo sich die Lampe einschaltet:

                            Welche Version des JS-Adapters ?

                            1 Reply Last reply Reply Quote 0
                            • U
                              UltraJochen last edited by

                              Müsste 4.1.12 sein.

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

                                @UltraJochen sagte:

                                Müsste 4.1.12 sein.

                                Dann update auf 4.1.14 (in latest).

                                U 1 Reply Last reply Reply Quote 0
                                • U
                                  UltraJochen @paul53 last edited by UltraJochen

                                  @paul53

                                  juut, ist erledigt. Ich bin gespannt, was heute nacht passiert.

                                  Edit: Heute Nacht lief alles wie es sollte. Ich werds die Tage aber noch weiter beobachten.
                                  Vielen Dank für die Hilfe. 🙂

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

                                  Support us

                                  ioBroker
                                  Community Adapters
                                  Donate

                                  860
                                  Online

                                  31.9k
                                  Users

                                  80.1k
                                  Topics

                                  1.3m
                                  Posts

                                  5
                                  24
                                  1261
                                  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