Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Basti86

    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

    B
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Best 0
    • Groups 1

    Basti86

    @Basti86

    0
    Reputation
    3
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Basti86 Follow
    Starter

    Latest posts made by Basti86

    • RE: Wake on Lan auf zweite Netzwerkkarte

      Hallo zusammen,

      ich bin jetzt endlich zum weitertesten gekommen.

      Also es liegt definitiv an den Berechtigungen in der sudoers-Datei.

      Ich habe mir mal einen test-User angelegt und für den einen Eintrag in meiner custom_iobroker-Datei gemacht. Der darf dann auch den etherwake-Befehl ohne Passwortabfrage machen. Für den iobroker-Benutzer habe ich das mit:

      sudo -u iobroker sudo /sbin/etherwake -i eth1 xx:xx:xx:1f:12:ab
      

      getestet und dort wurde das Passwort des iobroker-users abgefragt. Ich habe dann den gleichen Eintrag, den ich auch in meiner custom_iobroker-Datei gemacht habe, direkt in der /etc/sudoers.d/iobroker-Datei gemacht und es wird kein Passwort mehr abgefragt. Das Script funktioniert dann.

      Hat einer eine Erklärung dafür warum es nicht mit der custom_iobroker-Datei funktioniert? Ich habe sogar mal testweise

      ALL ALL=(ALL) NOPASSWD: /sbin/etherwake
      

      eingetragen gehabt. Für meinen test-User hat das auch funktioniert. Für den iobroker-User kam weiterhin eine Passwortabfrage. Ich bin verwirrt.
      Aber zur Not lebe ich damit, dass ich die /etc/sudoers.d/iobroker-Datei anpassen muss.

      Grüße und noch einen schönen Sonntag 🙂

      posted in JavaScript
      B
      Basti86
    • RE: Wake on Lan auf zweite Netzwerkkarte

      Hi, danke erstmal für die Antwort!

      Mit welchem Hintergrund ohne Trigger probieren? Ich mein das Script wird ja abgearbeitet. Ich sehe die Einträge in den logs, dass das abgearbeitet wurde.

      @liv-in-sky said in Wake on Lan auf zweite Netzwerkkarte:

      @basti86

      du könntest den exec() mal mit

      sudo -u root etherwake -i eth1 xx:xx:xx:1f:12:ab
      

      probieren

      Der Test bringt mich echt weiter. Anscheinend hatte meine custom_iobroker-Datei wirklich nicht funktioniert. Falsche Berechtigungen für die Datei. Damit wird die dann nicht ausgewertet. Ist wohl das beste wenn man visudo nutzt, um die Datei anzulegen.

      Aktuell klappts trotzdem noch nicht, aber ich werde morgen da mal weiter testen. Ich komme so zumindest weiter. Danke für den Tipp 🙂

      @darkiop said in Wake on Lan auf zweite Netzwerkkarte:

      Schau dir mal mein Blockly hier an:

      <xml xmlns="https://developers.google.com/blockly/xml">
        <variables>
          <variable id="%g/ANJxNOs5Cicx-gOSb">log_info_text</variable>
          <variable id="-r/}hhL0@h;1gaLT?}`b">oid</variable>
          <variable id="6_JJzzeJG!sq.1_eKyW|">delay</variable>
          <variable id="ofh(iD!YW(+.E5!h-H5`">wol_ip</variable>
          <variable id="IT?3aSGqeT+8[51FKL~q">wol_mac</variable>
          <variable id="CgO7**.g^~ROq!;VBXGG">wol_hostname</variable>
          <variable id="@Rx5)VE,|H|,FBCrH4:L">error</variable>
          <variable id="+~qvXTXYsqr5jkS2%jmm">result</variable>
          <variable type="timeout" id="timeout2">timeout2</variable>
          <variable type="timeout" id="sendeWoLDelay">sendeWoLDelay</variable>
          <variable type="timeout" id="timeout">timeout</variable>
        </variables>
        <block type="procedures_defnoreturn" id="Ha@.OsV]W_)8l},9e-%}" x="13" y="13">
          <mutation>
            <arg name="log_info_text" varid="%g/ANJxNOs5Cicx-gOSb"></arg>
          </mutation>
          <field name="NAME">log_info</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="debug" id="AANqq.F;(3x=J-7PD4EV" inline="true">
              <field name="Severity">log</field>
              <value name="TEXT">
                <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="6w9`Hf9~|RY5t2C0X0rX">
                  <field name="TEXT">test</field>
                </shadow>
                <block type="text_join" id=",POUCWP3D[u0,//UBZ[w">
                  <mutation items="4"></mutation>
                  <value name="ADD0">
                    <block type="text" id="4mxi~0XN[06PL27GU1ip">
                      <field name="TEXT">+++ </field>
                    </block>
                  </value>
                  <value name="ADD1">
                    <block type="text" id="I)[%/A^fJ6^hsvN)9/O7">
                      <field name="TEXT">Wake on LAN: </field>
                    </block>
                  </value>
                  <value name="ADD2">
                    <block type="variables_get" id="z4y3-s:~(-!kgCNWne)5">
                      <field name="VAR" id="%g/ANJxNOs5Cicx-gOSb">log_info_text</field>
                    </block>
                  </value>
                  <value name="ADD3">
                    <block type="text" id="*#z%dPW;NK9?dKG^}xm$">
                      <field name="TEXT"> +++</field>
                    </block>
                  </value>
                </block>
              </value>
            </block>
          </statement>
        </block>
        <block type="procedures_defnoreturn" id="Kys+qcC(bUA!F,^8{PVF" x="13" y="188">
          <mutation>
            <arg name="oid" varid="-r/}hhL0@h;1gaLT?}`b"></arg>
            <arg name="delay" varid="6_JJzzeJG!sq.1_eKyW|"></arg>
          </mutation>
          <field name="NAME">schalteSteckdoseEin</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="control_ex" id="F)QRfApL|JFF%nLS~q!g" inline="true">
              <field name="TYPE">false</field>
              <field name="CLEAR_RUNNING">FALSE</field>
              <value name="OID">
                <shadow xmlns="http://www.w3.org/1999/xhtml" type="field_oid" id="YDka~k7ocKK0i;::n{*`">
                  <field name="oid">Object ID</field>
                </shadow>
                <block type="variables_get" id="rP!M2[.gp72]fY5hj2u|">
                  <field name="VAR" id="-r/}hhL0@h;1gaLT?}`b">oid</field>
                </block>
              </value>
              <value name="VALUE">
                <shadow xmlns="http://www.w3.org/1999/xhtml" type="logic_boolean" id="SFLtwmU^1YD-HWGZ{^x%">
                  <field name="BOOL">TRUE</field>
                </shadow>
                <block type="logic_boolean" id="dk.HtyjC+[9@l]Gu8:hN">
                  <field name="BOOL">TRUE</field>
                </block>
              </value>
              <value name="DELAY_MS">
                <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id=".U)9C]5OUYvIy.5SyQG;">
                  <field name="NUM">0</field>
                </shadow>
                <block type="variables_get" id="U@PKwKWG?zp{2[GbEEP/">
                  <field name="VAR" id="6_JJzzeJG!sq.1_eKyW|">delay</field>
                </block>
              </value>
            </block>
          </statement>
        </block>
        <block type="procedures_defnoreturn" id="rH3ln1Qykq:@87z8ry0%" x="13" y="288">
          <mutation>
            <arg name="wol_ip" varid="ofh(iD!YW(+.E5!h-H5`"></arg>
            <arg name="wol_mac" varid="IT?3aSGqeT+8[51FKL~q"></arg>
            <arg name="wol_hostname" varid="CgO7**.g^~ROq!;VBXGG"></arg>
          </mutation>
          <field name="NAME">wol</field>
          <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
          <statement name="STACK">
            <block type="exec" id="g(i(cmX5rHp18RxviHwU" inline="true">
              <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="true"></mutation>
              <field name="WITH_STATEMENT">TRUE</field>
              <field name="LOG"></field>
              <value name="COMMAND">
                <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="V`po#;p:P_.KUR9.IKEQ">
                  <field name="TEXT"></field>
                </shadow>
                <block type="text_join" id="M@qFv#cCgQwWeWlUI#AF">
                  <mutation items="3"></mutation>
                  <value name="ADD0">
                    <block type="text" id="4P_SAbwQ}x^D].9,$1Sb">
                      <field name="TEXT">/usr/bin/wakeonlan </field>
                    </block>
                  </value>
                  <value name="ADD1">
                    <block type="text_join" id="9B+wA0Dy=%XyxfP(Fm#8">
                      <mutation items="3"></mutation>
                      <value name="ADD0">
                        <block type="text" id="P@XEq;klgqc#dZ2B]}Hr">
                          <field name="TEXT">-i </field>
                        </block>
                      </value>
                      <value name="ADD1">
                        <block type="variables_get" id="2DQHe.;Cd9Ei6y6#ki}#">
                          <field name="VAR" id="ofh(iD!YW(+.E5!h-H5`">wol_ip</field>
                        </block>
                      </value>
                      <value name="ADD2">
                        <block type="text" id="M`n:LuD]!vtlx%AU3PZy">
                          <field name="TEXT"> </field>
                        </block>
                      </value>
                    </block>
                  </value>
                  <value name="ADD2">
                    <block type="variables_get" id="`QjG?:Tt$VxruNOV$Xf;">
                      <field name="VAR" id="IT?3aSGqeT+8[51FKL~q">wol_mac</field>
                    </block>
                  </value>
                </block>
              </value>
              <statement name="STATEMENT">
                <block type="controls_if" id="F-[.%rl#5^{Y]qf4;(k%">
                  <mutation else="1"></mutation>
                  <value name="IF0">
                    <block type="variables_get" id="?K8I|MWI+]rH1ndDaAT$">
                      <field name="VAR" id="@Rx5)VE,|H|,FBCrH4:L">error</field>
                    </block>
                  </value>
                  <statement name="DO0">
                    <block type="procedures_callnoreturn" id="(iu|MiJ}_;-4kF9Q1U5o" inline="true">
                      <mutation name="log_info">
                        <arg name="log_info_text"></arg>
                      </mutation>
                      <value name="ARG0">
                        <block type="text_join" id="}g0%C}FPgMK?w[cM;EbL">
                          <mutation items="3"></mutation>
                          <value name="ADD0">
                            <block type="text" id="c6~Oli]7qQPpa1zwkY6*">
                              <field name="TEXT">Fehler beim ausfuehren von Wake on LAN fuer </field>
                            </block>
                          </value>
                          <value name="ADD1">
                            <block type="variables_get" id="kmXu6T*^!SJSQ!9#F`X*">
                              <field name="VAR" id="CgO7**.g^~ROq!;VBXGG">wol_hostname</field>
                            </block>
                          </value>
                          <value name="ADD2">
                            <block type="text_join" id="NaY|B}9Aw6zz`4h]DI=.">
                              <mutation items="2"></mutation>
                              <value name="ADD0">
                                <block type="text" id="|rzoQ3T{O!(x~W#}0[|3">
                                  <field name="TEXT">Fehler: </field>
                                </block>
                              </value>
                              <value name="ADD1">
                                <block type="variables_get" id="`i{lP;W2PmmBk0WIVb{b">
                                  <field name="VAR" id="@Rx5)VE,|H|,FBCrH4:L">error</field>
                                </block>
                              </value>
                            </block>
                          </value>
                        </block>
                      </value>
                    </block>
                  </statement>
                  <statement name="ELSE">
                    <block type="procedures_callnoreturn" id="C?,%S092w#U78!@w~Xt9" inline="true">
                      <mutation name="log_info">
                        <arg name="log_info_text"></arg>
                      </mutation>
                      <value name="ARG0">
                        <block type="text_join" id="!QMWPzW96R}pPHGyB,U-">
                          <mutation items="4"></mutation>
                          <value name="ADD0">
                            <block type="text" id="pYvZj7QD/A:#[lh]KTLm">
                              <field name="TEXT">Paket fuer </field>
                            </block>
                          </value>
                          <value name="ADD1">
                            <block type="variables_get" id="3g)|$$Jr42}32iXp7~wN">
                              <field name="VAR" id="CgO7**.g^~ROq!;VBXGG">wol_hostname</field>
                            </block>
                          </value>
                          <value name="ADD2">
                            <block type="text" id="Wz})O$hE%oK}21=BLi2=">
                              <field name="TEXT"> wurde gesendet: </field>
                            </block>
                          </value>
                          <value name="ADD3">
                            <block type="variables_get" id="lzF~?R6i^9rG~tmV_FDb">
                              <field name="VAR" id="+~qvXTXYsqr5jkS2%jmm">result</field>
                            </block>
                          </value>
                        </block>
                      </value>
                    </block>
                  </statement>
                </block>
              </statement>
            </block>
          </statement>
        </block>
        <block type="comment" id="L6-3JshN}!Qff0o!iH{Z" x="13" y="840">
          <field name="COMMENT">Skripte zum Automatischen Abschalten ein</field>
          <next>
            <block type="on_ext" id="0HROMR0_q5JVI6KMjLIJ">
              <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
              <field name="CONDITION">true</field>
              <field name="ACK_CONDITION"></field>
              <value name="OID0">
                <shadow xmlns="http://www.w3.org/1999/xhtml" type="field_oid">
                  <field name="oid">default</field>
                </shadow>
                <block type="text" id="-,Du4=GzIh0+Y%$HDrrK">
                  <field name="TEXT">ping.0.thor25</field>
                </block>
              </value>
              <statement name="STATEMENT">
                <block type="comment" id="}1_lI1-c(f~{0z/jbvpV">
                  <field name="COMMENT">Wenn Skript zum autom. = aus, dann schalte es ein</field>
                  <next>
                    <block type="controls_if" id="$XO/}e],(OtAsnUPn4Za">
                      <value name="IF0">
                        <block type="logic_compare" id="rSU9.p0/Amc(c3b_ZZv:">
                          <field name="OP">EQ</field>
                          <value name="A">
                            <block type="get_value_var" id="t.M*m+}y0zyZpb@W|2UJ">
                              <field name="ATTR">val</field>
                              <value name="OID">
                                <shadow xmlns="http://www.w3.org/1999/xhtml" type="text">
                                  <field name="TEXT"></field>
                                </shadow>
                                <block type="text" id="]8l|a$$D#~8TFf!l!;ui">
                                  <field name="TEXT">javascript.0.scriptEnabled.PRODUKTIV.Energie.05_Steckdose_Automatik_-_PC</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <value name="B">
                            <block type="logic_boolean" id="_(y-{s4b?CIPV{GE$2g=">
                              <field name="BOOL">FALSE</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO0">
                        <block type="control_ex" id="P@|aic}!qnV*I3J=[P(S" inline="true">
                          <field name="TYPE">false</field>
                          <field name="CLEAR_RUNNING">FALSE</field>
                          <value name="OID">
                            <shadow xmlns="http://www.w3.org/1999/xhtml" type="field_oid">
                              <field name="oid">Object ID</field>
                            </shadow>
                            <block type="text" id="m4?3:!,ul^4X56gze6L=">
                              <field name="TEXT">javascript.0.scriptEnabled.PRODUKTIV.Energie.05_Steckdose_Automatik_-_PC</field>
                            </block>
                          </value>
                          <value name="VALUE">
                            <shadow xmlns="http://www.w3.org/1999/xhtml" type="logic_boolean">
                              <field name="BOOL">FALSE</field>
                            </shadow>
                            <block type="logic_boolean" id="RnN/gXt0x6ZnT/*fWa}y">
                              <field name="BOOL">TRUE</field>
                            </block>
                          </value>
                          <value name="DELAY_MS">
                            <shadow type="math_number" id="rhsd=W6SpIHS{KEIy5`B">
                              <field name="NUM">0</field>
                            </shadow>
                          </value>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </statement>
              <next>
                <block type="comment" id="rxP]#$@pGa)g0ub:_bNQ">
                  <field name="COMMENT">thor - inkl. Steckdose</field>
                  <next>
                    <block type="on_ext" id="eC=PrAM}Jf`b]7}g@:-Z">
                      <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                      <field name="CONDITION">any</field>
                      <field name="ACK_CONDITION"></field>
                      <value name="OID0">
                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="field_oid" id="lM;0[R6@DwEo7d=:KG:w">
                          <field name="oid">default</field>
                        </shadow>
                        <block type="text" id="k$*,h=}:^1gDPYezDQ8?">
                          <field name="TEXT">javascript.0.System.WakeOnLAN.wol_thor</field>
                        </block>
                      </value>
                      <statement name="STATEMENT">
                        <block type="comment" id="[?Ha$cJ.B~aD:h:i!N?i">
                          <field name="COMMENT">Wenn Steckdose = false</field>
                          <next>
                            <block type="controls_if" id="bTa(VYIb6ZD)|BkirJ~1">
                              <mutation else="1"></mutation>
                              <value name="IF0">
                                <block type="logic_compare" id="YX0K,S4RtI?[S(}Sk@PS">
                                  <field name="OP">EQ</field>
                                  <value name="A">
                                    <block type="get_value_var" id="6CV}%{v*:3ZY@%*#1u^)">
                                      <field name="ATTR">val</field>
                                      <value name="OID">
                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="!oX3/?P`GU5L{T`{+Nk1">
                                          <field name="TEXT">linkeddevices.0.energie.steckdosen.pc_state</field>
                                        </shadow>
                                        <block type="text" id="w(T%qH/,zGoS8Me9~mhV">
                                          <field name="TEXT">linkeddevices.0.energie.steckdosen.pc_state</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                  <value name="B">
                                    <block type="logic_boolean" id="j-GOb%UM{Z6eJL.;oW-*">
                                      <field name="BOOL">FALSE</field>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <statement name="DO0">
                                <block type="comment" id="ZBjhxb0sij5647ch%_AO">
                                  <field name="COMMENT">Steckdose = aus</field>
                                  <next>
                                    <block type="comment" id="G%LqL:nDT=R|-Wpe8P}R">
                                      <field name="COMMENT">deaktiviere kurzeitig Skript </field>
                                      <next>
                                        <block type="comment" id="~;T`^J?Mz(xz!ic0{64t">
                                          <field name="COMMENT">zum Abschalten der Steckdose</field>
                                          <next>
                                            <block type="controls_if" id="We~|v}p/1Kk)o+EsGb6V">
                                              <value name="IF0">
                                                <block type="logic_compare" id=")Kk#OE9GNWM|d:W9/yu;">
                                                  <field name="OP">EQ</field>
                                                  <value name="A">
                                                    <block type="get_value_var" id="6Kts(0S1Y1=VyP~;pblU">
                                                      <field name="ATTR">val</field>
                                                      <value name="OID">
                                                        <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="0H):SRu*s]tQj={K.~ID">
                                                          <field name="TEXT"></field>
                                                        </shadow>
                                                        <block type="text" id="/4:/FjSg6_S2S29p$Woh">
                                                          <field name="TEXT">javascript.0.scriptEnabled.PRODUKTIV.Energie.05_Steckdose_Automatik_-_PC</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <block type="logic_boolean" id="d0RN^GYM%pz_(bl;*pER">
                                                      <field name="BOOL">TRUE</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <statement name="DO0">
                                                <block type="control_ex" id=":AkLTe4Vh{aVpzN$wLc#" inline="true">
                                                  <field name="TYPE">true</field>
                                                  <field name="CLEAR_RUNNING">FALSE</field>
                                                  <value name="OID">
                                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="field_oid" id="GYP9CA$[U@8LvjL=eUnV">
                                                      <field name="oid">Object ID</field>
                                                    </shadow>
                                                    <block type="text" id=";-0^Br]DF~)L!feYM%-H">
                                                      <field name="TEXT">javascript.0.scriptEnabled.PRODUKTIV.Energie.05_Steckdose_Automatik_-_PC</field>
                                                    </block>
                                                  </value>
                                                  <value name="VALUE">
                                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="logic_boolean" id="zN~Sjat4e$M4_Ql4|v$U">
                                                      <field name="BOOL">FALSE</field>
                                                    </shadow>
                                                    <block type="logic_boolean" id="jivlLuyr8[E*AV5+of}j">
                                                      <field name="BOOL">FALSE</field>
                                                    </block>
                                                  </value>
                                                  <value name="DELAY_MS">
                                                    <shadow type="math_number" id="!RtK-zkN:=T(AY9`2[`-">
                                                      <field name="NUM">0</field>
                                                    </shadow>
                                                  </value>
                                                  <next>
                                                    <block type="procedures_callnoreturn" id="QncciL-Xc3GoOjQgc|pr" inline="true">
                                                      <mutation name="log_info">
                                                        <arg name="log_info_text"></arg>
                                                      </mutation>
                                                      <value name="ARG0">
                                                        <block type="text" id="!/4{L8?(Hk%oGoOrxmei">
                                                          <field name="TEXT">Deaktivere Skript zum Automatischen ausschalten der Steckdose.</field>
                                                        </block>
                                                      </value>
                                                    </block>
                                                  </next>
                                                </block>
                                              </statement>
                                              <next>
                                                <block type="comment" id="SiDX:1y||n)Qen%2xuI6">
                                                  <field name="COMMENT">Steckdose PC einschalten</field>
                                                  <next>
                                                    <block type="procedures_callnoreturn" id="f-aL+v4(Da8UU%BE8moK" inline="true">
                                                      <mutation name="schalteSteckdoseEin">
                                                        <arg name="oid"></arg>
                                                        <arg name="delay"></arg>
                                                      </mutation>
                                                      <value name="ARG0">
                                                        <block type="text" id="G]@=^-5TftV!8k}eG~BA">
                                                          <field name="TEXT">linkeddevices.0.energie.steckdosen.pc_state</field>
                                                        </block>
                                                      </value>
                                                      <value name="ARG1">
                                                        <block type="math_number" id="afju.1])ktCO9pT]76?5">
                                                          <field name="NUM">0</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="procedures_callnoreturn" id="8XvkH6YAZ3DyTZ/;:;Sf" inline="true">
                                                          <mutation name="log_info">
                                                            <arg name="log_info_text"></arg>
                                                          </mutation>
                                                          <value name="ARG0">
                                                            <block type="text" id="n+JPzyJWl+6,iTiqN3j]">
                                                              <field name="TEXT">Steckdose PC war aus, wird eingeschaltet</field>
                                                            </block>
                                                          </value>
                                                          <next>
                                                            <block type="comment" id="mMzQ6626@p?263QmdiMd">
                                                              <field name="COMMENT">Sende WoL Paket</field>
                                                              <next>
                                                                <block type="timeouts_cleartimeout" id="URr+9wV(|G|pw]09~V5K">
                                                                  <field name="NAME">sendeWoLDelay</field>
                                                                  <next>
                                                                    <block type="timeouts_settimeout" id="%0kKBloeWl)n}POlVQA/">
                                                                      <field name="NAME">sendeWoLDelay</field>
                                                                      <field name="DELAY">5000</field>
                                                                      <field name="UNIT">ms</field>
                                                                      <statement name="STATEMENT">
                                                                        <block type="procedures_callnoreturn" id="BL4kjx!5laW26h#Iw{,V" inline="true">
                                                                          <mutation name="wol">
                                                                            <arg name="wol_ip"></arg>
                                                                            <arg name="wol_mac"></arg>
                                                                            <arg name="wol_hostname"></arg>
                                                                          </mutation>
                                                                          <value name="ARG0">
                                                                            <block type="text" id="s*gz7De|J?L3}q:z:4M#">
                                                                              <field name="TEXT">10.1.0.2</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="ARG1">
                                                                            <block type="text" id="0ia3!xwjU^6qRw:U^i.7">
                                                                              <field name="TEXT">0C:9D:92:84:86:49</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="ARG2">
                                                                            <block type="text" id=":AntnZxEe93PN3/v]w]~">
                                                                              <field name="TEXT">thor</field>
                                                                            </block>
                                                                          </value>
                                                                          <next>
                                                                            <block type="timeouts_cleartimeout" id="e|af_dIj[0[bj7#Naa(L">
                                                                              <field name="NAME">timeout</field>
                                                                              <next>
                                                                                <block type="timeouts_settimeout" id="bFBUxk.?({7paTV=J[uS">
                                                                                  <field name="NAME">timeout</field>
                                                                                  <field name="DELAY">1000</field>
                                                                                  <field name="UNIT">ms</field>
                                                                                  <statement name="STATEMENT">
                                                                                    <block type="procedures_callnoreturn" id="z[*`:*-+|.#s$Gb|+Z@8" inline="true">
                                                                                      <mutation name="wol">
                                                                                        <arg name="wol_ip"></arg>
                                                                                        <arg name="wol_mac"></arg>
                                                                                        <arg name="wol_hostname"></arg>
                                                                                      </mutation>
                                                                                      <value name="ARG0">
                                                                                        <block type="text" id="8Fw({2}tG8q!=b2,UPjV">
                                                                                          <field name="TEXT">192.168.1.42</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ARG1">
                                                                                        <block type="text" id="U;g;D=a`G%0$l8pbX,yD">
                                                                                          <field name="TEXT">8c:0e:60:d0:d9:cf</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="ARG2">
                                                                                        <block type="text" id="k]tBDW@l_DbD?+YXy.[2">
                                                                                          <field name="TEXT">thor25</field>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </statement>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </statement>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                              <statement name="ELSE">
                                <block type="comment" id="l^r6Uxq(LH;G|5^;9$cO">
                                  <field name="COMMENT">Steckdose = ein</field>
                                  <next>
                                    <block type="comment" id="%{!AQ0f5P}442!%H{+Tu">
                                      <field name="COMMENT">Wenn ping auf thor = false, sende WoL</field>
                                      <next>
                                        <block type="controls_if" id="N=R=3Ub)5_m{~;-FH`+8">
                                          <value name="IF0">
                                            <block type="logic_compare" id="dX#Aov,4z_$~D8SNDCPU">
                                              <field name="OP">EQ</field>
                                              <value name="A">
                                                <block type="get_value_var" id="f.|7.#0CKU.*hOWR~!3$">
                                                  <field name="ATTR">val</field>
                                                  <value name="OID">
                                                    <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="Z./qfUsnHP4ooGLd.-*p">
                                                      <field name="TEXT">ping.0.iobroker-master.10_1_1_2</field>
                                                    </shadow>
                                                    <block type="text" id="x+:_CAx3MwVD9*?P0!0i">
                                                      <field name="TEXT">ping.0.thor</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <value name="B">
                                                <block type="logic_boolean" id=".GlNuVjHD.o7t7G1jDlv">
                                                  <field name="BOOL">FALSE</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                          <statement name="DO0">
                                            <block type="procedures_callnoreturn" id="+hYC+#S@aCL|n/i-,]h[" inline="true">
                                              <mutation name="wol">
                                                <arg name="wol_ip"></arg>
                                                <arg name="wol_mac"></arg>
                                                <arg name="wol_hostname"></arg>
                                              </mutation>
                                              <value name="ARG0">
                                                <block type="text" id="+_=:lEol#~K2v~ctykU]">
                                                  <field name="TEXT">10.1.0.2</field>
                                                </block>
                                              </value>
                                              <value name="ARG1">
                                                <block type="text" id="hVmEddMQB3`!{L4yxQ5h">
                                                  <field name="TEXT">0C:9D:92:84:86:49</field>
                                                </block>
                                              </value>
                                              <value name="ARG2">
                                                <block type="text" id="V(;lGhdXn0TDP!|BcXNX">
                                                  <field name="TEXT">thor</field>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="timeouts_cleartimeout" id="ft{5LEW6QkvfVhEHgF[m">
                                                  <field name="NAME">timeout2</field>
                                                  <next>
                                                    <block type="timeouts_settimeout" id="!3fVj+}BzFHBp)cpjiOv">
                                                      <field name="NAME">timeout2</field>
                                                      <field name="DELAY">1000</field>
                                                      <field name="UNIT">ms</field>
                                                      <statement name="STATEMENT">
                                                        <block type="procedures_callnoreturn" id="^_q_I2pPNRlqxL@hQ?{0" inline="true">
                                                          <mutation name="wol">
                                                            <arg name="wol_ip"></arg>
                                                            <arg name="wol_mac"></arg>
                                                            <arg name="wol_hostname"></arg>
                                                          </mutation>
                                                          <value name="ARG0">
                                                            <block type="text" id="n#gGm~_aH5Dn|{O6--5$">
                                                              <field name="TEXT">192.168.1.42</field>
                                                            </block>
                                                          </value>
                                                          <value name="ARG1">
                                                            <block type="text" id="!^.vpbA5U;jmrH~45uT;">
                                                              <field name="TEXT">8c:0e:60:d0:d9:cf</field>
                                                            </block>
                                                          </value>
                                                          <value name="ARG2">
                                                            <block type="text" id="kebTF?)!04]dYjb^[Q/b">
                                                              <field name="TEXT">thor25</field>
                                                            </block>
                                                          </value>
                                                        </block>
                                                      </statement>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </statement>
                                        </block>
                                      </next>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                            </block>
                          </next>
                        </block>
                      </statement>
                    </block>
                  </next>
                </block>
              </next>
            </block>
          </next>
        </block>
      </xml>
      

      Blockly ist echt nicht meins. Nicht bös gemeint 😉
      Falls ich aber gar nicht mit dem Exec weiter komme, schaue ich mir das gerne mal an.

      Ich berichte dann morgen, oder vllt auch Freitag nochmal.

      Schönen Abend schonmal!

      posted in JavaScript
      B
      Basti86
    • RE: Wake on Lan auf zweite Netzwerkkarte

      Keiner eine Idee?
      Anscheinend kann man wohl bei der integrierten wake_on_lan-Funktion und bei den net-tools keine zu nutzende Netzwerkkarte mitgeben. Denke mal das hat bisher keiner so vorgesehen.

      Aber zumindest der exec-Befehl sollte doch zum Funktionieren zu bewegen sein.
      Hat da jemand ne Idee, damit ich weiter eingrenzen kann woran es liegt, dass der nicht ausgeführt wird?

      Also hängt es vllt an meiner custom_iobroker-Datei?

      Jemand eine Idee wie ich die Ursache irgendwie eingrenzen kann? Bin mit Linux leider nicht so richtig bewandert.

      Grüße
      Basti

      posted in JavaScript
      B
      Basti86
    • Wake on Lan auf zweite Netzwerkkarte

      Hallo Zusammen,

      ich habe bisher noch nichts zu dem Thema gefunden, daher hoffe ich es ist ok, wenn ich einen neuen Thread öffne.

      Ich möchte gerne ein WOL-Paket an meinen PC senden vom IO-Broker aus.
      Mein IOBroker läuft jedoch in einer Linux Station auf meinem QNAP. Dort erhält die VM zwei Netzwerkkarten. Eine direkt als Verbindung zum QNAP (eth0 - anderes Subnetz) und eine im Heimnetz (eth1 - gleiches Subnetz wie PC und alle anderen Komponenten).

      Über die wake_on_lan-Funktion wird anscheinend immer auf eth0 das Magic Packet gesendet, was bei mir nichts bringt.

      Mein Script sieht derzeit so aus:

      var wol = require('wake_on_lan'); // Lädt von ioBroker das nötige Paket herunter
      var myPC = "xx:xx:xx:1F:12:AB"; // MAC Adresse des PC
      
      
      on({id: "harmony.0.Harmony_Hub.activities.PC", change: 'any'}, function (obj) {
          if (getState("harmony.0.Harmony_Hub.activities.PC").val == 2)
          {
              // exec('sudo etherwake -i eth1 xx:xx:xx:1f:12:ab');
              // setState("net-tools.0.xxxxxx1f12ab.wol", true);
              wol.wake(myPC);
              log("Script WOL - PC aufgeweckt", "info");
          }
          if (getState("harmony.0.Harmony_Hub.activities.PC").val != 2)
          {
              log("Script WOL - anderer Zustand - PC nicht geweckt", "info");
          }
      }
      );
      

      Gibt es eine Möglichkeit das zu nutzende Interface mitzugeben? (Das Script wird ordnungsgemäß abgearbeitet, da ich die Einträge im Log sehe.)

      Wie man im Script sieht, habe ich es auch mit den net-tools versucht. Aber auch dort habe ich anscheinend keine Möglichkeit auf eth1 zu senden.

      Sende ich

      sudo etherwake -i eth1 xx:xx:xx:1f:12:ab
      

      in einer SSH direkt in der iobroker-VM, dann wird der PC auch geweckt. In dem Exec-Kommando oben aus meinem Script funktioniert es jedoch wieder nicht. Keine Fehlermeldung. Ich habe bereits unter /etc/sudoers.d eine custom_iobroker-Datei angelegt mit dem Inhalt

      iobroker ALL=(ALL) NOPASSWD: /sbin/etherwake
      

      (ebenfalls hier im Forum gefunden)

      Also alle meiner drei Ideen wollen nicht so funktionieren wie sie sollen.

      Kann jemand unterstützen? Vielen Dank im Voraus!

      Grüße
      Basti

      posted in JavaScript
      B
      Basti86
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    The ioBroker Community 2014-2023
    logo