Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Licht auto schalten während Astrofunktion

    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

    Licht auto schalten während Astrofunktion

    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      Jan1 @snookerap last edited by Jan1

      @Christian-Richter
      Dann musst das bisschen anderes machen.
      Du brauchst ein Trigger, der hier den gewünschten Zeitraum regelmäßig prüft und dann eben die Aktion startet. Hier mal ein Beispiel das alle 5 Minuten prüft und dann was schaltet in der Zeit von nach Sonnenuntergang bis Sonnenaufgang:
      68de8f7f-69a6-4e37-9692-58bc826c9bfc-grafik.png

      Oder eleganter weil nur Reaktion, wenn Licht ausgeschaltet wurde:
      7720b32f-5148-4fe4-a89e-054ac0f780dd-grafik.png

      Hier triggerst auf das Licht welches ausgeschaltet wurde und schaltest es wieder an wenn es aus ist und eben die gewünschte Astrofunktion eintrifft.

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

        Super, vielen Dank 🙂
        Es funktioniert so.

        Habe es jetzt so eingebaut.
        Macht das Sinn, oder ist es sinnvoller für jede Lampe eine eigene Logik zu erstellen?

        Bildschirmfoto vom 2019-12-21 17-13-21.png

        J 1 Reply Last reply Reply Quote 0
        • J
          Jan1 @snookerap last edited by

          @Christian-Richter
          Du kannst den anderen Trigger nehmen, bei dem kannst mehrere Objekte als Trigger eintragen und so sparst Dir den zweiten Teil.
          Vom Prinzip ändert sich nichts, wird nur kürzer und übersichtlicher.

          snookerap 1 Reply Last reply Reply Quote 0
          • snookerap
            snookerap @Jan1 last edited by

            @Jan1 Jetzt ist der Moment gekommen, wo ich auf dem Schlauch stehe... 😞

            Wie meinst du das?

            J 1 Reply Last reply Reply Quote 0
            • J
              Jan1 @snookerap last edited by Jan1

              @Christian-Richter
              Poste mal den Export des Blockly ich baus schnell um. Dann ist der Schlauch schnell Geschichte😉

              snookerap 1 Reply Last reply Reply Quote 0
              • snookerap
                snookerap @Jan1 last edited by

                @Jan1

                <xml xmlns="http://www.w3.org/1999/xhtml">
                <block type="astro" id="p=A_6o!o:P%f2|M{P)K1" x="13" y="63">
                <field name="TYPE">sunrise</field>
                <field name="OFFSET">0</field>
                <statement name="STATEMENT">
                <block type="control" id="83H)Z,U|DiyrwGxqI0u"> <mutation delay_input="false"></mutation> <field name="OID">hm-rpc.1.00085A49901A2E.4.STATE</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="su]GtrQfw9t.zC;RSnQ="> <field name="BOOL">FALSE</field> </block> </value> <next> <block type="control" id="]6bq[cJ8nN}x!I_j]8KI"> <mutation delay_input="true"></mutation> <field name="OID">hm-rpc.1.0008578858B14F.4.STATE</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">1000</field> <field name="UNIT">ms</field> <field name="CLEAR_RUNNING">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="d8yd!3,{!!3dPu{m;~X3"> <field name="BOOL">FALSE</field> </block> </value> </block> </next> </block> </statement> <next> <block type="astro" id="3Vw_(%,(?SdHUy)b]~x)"> <field name="TYPE">sunset</field> <field name="OFFSET">0</field> <statement name="STATEMENT"> <block type="control" id="GW[KRWc$@K[NZ)|5AZu">
                <mutation delay_input="false"></mutation>
                <field name="OID">hm-rpc.1.00085A49901A2E.4.STATE</field>
                <field name="WITH_DELAY">FALSE</field>
                <value name="VALUE">
                <block type="logic_boolean" id="?ly9h8@e{W8dU4[(Vvxh">
                <field name="BOOL">TRUE</field>
                </block>
                </value>
                <next>
                <block type="control" id="6[AN{od.X_N~r*/M@:.y">
                <mutation delay_input="true"></mutation>
                <field name="OID">hm-rpc.1.0008578858B14F.4.STATE</field>
                <field name="WITH_DELAY">TRUE</field>
                <field name="DELAY_MS">1000</field>
                <field name="UNIT">ms</field>
                <field name="CLEAR_RUNNING">FALSE</field>
                <value name="VALUE">
                <block type="logic_boolean" id="ie+Zh0UMP?p:,#.x/3m^">
                <field name="BOOL">TRUE</field>
                </block>
                </value>
                </block>
                </next>
                </block>
                </statement>
                <next>
                <block type="on" id="#H,;Vyhmp:I%@mSXwg;W">
                <field name="OID">hm-rpc.1.00085A49901A2E.4.STATE</field>
                <field name="CONDITION">ne</field>
                <field name="ACK_CONDITION"></field>
                <statement name="STATEMENT">
                <block type="controls_if" id="TDovM)S4|kfe.C@2ReMB">
                <value name="IF0">
                <block type="logic_operation" id="O!2A!wUQ:O%)VK[}$oB2" inline="false">
                <field name="OP">AND</field>
                <value name="A">
                <block type="logic_negate" id="HF#*{_$.9)$a5k:uBT!S">
                <value name="BOOL">
                <block type="on_source" id="ykJd]x6nCad#kP],l10y">
                <field name="ATTR">state.val</field>
                </block>
                </value>
                </block>
                </value>
                <value name="B">
                <block type="time_compare_ex" id="ca]hZgu@,)fNQVyBMEwu" inline="false">
                <mutation end_time="true" actual_time="true"></mutation>
                <field name="USE_ACTUAL_TIME">TRUE</field>
                <field name="OPTION">not between</field>
                <value name="START_TIME">
                <shadow type="text" id="Kbm8X8(@{Qf,Uz|z}v{"> <field name="TEXT">12:00</field> </shadow> <block type="time_astro" id="L44:J_lpJj$wM*(Nv^8H"> <field name="TYPE">sunrise</field> <field name="OFFSET">0</field> </block> </value> <value name="END_TIME"> <shadow type="text" id="L,#,ctod,-]klj.}^Sbm"> <field name="TEXT">18:00</field> </shadow> <block type="time_astro" id="B:lPD*,,pGpJ0_*5lnTT"> <field name="TYPE">sunset</field> <field name="OFFSET">0</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="gli@EH+-]Rj|]X{@MA$z"> <mutation delay_input="false"></mutation> <field name="OID">hm-rpc.1.00085A49901A2E.4.STATE</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id=";T.hQWLYCA3v-ItF!_D">
                <field name="BOOL">TRUE</field>
                </block>
                </value>
                </block>
                </statement>
                </block>
                </statement>
                <next>
                <block type="on" id="Hb!plM.=|O{aI5P_2l-@">
                <field name="OID">hm-rpc.1.0008578858B14F.4.STATE</field>
                <field name="CONDITION">ne</field>
                <field name="ACK_CONDITION"></field>
                <statement name="STATEMENT">
                <block type="controls_if" id="shHC|6zC=Ix/ml+@xCZn">
                <value name="IF0">
                <block type="logic_operation" id="x$y(sR!9K8*#R(,L[0m" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_negate" id="nT1S/:[Q)mp1_d!)6y@*"> <value name="BOOL"> <block type="on_source" id="8$MC@L_.@XZK}d7Vwf?s"> <field name="ATTR">state.val</field> </block> </value> </block> </value> <value name="B"> <block type="time_compare_ex" id="R-T^:vZ)/C;TA]NEbZK4" inline="false"> <mutation end_time="true" actual_time="true"></mutation> <field name="USE_ACTUAL_TIME">TRUE</field> <field name="OPTION">not between</field> <value name="START_TIME"> <shadow type="text" id="Kbm8X8(@{Qf,Uz|z}v{">
                <field name="TEXT">12:00</field>
                </shadow>
                <block type="time_astro" id="GR)?3FeWD~N^2BGjrl!K">
                <field name="TYPE">sunrise</field>
                <field name="OFFSET">0</field>
                </block>
                </value>
                <value name="END_TIME">
                <shadow type="text" id="L,#,ctod,-]klj.}^Sbm">
                <field name="TEXT">18:00</field>
                </shadow>
                <block type="time_astro" id="imU)i`%3gi@6zMqi.Vq9">
                <field name="TYPE">sunset</field>
                <field name="OFFSET">0</field>
                </block>
                </value>
                </block>
                </value>
                </block>
                </value>
                <statement name="DO0">
                <block type="control" id=")e@#v+8wjIq+LH}?qvxJ">
                <mutation delay_input="false"></mutation>
                <field name="OID">hm-rpc.1.0008578858B14F.4.STATE</field>
                <field name="WITH_DELAY">FALSE</field>
                <value name="VALUE">
                <block type="logic_boolean" id="i^y(bV2~b?|uZLv[g[r|">
                <field name="BOOL">TRUE</field>
                </block>
                </value>
                </block>
                </statement>
                </block>
                </statement>
                </block>
                </next>
                </block>
                </next>
                </block>
                </next>
                </block>
                </xml>

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

                  danke schon mal

                  J 1 Reply Last reply Reply Quote 0
                  • J
                    Jan1 @snookerap last edited by Jan1

                    @Christian-Richter

                    <xml xmlns="http://www.w3.org/1999/xhtml">
                      <block type="astro" id="p=A_6o!o:P%f2|M{P)K1" x="-537" y="-462">
                        <field name="TYPE">sunrise</field>
                        <field name="OFFSET">0</field>
                        <statement name="STATEMENT">
                          <block type="control" id="83H)Z,U|DiyrwGxqI0u">
                            <mutation delay_input="false"></mutation>
                            <field name="OID">hm-rpc.1.00085A49901A2E.4.STATE</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="logic_boolean" id="su]GtrQfw9t.zC;RSnQ=">
                                <field name="BOOL">FALSE</field>
                              </block>
                            </value>
                            <next>
                              <block type="control" id="]6bq[cJ8nN}x!I_j]8KI">
                                <mutation delay_input="true"></mutation>
                                <field name="OID">hm-rpc.1.0008578858B14F.4.STATE</field>
                                <field name="WITH_DELAY">TRUE</field>
                                <field name="DELAY_MS">1000</field>
                                <field name="UNIT">ms</field>
                                <field name="CLEAR_RUNNING">FALSE</field>
                                <value name="VALUE">
                                  <block type="logic_boolean" id="d8yd!3,{!!3dPu{m;~X3">
                                    <field name="BOOL">FALSE</field>
                                  </block>
                                </value>
                              </block>
                            </next>
                          </block>
                        </statement>
                        <next>
                          <block type="astro" id="3Vw_(%,(?SdHUy)b]~x)">
                            <field name="TYPE">sunset</field>
                            <field name="OFFSET">0</field>
                            <statement name="STATEMENT">
                              <block type="control" id="GW[KRWc$@K[NZ)|5AZu">
                                <mutation delay_input="false"></mutation>
                                <field name="OID">hm-rpc.1.00085A49901A2E.4.STATE</field>
                                <field name="WITH_DELAY">FALSE</field>
                                <value name="VALUE">
                                  <block type="logic_boolean" id="?ly9h8@e{W8dU4[(Vvxh">
                                    <field name="BOOL">TRUE</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="control" id="6[AN{od.X_N~r*/M@:.y">
                                    <mutation delay_input="true"></mutation>
                                    <field name="OID">hm-rpc.1.0008578858B14F.4.STATE</field>
                                    <field name="WITH_DELAY">TRUE</field>
                                    <field name="DELAY_MS">1000</field>
                                    <field name="UNIT">ms</field>
                                    <field name="CLEAR_RUNNING">FALSE</field>
                                    <value name="VALUE">
                                      <block type="logic_boolean" id="ie+Zh0UMP?p:,#.x/3m^">
                                        <field name="BOOL">TRUE</field>
                                      </block>
                                    </value>
                                  </block>
                                </next>
                              </block>
                            </statement>
                            <next>
                              <block type="on_ext" id="BPEum~CT_;G9/J(wvZ}9">
                                <mutation items="2"></mutation>
                                <field name="CONDITION">ne</field>
                                <field name="ACK_CONDITION"></field>
                                <value name="OID0">
                                  <shadow type="field_oid" id="KiqIBCYP/--Otzi}g~]0">
                                    <field name="oid">default</field>
                                  </shadow>
                                </value>
                                <value name="OID1">
                                  <shadow type="field_oid" id="WaVJhl1|G#mIsAJ=:[[P">
                                    <field name="oid">default</field>
                                  </shadow>
                                </value>
                                <statement name="STATEMENT">
                                  <block type="controls_if" id="TDovM)S4|kfe.C@2ReMB">
                                    <value name="IF0">
                                      <block type="logic_operation" id="O!2A!wUQ:O%)VK[}$oB2" inline="false">
                                        <field name="OP">AND</field>
                                        <value name="A">
                                          <block type="logic_negate" id="HF#*{_$.9)$a5k:uBT!S">
                                            <value name="BOOL">
                                              <block type="on_source" id="ykJd]x6nCad#kP],l10y">
                                                <field name="ATTR">state.val</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="time_compare_ex" id="ca]hZgu@,)fNQVyBMEwu" inline="false">
                                            <mutation end_time="true" actual_time="true"></mutation>
                                            <field name="USE_ACTUAL_TIME">TRUE</field>
                                            <field name="OPTION">not between</field>
                                            <value name="START_TIME">
                                              <shadow type="text" id="Kbm8X8(@{Qf,Uz|z}v{">
                                                <field name="TEXT">12:00</field>
                                              </shadow>
                                              <block type="time_astro" id="L44:J_lpJj$wM*(Nv^8H">
                                                <field name="TYPE">sunrise</field>
                                                <field name="OFFSET">0</field>
                                              </block>
                                            </value>
                                            <value name="END_TIME">
                                              <shadow type="text" id="L,#,ctod,-]klj.}^Sbm">
                                                <field name="TEXT">18:00</field>
                                              </shadow>
                                              <block type="time_astro" id="B:lPD*,,pGpJ0_*5lnTT">
                                                <field name="TYPE">sunset</field>
                                                <field name="OFFSET">0</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <statement name="DO0">
                                      <block type="control" id="gli@EH+-]Rj|]X{@MA$z">
                                        <mutation delay_input="false"></mutation>
                                        <field name="OID">hm-rpc.1.00085A49901A2E.4.STATE</field>
                                        <field name="WITH_DELAY">FALSE</field>
                                        <value name="VALUE">
                                          <block type="logic_boolean" id=";T.hQWLYCA3v-ItF!_D">
                                            <field name="BOOL">TRUE</field>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="control" id=")e@#v+8wjIq+LH}?qvxJ">
                                            <mutation delay_input="false"></mutation>
                                            <field name="OID">hm-rpc.1.0008578858B14F.4.STATE</field>
                                            <field name="WITH_DELAY">FALSE</field>
                                            <value name="VALUE">
                                              <block type="logic_boolean" id="i^y(bV2~b?|uZLv[g[r|">
                                                <field name="BOOL">TRUE</field>
                                              </block>
                                            </value>
                                          </block>
                                        </next>
                                      </block>
                                    </statement>
                                  </block>
                                </statement>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </xml>
                    

                    Code bitte immer im Code Tack posten und bei langem Code, zusätlich im Spoiler posten. Ist leserlicher und spart Platz.

                    Beim Trigger oben einfach die zwei gewünschten Objekte eintragen.

                    snookerap 1 Reply Last reply Reply Quote 0
                    • snookerap
                      snookerap @Jan1 last edited by

                      @Jan1 alles klar.

                      Vielen Dank für deine Mühe!!!

                      👍

                      J 1 Reply Last reply Reply Quote 0
                      • J
                        Jan1 @snookerap last edited by

                        @Christian-Richter
                        schau mal ob das funktioniert, könnte sein, dass es da Probleme gibt, da sich Wert auf den Trigger bezieht und ich weiß nicht wie schlau der Block ist und dann eben auch einen von beiden im Falls Block richtig auswertet. Wenn es nicht läuft, hast zwei Möglichkeiten, Dein altes Blockly verwenden, oder die Falls Bedingung mit nem ODER Block anpassen.

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        518
                        Online

                        31.8k
                        Users

                        80.0k
                        Topics

                        1.3m
                        Posts

                        blockly javascript
                        2
                        11
                        585
                        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