Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Osram Plug, Zeitschaltuhr & Anwesenheitskontrolle

    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

    Osram Plug, Zeitschaltuhr & Anwesenheitskontrolle

    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      Dennis.80 last edited by

      Hallo zusammen,

      ich habe ein Problem mit folgendem Blockly Skript:
      Unbenannt.JPG
      Was war gewollt?

      u.a. hängt mein TV an einer Osram Steckdose, diese soll in der Zeit von 21:00 Uhr bis 07:00 Uhr als Zeitschaltuhr auf "Aus/False" geschaltet werden. Funktioniert auch soweit. Zusätzlich soll die Steckdose aber "AN" bleiben, wenn der TV noch läuft. Ich prüfe also, ob der Chromecast Stick (Stromversorgung über TV-USB) noch im WLAN angemeldet ist. Dies klappt eigentlich auch, allerdings ergeben sich zwei Probleme:

      1. Das Skript läuft nur einen Tag und reagiert am Folgetag nicht mehr 😞

      2. Der TV schaltet sich manchmal ein, wenn der Osram-Plug eingeschaltet wird und bleibt nicht, wie gewünscht im StandBy.

      Richtig gut wäre es, wenn ich zusätzlich noch prüfen könnte ob unsere Smartphones im WLAN sind, sprich wenn keiner zu Hause ist, darf auch der Osram-Plug "aus" sein und dich erst wieder aktivieren, wenn sich eines der Smartphones am Router und sich innerhalb des "An"-Zeitfensters "07:01 -21:00" anmeldet.
      ![alt text](![image url](image url))

      Würde mich über dienliche hinweise sehr freuen, besten Dank im Voraus

      Viele Grüße

      Dennis

      Asgothian BBTown 2 Replies Last reply Reply Quote 0
      • Asgothian
        Asgothian Developer @Dennis.80 last edited by

        @Dennis-80
        Du hast einen kritischen Fehler im Script:

        Du machst das Setzen des Zeitplans davon abhängig ob eine Bedingung erfüllt ist. Diese wird nur bei Scriptstart geprüft. Du musst die Bedingungen die du prüfen möchtest in den Zeitplan integrieren bevor du die Steckdose schaltest.

        A

        1 Reply Last reply Reply Quote 0
        • BBTown
          BBTown @Dennis.80 last edited by BBTown

          @Dennis-80
          so etwas in der Art könnte funktionieren

          4c02c2cf-2f46-4dc0-91f1-999f1a6f048c-grafik.png

          <xml xmlns="http://www.w3.org/1999/xhtml">
           <variables>
             <variable type="" id="Wg=Kx)B2jS@5sHnC-GjP">Nachtruhe</variable>
             <variable type="" id="!rm1dl0R?IS0xR^zOKfz">TV</variable>
             <variable type="" id="nuLeyg)0=b%9p:7`B`m1">Anwesenheit</variable>
           </variables>
           <block type="variables_set" id="W.)DSCv_,jHFEO8y4(2a" x="13" y="13">
             <field name="VAR" id="Wg=Kx)B2jS@5sHnC-GjP" variabletype="">Nachtruhe</field>
             <value name="VALUE">
               <block type="logic_boolean" id="@m^k3VN;mznwXQ~T0xc7">
                 <field name="BOOL">FALSE</field>
               </block>
             </value>
             <next>
               <block type="on_ext" id="pO41L)e{#85jz6qWV2kj">
                 <mutation items="1"></mutation>
                 <field name="CONDITION">ne</field>
                 <field name="ACK_CONDITION"></field>
                 <value name="OID0">
                   <shadow type="field_oid" id="SO?Hhkk@-nsj{I4-OT)-">
                     <field name="oid">Test.0.TV</field>
                   </shadow>
                 </value>
                 <statement name="STATEMENT">
                   <block type="variables_set" id="g/a=C@1:8Z7bUcd*;h*7">
                     <field name="VAR" id="!rm1dl0R?IS0xR^zOKfz" variabletype="">TV</field>
                     <value name="VALUE">
                       <block type="on_source" id="IYH@/3n*Iw#%3B:DK#!z">
                         <field name="ATTR">state.val</field>
                       </block>
                     </value>
                     <next>
                       <block type="procedures_callnoreturn" id="XX6fI49Qn^C/seTsc#CF">
                         <mutation name="Steckdose"></mutation>
                       </block>
                     </next>
                   </block>
                 </statement>
                 <next>
                   <block type="on_ext" id="^;y73TC8#eTVcfuMs9$%">
                     <mutation items="1"></mutation>
                     <field name="CONDITION">ne</field>
                     <field name="ACK_CONDITION"></field>
                     <value name="OID0">
                       <shadow type="field_oid" id="kbrb]tF(gd9em=u{m3HZ">
                         <field name="oid">Test.0.Anwesenheit</field>
                       </shadow>
                     </value>
                     <statement name="STATEMENT">
                       <block type="variables_set" id="u38_lQ*Yr`,l(XFY~bb^">
                         <field name="VAR" id="nuLeyg)0=b%9p:7`B`m1" variabletype="">Anwesenheit</field>
                         <value name="VALUE">
                           <block type="on_source" id="ufMsS1qn}*UJR=|~H!*=">
                             <field name="ATTR">state.val</field>
                           </block>
                         </value>
                         <next>
                           <block type="procedures_callnoreturn" id="D,,l+P6rqYVjf;W_ssfV">
                             <mutation name="Steckdose"></mutation>
                           </block>
                         </next>
                       </block>
                     </statement>
                     <next>
                       <block type="schedule" id="i]5(xi+AsodxbD}ie+E~">
                         <field name="SCHEDULE">0 21 * * *</field>
                         <statement name="STATEMENT">
                           <block type="variables_set" id="*88(xzk6PTC`opAfhz$+">
                             <field name="VAR" id="Wg=Kx)B2jS@5sHnC-GjP" variabletype="">Nachtruhe</field>
                             <value name="VALUE">
                               <block type="logic_boolean" id="BQ(Sy7oq{oR_1si)?MoB">
                                 <field name="BOOL">TRUE</field>
                               </block>
                             </value>
                             <next>
                               <block type="procedures_callnoreturn" id="UG{5@|RI7neleL*{(]vr">
                                 <mutation name="Steckdose"></mutation>
                               </block>
                             </next>
                           </block>
                         </statement>
                         <next>
                           <block type="schedule" id="1BxLuB==*AT,6{H~eB_b">
                             <field name="SCHEDULE">0 7 * * *</field>
                             <statement name="STATEMENT">
                               <block type="variables_set" id="HN5j{NW1Ecxk$m[4bE=e">
                                 <field name="VAR" id="Wg=Kx)B2jS@5sHnC-GjP" variabletype="">Nachtruhe</field>
                                 <value name="VALUE">
                                   <block type="logic_boolean" id="t7q$0EOeKREs$C2pYZ}i">
                                     <field name="BOOL">FALSE</field>
                                   </block>
                                 </value>
                                 <next>
                                   <block type="procedures_callnoreturn" id="lu`qfG%KH`@P9J4NT~:f">
                                     <mutation name="Steckdose"></mutation>
                                   </block>
                                 </next>
                               </block>
                             </statement>
                           </block>
                         </next>
                       </block>
                     </next>
                   </block>
                 </next>
               </block>
             </next>
           </block>
           <block type="procedures_defnoreturn" id="LNLf}4H8lV=Ge#vy!#YZ" x="363" y="13">
             <field name="NAME">Steckdose</field>
             <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
             <statement name="STACK">
               <block type="controls_if" id="37uxm2u@ZP15cwHFBP5,">
                 <mutation elseif="1"></mutation>
                 <value name="IF0">
                   <block type="logic_operation" id="g7,5TKwcr}I3h_Pa2Cl," inline="false">
                     <field name="OP">AND</field>
                     <value name="A">
                       <block type="variables_get" id="}r_o69LPG6ajxjU$h:KV">
                         <field name="VAR" id="Wg=Kx)B2jS@5sHnC-GjP" variabletype="">Nachtruhe</field>
                       </block>
                     </value>
                     <value name="B">
                       <block type="logic_operation" id="OP70TDHjO;Koj7bWJRXx" inline="false">
                         <field name="OP">AND</field>
                         <value name="A">
                           <block type="logic_negate" id="Q|.dn,yjN$ya#pz(uY/y">
                             <value name="BOOL">
                               <block type="variables_get" id="voy^i7@iTQ^cb56UcqCG">
                                 <field name="VAR" id="!rm1dl0R?IS0xR^zOKfz" variabletype="">TV</field>
                               </block>
                             </value>
                           </block>
                         </value>
                         <value name="B">
                           <block type="logic_negate" id="2yfNcB:wo$a]jeB)h,ON">
                             <value name="BOOL">
                               <block type="variables_get" id="uH-_1^0tG4)bI2lE(XqE">
                                 <field name="VAR" id="nuLeyg)0=b%9p:7`B`m1" variabletype="">Anwesenheit</field>
                               </block>
                             </value>
                           </block>
                         </value>
                       </block>
                     </value>
                   </block>
                 </value>
                 <statement name="DO0">
                   <block type="control" id="(L*L7OwEx1Uwr#my9ly=">
                     <mutation delay_input="false"></mutation>
                     <field name="OID">Test.0.Steckdose</field>
                     <field name="WITH_DELAY">FALSE</field>
                     <value name="VALUE">
                       <block type="logic_boolean" id="wH((r[5|Pw+L18YSrzP`">
                         <field name="BOOL">FALSE</field>
                       </block>
                     </value>
                   </block>
                 </statement>
                 <value name="IF1">
                   <block type="logic_negate" id="ntXC!2knRBSbi;;(mn6.">
                     <value name="BOOL">
                       <block type="variables_get" id="3h[oawL{7r6wu.;SJ6e%">
                         <field name="VAR" id="Wg=Kx)B2jS@5sHnC-GjP" variabletype="">Nachtruhe</field>
                       </block>
                     </value>
                   </block>
                 </value>
                 <statement name="DO1">
                   <block type="control" id="GYvY_y%XMF+#:-lV2oCb">
                     <mutation delay_input="false"></mutation>
                     <field name="OID">Test.0.Steckdose</field>
                     <field name="WITH_DELAY">FALSE</field>
                     <value name="VALUE">
                       <block type="logic_boolean" id="0T8=kRA{*8THui-KpIWx">
                         <field name="BOOL">TRUE</field>
                       </block>
                     </value>
                   </block>
                 </statement>
               </block>
             </statement>
           </block>
          </xml>
          


          Hier würde dann um 07:00h die Steckdose automatisch eingeschaltet, wenn das manuell erfolgen soll - und nicht automatisch - müßte der "sonst falls" Bereich entsprechned geändert werden.

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

          Support us

          ioBroker
          Community Adapters
          Donate

          529
          Online

          31.9k
          Users

          80.3k
          Topics

          1.3m
          Posts

          3
          3
          735
          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