Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Tasmota kurzer und langer Tastendruck

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Tasmota kurzer und langer Tastendruck

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

      moin moin zusammen,
      ich versuche gerade meinen selbst gebastelten 4fach Taster gewisse sachen machen zu lassen, was das Licht schalten betrifft funktioniert wie es soll. Jetzt will ich aber für zwei der vier taster noch zusatfunktionen;
      taster1.jpg
      Power1 und Power3 schalten das Licht,
      Power 2 und Power4 sollen eine Jalousie steuern

      Jetzt zu meiner Frage; wie kann ich tasmota oder über Blockly sagen das bei kurzem antippen des switch2(switch4) ein wert gesetzt wird und bei langem drücken (2sec) ein anderer.
      Bin für jeden Tipp dankbar, stehe total auf dem schlauch.

      Falls der Beitrag nicht hier her gehört bitte verschieben

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

        @Olfrygt sagte:

        Blockly sagen das bei kurzem antippen des switch2(switch4) ein wert gesetzt wird und bei langem drücken (2sec) ein anderer.

        Wie verhält sich der Wert von switch2 beim Drücken und Loslassen des Tasters ?

        Wenn beim Drücken der Wert true oder 1 und beim Loslassen der Wert false oder 0 geliefert wird, emuliert das folgende Blockly das Verhalten von HomeMatic-Tastern.

        Blockly_HM_PRESS.JPG

        <xml xmlns="https://developers.google.com/blockly/xml">
         <variables>
           <variable type="timeout" id="timeout">timeout</variable>
         </variables>
         <block type="on_ext" id=":*u,g$4XsMz!1N/6(?0J" x="63" y="63">
           <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
           <field name="CONDITION">ne</field>
           <field name="ACK_CONDITION"></field>
           <value name="OID0">
             <shadow type="field_oid" id="B@r]/^Ak9jCbL0UE@zto">
               <field name="oid">default</field>
             </shadow>
           </value>
           <statement name="STATEMENT">
             <block type="controls_if" id="0I@q$}bop)atG}nXNLZ,">
               <mutation elseif="1" else="1"></mutation>
               <value name="IF0">
                 <block type="on_source" id="da|1+26vPsUo4|mc6{{A">
                   <field name="ATTR">state.val</field>
                 </block>
               </value>
               <statement name="DO0">
                 <block type="timeouts_settimeout" id="-~W+7(]WS[-0~(ghrHS!">
                   <field name="NAME">timeout</field>
                   <field name="DELAY">400</field>
                   <field name="UNIT">ms</field>
                   <statement name="STATEMENT">
                     <block type="variables_set" id="=H~k?zHIALQ3EOCJ{pS3">
                       <field name="VAR" id="timeout" variabletype="timeout">timeout</field>
                       <value name="VALUE">
                         <block type="logic_null" id="s;Ce#*Pal;5/?.{3XQ36"></block>
                       </value>
                       <next>
                         <block type="update" id="[x;_EB(Q@`4qOI;z2/?U">
                           <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                           <field name="OID">hm-rpc.0.XEQ1234567.1.PRESS_LONG</field>
                           <field name="WITH_DELAY">FALSE</field>
                           <value name="VALUE">
                             <block type="logic_boolean" id="z}|/WV44$YpDX*rnj{*0">
                               <field name="BOOL">TRUE</field>
                             </block>
                           </value>
                         </block>
                       </next>
                     </block>
                   </statement>
                 </block>
               </statement>
               <value name="IF1">
                 <block type="variables_get" id="bMryiX$s*jAGN*ZryDV0">
                   <field name="VAR" id="timeout" variabletype="timeout">timeout</field>
                 </block>
               </value>
               <statement name="DO1">
                 <block type="timeouts_cleartimeout" id="H1ci#OYg89-+Cgv#Bo,*">
                   <field name="NAME">timeout</field>
                   <next>
                     <block type="update" id="~w)x@U)|$MCgu`eOdhHC">
                       <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                       <field name="OID">hm-rpc.0.XEQ1234567.1.PRESS_SHORT</field>
                       <field name="WITH_DELAY">FALSE</field>
                       <value name="VALUE">
                         <block type="logic_boolean" id="L)H@G?FHU#-a-?2gWjy1">
                           <field name="BOOL">TRUE</field>
                         </block>
                       </value>
                     </block>
                   </next>
                 </block>
               </statement>
               <statement name="ELSE">
                 <block type="update" id="_jS#762y:?z?O/Q^%c5I">
                   <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                   <field name="OID">hm-rpc.0.XEQ1234567.1.PRESS_LONG_RELEASE</field>
                   <field name="WITH_DELAY">FALSE</field>
                   <value name="VALUE">
                     <block type="logic_boolean" id="|:nRakN`*vMz@Z=]Qm,z">
                       <field name="BOOL">TRUE</field>
                     </block>
                   </value>
                 </block>
               </statement>
             </block>
           </statement>
         </block>
        </xml>
        

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

          @paul53 danke dir, hat auf sofort funktioniert

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

          Support us

          ioBroker
          Community Adapters
          Donate

          840
          Online

          31.7k
          Users

          79.7k
          Topics

          1.3m
          Posts

          2
          3
          885
          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