Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. [Gelöst]Blockly zum Schalten des VIS - PC läuft nicht

    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

    [Gelöst]Blockly zum Schalten des VIS - PC läuft nicht

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

      Hallo, ich ein kleines Blockly geschrieben. Die soll bei An-Abmeldung der zwei im Haushalt lebenden Smartphones im Wlan den PC aus- bzw. einschalten. Dieses Miniprogram ist nun wirklich keine Hexerei, aber trotzdem tut es nicht, was es soll. Wenn beide Mobilgeräte außer Haus sind, das erste kommt zurück, fährt der PC hoch. Bei Ankunft des zweiten Gerätes fährt er wieder runter. Der Online State wird vom Unifi Adapter gelesen.
      Aus Übersichtsgründen habe ich beide im Programm in Matthias und Steffi getrennt. Was habe ich falsch gemacht?

      Screenshot 2020-09-24 081834.jpg

      Vielen Dank!

      D UncleSam liv-in-sky 4 Replies Last reply Reply Quote 0
      • D
        Dragon @Matten last edited by

        @Matten ist es möglich, dass in dem javscript.1.wolwin nicht geprüft wird ob das gerät bereits läuft und ein zweiter Befehl das gerät wieder herunterfahren lässt? Es ist so leider nicht möglich zu sagen was da falsch läuft da wir den Inhalt des Skripts nicht kennen.

        M 1 Reply Last reply Reply Quote 0
        • UncleSam
          UncleSam Developer @Matten last edited by

          @Matten Ich bin kein Blockly-Spezialist, aber mir fallen folgende Sachen auf:

          • du verwendest "anerkannt ist egal"; ich würde immer nur auf anerkannte Werte hören
          • 4x kommt "vom Objekt ID is online" vor, hast du da überall die richtigen Objekte erwischt? Ich habe auch den unifi Adapter, aber bei mir gibt es keine Datenpunkte "is online"
          M 1 Reply Last reply Reply Quote 0
          • M
            Matten @Dragon last edited by

            @David-Froebus Es handelt sich nur um einen wake on lan Befehl. Ein Herunterfahren passiert nicht bei doppelter Betätigung.

            Screenshot 2020-09-24 090811.jpg

            Das Script dient nur dazu, wol wieder auf false zu setzen. Ich hatte da irgendwie früher mal ein Problem, dass bei true und erneutem true Kommando nichts passierte.

            1 Reply Last reply Reply Quote 0
            • M
              Matten @UncleSam last edited by

              @UncleSam Zum ersten Punkt, das werde ich probieren. Zu Zweitens, du hast recht das ist verwirrend, die Datenpunkte heißen gleich sind aber anderen Ordnern zugeordnet, ich habe dies geprüft, es handelt sich immer um Steffi oder Matthias im richtigen Kontext.

              Auszug aus dem Unifi Adapter:

              Screenshot 2020-09-24 091413.jpg

              UncleSam 1 Reply Last reply Reply Quote 0
              • liv-in-sky
                liv-in-sky @Matten last edited by

                @Matten

                füge dir ein paar debug blocklys ein - dann siehst du im log besser, wann was wie oft geschalten wird

                M 2 Replies Last reply Reply Quote 0
                • UncleSam
                  UncleSam Developer @Matten last edited by

                  @Matten sagte in Blockly zum Schalten des VIS - PC läuft nicht:

                  es handelt sich immer um Steffi oder Matthias im richtigen Kontext

                  Meine Interpretation:
                  769db1b3-5b29-4521-86c3-7be68a85bd29-image.png

                  Stimmt das?

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    Matten @UncleSam last edited by

                    @UncleSam Ja, alles so richtig...

                    1 Reply Last reply Reply Quote 0
                    • M
                      Matten @liv-in-sky last edited by

                      @liv-in-sky Habe ich jetzt mal getan.

                      1 Reply Last reply Reply Quote 0
                      • M
                        Matten @liv-in-sky last edited by

                        @liv-in-sky Wenn ich jetzt mein wlan abschalte und wieder einschalte kommt der Power Off Befehl, das kann eigentlich nicht sein...

                        liv-in-sky Ralla66 2 Replies Last reply Reply Quote 0
                        • liv-in-sky
                          liv-in-sky @Matten last edited by

                          steffi ist online oder offline ?

                          M 1 Reply Last reply Reply Quote 0
                          • M
                            Matten @liv-in-sky last edited by

                            @liv-in-sky Steffi ist online

                            liv-in-sky 2 Replies Last reply Reply Quote 0
                            • liv-in-sky
                              liv-in-sky @Matten last edited by

                              @Matten poste mal dein blockly als import - dann stelle ich das mal nach

                              M 1 Reply Last reply Reply Quote 0
                              • Ralla66
                                Ralla66 Most Active @Matten last edited by Ralla66

                                @Matten sagte in Blockly zum Schalten des VIS - PC läuft nicht:

                                Wenn ich jetzt mein wlan abschalte und wieder einschalte kommt der Power Off Befehl, das kann eigentlich nicht sein...

                                Datenpunkt Mattes is online ist invertiert ?
                                Der Datenpunkt / Trigger ist Online wird bei außer Haus gehen woher von true nach false geschaltet ?

                                M 1 Reply Last reply Reply Quote 0
                                • liv-in-sky
                                  liv-in-sky @Matten last edited by

                                  @Matten

                                  habe es mal nachgebaut - funktioniert ohne probleme - da stimmt etwas anderes nicht - iobroker neustart oder zumindest mal javascript instanz neustart

                                  beide hier abgebildete versionen funktionieren

                                  Image 1.png

                                  1 Reply Last reply Reply Quote 0
                                  • M
                                    Matten @Ralla66 last edited by

                                    @Ralla66 das passiert vom Unifi Adapter, wenn das Wlan des Handys fehlt schaltet er auf false

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      Matten @liv-in-sky last edited by Negalein

                                      @liv-in-sky

                                      <xml xmlns="https://developers.google.com/blockly/xml">
                                        <variables>
                                          <variable type="timeout" id="timeout">timeout</variable>
                                          <variable type="timeout" id="timeout2">timeout2</variable>
                                        </variables>
                                        <block type="comment" id=")qGpr$[Qn*!U*GHK]V@k" x="288" y="-537">
                                          <field name="COMMENT">Matthias</field>
                                          <next>
                                            <block type="on" id="gQuJp%K/1t*}GbAe!/|X">
                                              <field name="OID">unifi.0.default.clients.e0:24:81:44:5c:59.is_online</field>
                                              <field name="CONDITION">ne</field>
                                              <field name="ACK_CONDITION">true</field>
                                              <statement name="STATEMENT">
                                                <block type="controls_if" id="8S0hycGvH`g+}xL4qcw0">
                                                  <value name="IF0">
                                                    <block type="logic_operation" id="/1-rP25[{9({~-t0`AZs">
                                                      <field name="OP">AND</field>
                                                      <value name="A">
                                                        <block type="time_compare" id="qx#XnbNL],av9TV#ibuF">
                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="false"></mutation>
                                                          <field name="OPTION">&gt;</field>
                                                          <field name="START_TIME">07:00</field>
                                                        </block>
                                                      </value>
                                                      <value name="B">
                                                        <block type="time_compare" id="tHaC-``UO`LXIHzMA2`|">
                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="false"></mutation>
                                                          <field name="OPTION">&lt;</field>
                                                          <field name="START_TIME">23:59</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <statement name="DO0">
                                                    <block type="timeouts_settimeout" id="@*=y.va%1kT-IC4P].h2">
                                                      <field name="NAME">timeout</field>
                                                      <field name="DELAY">5</field>
                                                      <field name="UNIT">sec</field>
                                                      <statement name="STATEMENT">
                                                        <block type="controls_if" id="G-q0IjA=FvR6eH)Ztfe^">
                                                          <mutation else="1"></mutation>
                                                          <value name="IF0">
                                                            <block type="logic_compare" id="AZHnL*58nEPd;XwK)5(^">
                                                              <field name="OP">EQ</field>
                                                              <value name="A">
                                                                <block type="logic_operation" id="n*}P,~qpyRvR_w5nEaTt">
                                                                  <field name="OP">AND</field>
                                                                  <value name="A">
                                                                    <block type="logic_compare" id="Q^Q%#mOHP#)5^nG{]UK_">
                                                                      <field name="OP">EQ</field>
                                                                      <value name="A">
                                                                        <block type="get_value" id="*{-oM3eSj=ESwLg.K$5A">
                                                                          <field name="ATTR">val</field>
                                                                          <field name="OID">unifi.0.default.clients.e0:24:81:44:5c:59.is_online</field>
                                                                        </block>
                                                                      </value>
                                                                      <value name="B">
                                                                        <block type="logic_boolean" id="SrD68:uvK+bK8qA{[Kxo">
                                                                          <field name="BOOL">FALSE</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                  <value name="B">
                                                                    <block type="get_value" id="Dr]6!,B-CPm0?4Jn,-s]">
                                                                      <field name="ATTR">val</field>
                                                                      <field name="OID">unifi.0.default.clients.2c:78:0e:ad:07:f2.is_online</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <block type="logic_boolean" id=")[Ic{tmRL)Qw9);7Z6;/">
                                                                  <field name="BOOL">FALSE</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <statement name="DO0">
                                                            <block type="control" id="~H6pG:kXa0%haT$lQ1KY">
                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                              <field name="OID">windows-control.0.SmartHomePC.poweroff</field>
                                                              <field name="WITH_DELAY">FALSE</field>
                                                              <value name="VALUE">
                                                                <block type="logic_boolean" id="A^NBEYRN46h6d8PsP*!s">
                                                                  <field name="BOOL">TRUE</field>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="debug" id="V*FKcAR,o}7nfD6.$U_W">
                                                                  <field name="Severity">warn</field>
                                                                  <value name="TEXT">
                                                                    <shadow type="text" id="`d(xE(Dnq2Cf8T!rhnG.">
                                                                      <field name="TEXT">Poweroff wahr</field>
                                                                    </shadow>
                                                                  </value>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </statement>
                                                          <statement name="ELSE">
                                                            <block type="control" id="TO78$MiHb/JwF0TtBN*S">
                                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                              <field name="OID">javascript.1.wol.wolwin</field>
                                                              <field name="WITH_DELAY">FALSE</field>
                                                              <value name="VALUE">
                                                                <block type="logic_boolean" id="AWnm_d~yHU~X)M4$gkEk">
                                                                  <field name="BOOL">TRUE</field>
                                                                </block>
                                                              </value>
                                                              <next>
                                                                <block type="debug" id="#G.?x^8J=%cD+2dP!OT4">
                                                                  <field name="Severity">warn</field>
                                                                  <value name="TEXT">
                                                                    <shadow type="text" id="$Bx,+RO?$QQQW}KB%lxO">
                                                                      <field name="TEXT">wol wahr</field>
                                                                    </shadow>
                                                                  </value>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </statement>
                                                        </block>
                                                      </statement>
                                                    </block>
                                                  </statement>
                                                </block>
                                              </statement>
                                              <next>
                                                <block type="comment" id="Ehy/w?q_030:Y(9vXi5q">
                                                  <field name="COMMENT">Steffi</field>
                                                  <next>
                                                    <block type="on" id="J!3{d{~W|n$b#ymJIBK#">
                                                      <field name="OID">unifi.0.default.clients.2c:78:0e:ad:07:f2.is_online</field>
                                                      <field name="CONDITION">ne</field>
                                                      <field name="ACK_CONDITION">true</field>
                                                      <statement name="STATEMENT">
                                                        <block type="controls_if" id="J1Zk6-|-G8.g2T)!VP}[">
                                                          <value name="IF0">
                                                            <block type="logic_operation" id="lZT7)zR@E4Es=(_vw;m8">
                                                              <field name="OP">AND</field>
                                                              <value name="A">
                                                                <block type="time_compare" id="cOivF)(gLh/#SJVfTI`1">
                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="false"></mutation>
                                                                  <field name="OPTION">&gt;</field>
                                                                  <field name="START_TIME">07:00</field>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <block type="time_compare" id="%`@uXTOwOBI_7*d?SuoC">
                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="false"></mutation>
                                                                  <field name="OPTION">&lt;</field>
                                                                  <field name="START_TIME">23:59</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <statement name="DO0">
                                                            <block type="timeouts_settimeout" id="p$ZxSSSNKhBG0biUx0o(">
                                                              <field name="NAME">timeout2</field>
                                                              <field name="DELAY">5</field>
                                                              <field name="UNIT">sec</field>
                                                              <statement name="STATEMENT">
                                                                <block type="controls_if" id="v11b_kPJ[XI7$q^nnRi!">
                                                                  <mutation else="1"></mutation>
                                                                  <value name="IF0">
                                                                    <block type="logic_compare" id="$tYu`M)fL+rNGt7kw#!5">
                                                                      <field name="OP">EQ</field>
                                                                      <value name="A">
                                                                        <block type="logic_operation" id="K]8062qA2`GWIx~=#H!?">
                                                                          <field name="OP">AND</field>
                                                                          <value name="A">
                                                                            <block type="logic_compare" id="o^`bReGj.FR-+rX9r1U*">
                                                                              <field name="OP">EQ</field>
                                                                              <value name="A">
                                                                                <block type="get_value" id="|D_`ap7aIy+b.LZPq,j+">
                                                                                  <field name="ATTR">val</field>
                                                                                  <field name="OID">unifi.0.default.clients.e0:24:81:44:5c:59.is_online</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="B">
                                                                                <block type="logic_boolean" id="[a.)u^?RVSmp9XuLA}xY">
                                                                                  <field name="BOOL">FALSE</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                          <value name="B">
                                                                            <block type="get_value" id="=s3$XIv[i8*8EBydLqsj">
                                                                              <field name="ATTR">val</field>
                                                                              <field name="OID">unifi.0.default.clients.2c:78:0e:ad:07:f2.is_online</field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                      <value name="B">
                                                                        <block type="logic_boolean" id="xv;p|Zg{0|ZPbN}?MhZw">
                                                                          <field name="BOOL">FALSE</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </value>
                                                                  <statement name="DO0">
                                                                    <block type="control" id="5h-D{VZ?;b8E:-x@4T1I">
                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                      <field name="OID">windows-control.0.SmartHomePC.poweroff</field>
                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                      <value name="VALUE">
                                                                        <block type="logic_boolean" id="}9nsQ[{u[79_mS+YB]qx">
                                                                          <field name="BOOL">TRUE</field>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="debug" id="YizH(]dv@y:H`x+X:L.*">
                                                                          <field name="Severity">warn</field>
                                                                          <value name="TEXT">
                                                                            <shadow type="text" id="v@xjbmvhXW*-vr(;6%04">
                                                                              <field name="TEXT">poweroff steffi wahr</field>
                                                                            </shadow>
                                                                          </value>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </statement>
                                                                  <statement name="ELSE">
                                                                    <block type="control" id="K8U}y!]dF9/Wlx7y)ET9">
                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                      <field name="OID">javascript.1.wol.wolwin</field>
                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                      <value name="VALUE">
                                                                        <block type="logic_boolean" id="R#-b`kSpa__2{$6r`Qqs">
                                                                          <field name="BOOL">TRUE</field>
                                                                        </block>
                                                                      </value>
                                                                      <next>
                                                                        <block type="debug" id=":-eCEb-K6xWfSiVnwmf5">
                                                                          <field name="Severity">warn</field>
                                                                          <value name="TEXT">
                                                                            <shadow type="text" id="{eE{6ViZcc4bbn%tG9Ed">
                                                                              <field name="TEXT">wol steffi wahr</field>
                                                                            </shadow>
                                                                          </value>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </statement>
                                                                </block>
                                                              </statement>
                                                            </block>
                                                          </statement>
                                                        </block>
                                                      </statement>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </xml>
                                      

                                      Wlan Handy abgeschaltet: Debug: wol true ist wahr
                                      Javascript habe ich neu gestartet, iobroker mache ich dann jetzt noch mal.


                                      Mod-Edit: Code/Log in Code Tags gepackt. Bitte benutzt die Code Tags Funktion -> </>
                                      Hier gehts zur Hilfe.

                                      liv-in-sky 1 Reply Last reply Reply Quote 0
                                      • liv-in-sky
                                        liv-in-sky @Matten last edited by liv-in-sky

                                        @Matten deine if abfragen sind falsch

                                        bei dir:

                                        Image 2.png

                                        richtig:

                                        Image 3.png

                                        der zweite block ist falsch in der if abfrage - nach dem "und"

                                        1 Reply Last reply Reply Quote 0
                                        • liv-in-sky
                                          liv-in-sky @Matten last edited by

                                          @Matten hier sieht man es besser

                                          Image 4.png

                                          M 1 Reply Last reply Reply Quote 0
                                          • M
                                            Matten @liv-in-sky last edited by

                                            @liv-in-sky Super, ich hatte kurz vor Deinem Hinsweis meinen or Block auf externe Eingänge umstellt und das gesehen was Du mir gezeigt hast. Dabei hatte ich mich vorher schon gewundert, warum der Block so "dick" ist 🙂
                                            Ich danke Dir, es läuft wie es soll!!!!!!

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            404
                                            Online

                                            31.9k
                                            Users

                                            80.2k
                                            Topics

                                            1.3m
                                            Posts

                                            blockly
                                            5
                                            21
                                            810
                                            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