Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Dimmfunktion abhängig von Helligkeit

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Dimmfunktion abhängig von Helligkeit

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

      Hallo zusammen,

      ich habe mal wieder eine bescheidene Anfängerfrage zu einem Blockly-Skript.
      Ich habe einen Bewegungsmelder, welcher die Helligkeit in Lux misst.
      Das Skript soll nun, wenn die Beleuchtung eingeschaltet ist, alle 5 Minuten die Helligkeit messen und abhängig davon die Beleuchtungshelligkeit steuern.
      Leider funktioniert die Einstellung nur einmalig beim Einschalten.

      Kann mir hier bitte jemand einen Tipp geben?

      Vielen Dank im Voraus,

      Grüße
      Peter!

      <xml xmlns="http://www.w3.org/1999/xhtml">
        <block type="on_ext" id="65vrs^y*=-79r_P1KxX}" x="-637" y="-62">
          <mutation items="1"></mutation>
          <field name="CONDITION">true</field>
          <field name="ACK_CONDITION"></field>
          <value name="OID0">
            <shadow type="field_oid" id="XN:6kN==Uo0,:+*i_I+.">
              <field name="oid">deconz.0.Lights.2.on</field>
            </shadow>
          </value>
          <statement name="STATEMENT">
            <block type="schedule" id="Q-f4Hp?*SVd(ieNH+_Lj">
              <field name="SCHEDULE">*/2 * * * *</field>
              <statement name="STATEMENT">
                <block type="controls_if" id="S/67{`LjN,*nd[XCivZ*">
                  <value name="IF0">
                    <block type="logic_compare" id="Q3`@6g!jMjW8lp0NuY2S">
                      <field name="OP">GTE</field>
                      <value name="A">
                        <block type="get_value" id="JgR$k|9X^nc,ga{va0*B">
                          <field name="ATTR">val</field>
                          <field name="OID">hm-rpc.1.000D5A499AF69B.1.CURRENT_ILLUMINATION</field>
                        </block>
                      </value>
                      <value name="B">
                        <block type="math_number" id="Pi2RZ=W%:bLYJyndozxK">
                          <field name="NUM">22</field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="control" id="]%+Dm0c,OSK5c80A{~[~">
                      <mutation delay_input="false"></mutation>
                      <field name="OID">deconz.0.Lights.2.level</field>
                      <field name="WITH_DELAY">FALSE</field>
                      <value name="VALUE">
                        <block type="math_number" id=",)=[]4_x~/`TJQTn%f@f">
                          <field name="NUM">0</field>
                        </block>
                      </value>
                    </block>
                  </statement>
                  <next>
                    <block type="controls_if" id="}]X[3l|/`mNBO?Dp*3D%">
                      <value name="IF0">
                        <block type="logic_compare" id="r:^VVE(HXI]-i-ZydbwT">
                          <field name="OP">LTE</field>
                          <value name="A">
                            <block type="get_value" id="@Z5(h{g~5QCRH-9Jx84}">
                              <field name="ATTR">val</field>
                              <field name="OID">hm-rpc.1.000D5A499AF69B.1.CURRENT_ILLUMINATION</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="math_number" id=",|agAv*8fgW1lRtXkP_s">
                              <field name="NUM">20</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO0">
                        <block type="control" id=";[NGi~U8fhBga#H1};C`">
                          <mutation delay_input="false"></mutation>
                          <field name="OID">deconz.0.Lights.2.level</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="math_number" id="f7BW$OEd%nzbl2=?O)ep">
                              <field name="NUM">18</field>
                            </block>
                          </value>
                        </block>
                      </statement>
                      <next>
                        <block type="controls_if" id="]/DOEY.7,TYzmi;[__Z~">
                          <value name="IF0">
                            <block type="logic_compare" id="_(bEz0OC0oP-F|!U$ixv">
                              <field name="OP">LTE</field>
                              <value name="A">
                                <block type="get_value" id="3mjH~e+_t3;Bw=p7U7-9">
                                  <field name="ATTR">val</field>
                                  <field name="OID">hm-rpc.1.000D5A499AF69B.1.CURRENT_ILLUMINATION</field>
                                </block>
                              </value>
                              <value name="B">
                                <block type="math_number" id="%-3yEkpk*;XiJ0q`r]],">
                                  <field name="NUM">15</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <statement name="DO0">
                            <block type="control" id="VgW0X@uE}SpEaz-+bL~Y">
                              <mutation delay_input="false"></mutation>
                              <field name="OID">deconz.0.Lights.2.level</field>
                              <field name="WITH_DELAY">FALSE</field>
                              <value name="VALUE">
                                <block type="math_number" id="~!x?b,hUoilF]nz7$X7@">
                                  <field name="NUM">28</field>
                                </block>
                              </value>
                            </block>
                          </statement>
                          <next>
                            <block type="controls_if" id="gr[D~#j@eC0o~)20Y02i">
                              <value name="IF0">
                                <block type="logic_compare" id="6|?u%m!lR*DGm![4E^f4">
                                  <field name="OP">LTE</field>
                                  <value name="A">
                                    <block type="get_value" id="9!Nw7_bhegIkTrJiz3kG">
                                      <field name="ATTR">val</field>
                                      <field name="OID">hm-rpc.1.000D5A499AF69B.1.CURRENT_ILLUMINATION</field>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <block type="math_number" id="xM+jT|OhVL;i53sOQ-+8">
                                      <field name="NUM">10</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <statement name="DO0">
                                <block type="control" id="FGFmSU(zYAt=]xhkCYaF">
                                  <mutation delay_input="false"></mutation>
                                  <field name="OID">deconz.0.Lights.2.level</field>
                                  <field name="WITH_DELAY">FALSE</field>
                                  <value name="VALUE">
                                    <block type="math_number" id="bIX~e)I2$p!XmL=2Obz#">
                                      <field name="NUM">38</field>
                                    </block>
                                  </value>
                                </block>
                              </statement>
                              <next>
                                <block type="controls_if" id="FSP-ZiSKMlvP3}gO$O)2">
                                  <value name="IF0">
                                    <block type="logic_compare" id="lyP*eND*sJ1ZbucsWeJ(">
                                      <field name="OP">LTE</field>
                                      <value name="A">
                                        <block type="get_value" id="!N.6k4/`%srLD/{%QrQ!">
                                          <field name="ATTR">val</field>
                                          <field name="OID">hm-rpc.1.000D5A499AF69B.1.CURRENT_ILLUMINATION</field>
                                        </block>
                                      </value>
                                      <value name="B">
                                        <block type="math_number" id="!{Yp^/=c?3B`y^D{})aB">
                                          <field name="NUM">6</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <statement name="DO0">
                                    <block type="control" id="R~nqIA{%nYT7GF3xj2N5">
                                      <mutation delay_input="false"></mutation>
                                      <field name="OID">deconz.0.Lights.2.level</field>
                                      <field name="WITH_DELAY">FALSE</field>
                                      <value name="VALUE">
                                        <block type="math_number" id="dn~q|Aei3VW/Tqe-votR">
                                          <field name="NUM">48</field>
                                        </block>
                                      </value>
                                      <next>
                                        <block type="control" id="jZ+)I1XkSm`+TjZ[7=IW">
                                          <mutation delay_input="false"></mutation>
                                          <field name="OID">sonoff.0.DVES_C283AC.POWER</field>
                                          <field name="WITH_DELAY">FALSE</field>
                                          <value name="VALUE">
                                            <block type="logic_boolean" id="A]|o8Is0~Z71lt|^nuuO">
                                              <field name="BOOL">TRUE</field>
                                            </block>
                                          </value>
                                        </block>
                                      </next>
                                    </block>
                                  </statement>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </next>
                </block>
              </statement>
            </block>
          </statement>
        </block>
      </xml>
      
      Meister Mopper 1 Reply Last reply Reply Quote 0
      • Meister Mopper
        Meister Mopper @pema0001 last edited by

        @pema0001 Bitte Screenshot des Blockly, es will ja nicht jeder den Code laden, danke.

        1 Reply Last reply Reply Quote 0
        • P
          pema0001 last edited by

          Das stimmt natürlich, hier das Blockly und vielen Dank für den Hinweis!

          Bild 13.05.20 um 12.14.jpeg

          Homoran 1 Reply Last reply Reply Quote 0
          • Homoran
            Homoran Global Moderator Administrators @pema0001 last edited by

            @pema0001
            Du hast einen Trigger (Zeitplan) innerhalb eines anderen Triggers (Falls)
            So etwas ist allgemein nicht zulässig.

            Tausche den Zeitplan gegen einen Intervall Baustein

            P 1 Reply Last reply Reply Quote 0
            • P
              pema0001 @Homoran last edited by

              Vielen Dank...schon so oft gelesen, dass Trigger in Trigger nicht geht und trotzdem falsch gemacht.

              Homoran 1 Reply Last reply Reply Quote 0
              • Homoran
                Homoran Global Moderator Administrators @pema0001 last edited by

                @pema0001
                Aber einen stop intervall Baustein nicht vergessen.

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

                  @Homoran sagte:

                  Aber einen stop intervall Baustein nicht vergessen.

                  Oder einen "stop Zeitplan", wobei der Zeitplan einen Namen haben muss, der nicht schedule sein darf.

                  Blockly_temp.JPG

                  Homoran 1 Reply Last reply Reply Quote 0
                  • Homoran
                    Homoran Global Moderator Administrators @paul53 last edited by

                    @paul53
                    Musst du jetzt den Sonderfall mit Trigger in Trigger bringen 😉

                    Ein klares "darf nicht" ist manchmal einfacher zu vermitteln

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

                      @Homoran Ist Dein Kommentar so zu verstehen, dass man diesen einen (und nur den und keinen anderen, auf keinen Fall und niemals 😉 ) Trigger in einem Trigger verwenden kann??? Das wäre nicht uncool 🙂

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

                      Support us

                      ioBroker
                      Community Adapters
                      Donate

                      746
                      Online

                      32.0k
                      Users

                      80.4k
                      Topics

                      1.3m
                      Posts

                      5
                      9
                      278
                      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