Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Shelly Longpush zurücksetzen

    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

    Shelly Longpush zurücksetzen

    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      e-s @Stuebi last edited by

      @Stuebi
      Das nervt mich bei denen am meisten, ständig reden die nur vom schnelleren Support über Facebook. Ich habe und will aber kein Facebook haben.
      Ein Dilemma...

      1 Reply Last reply Reply Quote 0
      • E
        e-s last edited by

        @Stuebi
        Habe jetzt mehrfach mails an shelly gesendet, leider ohne Antwort. Habe jetzt eine Lösung für mich in Blockly erstellt. Schöner wäre aber wenn du das direkt im Adapter als Workaround rein bekommen würdest.
        shortlongpress.png

        on({id: 'shelly.0.SHSW-1#2281E5#1.Relay0.Input', change: "ne"}, function (obj) {
          var value = obj.state.val;
          var oldValue = obj.oldState.val;
          if ((obj.state ? obj.state.val : "") == false) {
            if ((obj.state ? obj.state.ts : "") - (obj.oldState ? obj.oldState.ts : "") > 300) {
              setState("messwerte.0.funktionen.longpress.long_Wohnzimmer_Leselampe"/*long_Wohnzimmer_Leselampe*/, true, true);
              setStateDelayed("messwerte.0.funktionen.longpress.long_Wohnzimmer_Leselampe"/*long_Wohnzimmer_Leselampe*/, false, true, 2000, false);
            } else {
              setState("messwerte.0.funktionen.shortpress.short_Wohnzimmer_Leselampe"/*short_Wohnzimmer_Leselampe*/, true, true);
              setStateDelayed("messwerte.0.funktionen.shortpress.short_Wohnzimmer_Leselampe"/*short_Wohnzimmer_Leselampe*/, false, true, 2000, false);
            }
          }
        });
        
        

        Also vom Prinzip recht simpel, wenn der Taster losgelassen wird, wird geschaut wie lange der Taster true war, wenn länger als 300 wird longpress auf true gesetzt. da ich das nur als trigger nutze, wird dieser anschließend wieder auf false gesetzt. Wenn kürzer als 300, dann eben das selbe als short. Somit kann ich mit einem Taster sauber zwischen long und short unterscheiden. Nur müsste ich dafür alle vorhandene Taster einzeln so aufführen.

        Kannst du das so im Adapter anpassen?
        Am besten aber short und long hinzufügen, damit andere User keine Änderungen vornehmen müssten.

        1 Reply Last reply Reply Quote 0
        • E
          e-s last edited by

          In meinem jugendlichen Leichtsinn dachte ich mir ich könnte testweise die Änderung direkt im Adapter einfließen lassen. Aber das übersteigt doch meine Fähigkeiten. Vielleicht hat jemand eine Idee wie ich das da rein bekomme.
          Ich wollte also hier anschließend 2 neue States anlegen, longpress und shortpress. Diese sollen aber nur bei mqtt angelegt und genutzt werden, da COAP das glaube ich nicht unterstützt.
          Also habe ich mal angefangen den input wieder zu übernehmen und 2 neue States hinzuzufügen:

            'Relay0.longpress': {
              coap: {
                no_display: true
              },
              mqtt: {
                mqtt_publish: 'shellies/shelly1-<deviceid>/input/0',
                mqtt_publish_funct: (value) => { return value == 1 ? true : false; },
              },
              common: {
                'name': 'Longpress',
                'type': 'boolean',
                'role': 'state',
                'read': true,
                'write': false,
                'def': false
              }
            },
            'Relay0.shortpress': {
              coap: {
                no_display: true
              },
              mqtt: {
                mqtt_publish: 'shellies/shelly1-<deviceid>/input/0',
                mqtt_publish_funct: (value) => { return value == 1 ? true : false; },
              },
              common: {
                'name': 'shortpress',
                'type': 'boolean',
                'role': 'state',
                'read': true,
                'write': false,
                'def': false
              }
            },
          

          In JS hatte ich das ja so umgesetzt wie im Post drüber, aber kann ich das auch die ts von alt und aktuell irgendwie vergleichen?

          1 Reply Last reply Reply Quote 0
          • T
            tim210 last edited by

            Hallo, hätte mal ne kurze Frage zu deinem Beitrag "Shelly Longpush zurücksetzen". Hast du das Problem lösen können? Ich bin absoluter Anfänger und stehe total auf dem Schlauch. wäre super wenn du mir helfen könntest. Danke und schöne Grüsse Tim

            E 1 Reply Last reply Reply Quote 0
            • E
              e-s @tim210 last edited by

              @tim210
              Shelly hat mehrfach versucht longpush hinzubekommen, zum Glück kann man jetzt longpush auswählen und dann schaltet die Hauptfunktion im shelly nicht mehr wenn man länger drückt.
              Den longpush Datenpunkt kann man aber trotzdem weiterhin nicht nacheinander gut nutzen, außer man triggert auf das loslassen der Taste und schaut dann ob longpush true ist.

              Aber ich wollte weiter nur ein Datenpunkt überwachen, außerdem hatte ich manchmal auch die Idee noch mehr Funktionen auf einen Taster legen zu können, somit bin ich jetzt auf das neue Blockly gekommen:

              longpush2.png
              Kurz zur Erklärung, links triggert man den Taster, wenn dieser true ist, dann setzt er eine Variable auf 1, diese wird dann an die rechte Seite weiter gegeben.
              Dort wird dann beim ersten mal alles ausgeführt was unter 1 steht.
              Dann eben wird i um 1 erhöht und das ausgeführt was unter 2 steht, da ich nichts weiter mit diesem Taster gemacht werden sollte, wird i wieder auf 1 gesetzt.
              Also schaltet er immer an und aus, solange man den Taster nicht loslässt.

              Dies kann man beliebig erweitern und ist meiner Meinung nach viel besser als das simple longpush.

              Blockly export:

              <xml xmlns="https://developers.google.com/blockly/xml">
                <variables>
                  <variable id="fmsvuCY]{e/#T8[}1jx8">i</variable>
                  <variable type="timeout" id="timeout">timeout</variable>
                  <variable type="interval" id="Intervall">Intervall</variable>
                </variables>
                <block type="procedures_defnoreturn" id="*1I/:x{+8!|/)GQmD?f1" x="713" y="38">
                  <field name="NAME">umschalten</field>
                  <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
                  <statement name="STACK">
                    <block type="controls_if" id="-XsZB^oKEwW8j50d|*5C">
                      <mutation elseif="1"></mutation>
                      <value name="IF0">
                        <block type="logic_compare" id="W(h/3}g~=ktjVO6,C*!W">
                          <field name="OP">EQ</field>
                          <value name="A">
                            <block type="variables_get" id="!MG(huzD)to^iEjuunj|">
                              <field name="VAR" id="fmsvuCY]{e/#T8[}1jx8">i</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="math_number" id="L=#X!dU1ik`]ApXLwFy%">
                              <field name="NUM">1</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO0">
                        <block type="timeouts_cleartimeout" id="sT.QFlD!vB_|6H!~y?,u">
                          <field name="NAME">timeout</field>
                          <next>
                            <block type="timeouts_settimeout" id="3D16pyxdX,TI#Swevc{$">
                              <field name="NAME">timeout</field>
                              <field name="DELAY">60</field>
                              <field name="UNIT">min</field>
                              <statement name="STATEMENT">
                                <block type="control" id="9|O@zo(f.!/n|r.0ZL5H">
                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                  <field name="OID">linkeddevices.0.Dekolichter.Linus_Wolke_Sterne</field>
                                  <field name="WITH_DELAY">FALSE</field>
                                  <value name="VALUE">
                                    <block type="logic_boolean" id="Dx[l9FbKJn_Ut%eNl!$+">
                                      <field name="BOOL">FALSE</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="control" id="8fe;ou83R4whY_~T|~Y5">
                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                      <field name="OID">linkeddevices.0.Dekolichter.Linus_Wolke_blau</field>
                                      <field name="WITH_DELAY">FALSE</field>
                                      <value name="VALUE">
                                        <block type="logic_boolean" id="A;cL~|].x6=nv_H5Geva">
                                          <field name="BOOL">FALSE</field>
                                        </block>
                                      </value>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                              <next>
                                <block type="control" id="`Dx64$L3(yXC,niI1r7[">
                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                  <field name="OID">linkeddevices.0.Dekolichter.Linus_Wolke_blau</field>
                                  <field name="WITH_DELAY">FALSE</field>
                                  <value name="VALUE">
                                    <block type="logic_boolean" id="uUW$~aBuY[e+`d#vRAqH">
                                      <field name="BOOL">TRUE</field>
                                    </block>
                                  </value>
                                  <next>
                                    <block type="control" id="zaHAJ~,7K{)!t-T)p$*!">
                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                      <field name="OID">linkeddevices.0.Dekolichter.Linus_Wolke_Sterne</field>
                                      <field name="WITH_DELAY">FALSE</field>
                                      <value name="VALUE">
                                        <block type="logic_boolean" id="tH9s?r6ZM;P(_BpSqEyj">
                                          <field name="BOOL">TRUE</field>
                                        </block>
                                      </value>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </statement>
                      <value name="IF1">
                        <block type="logic_compare" id="!f.I4=g-Icj]rJ.WVmv7">
                          <field name="OP">EQ</field>
                          <value name="A">
                            <block type="variables_get" id="r.n/7(B1PTaS^Utl=]J$">
                              <field name="VAR" id="fmsvuCY]{e/#T8[}1jx8">i</field>
                            </block>
                          </value>
                          <value name="B">
                            <block type="math_number" id="+|;o_W}S%kcffh^8FjPL">
                              <field name="NUM">2</field>
                            </block>
                          </value>
                        </block>
                      </value>
                      <statement name="DO1">
                        <block type="control" id="[9PT)A$-;VKkk4$`X`]l">
                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                          <field name="OID">linkeddevices.0.Dekolichter.Linus_Wolke_blau</field>
                          <field name="WITH_DELAY">FALSE</field>
                          <value name="VALUE">
                            <block type="logic_boolean" id="rwCEZQRoY$4e:._%OVbQ">
                              <field name="BOOL">FALSE</field>
                            </block>
                          </value>
                          <next>
                            <block type="control" id="$^b.~JwIS[-?Y`Wpmw~~">
                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                              <field name="OID">linkeddevices.0.Dekolichter.Linus_Wolke_Sterne</field>
                              <field name="WITH_DELAY">FALSE</field>
                              <value name="VALUE">
                                <block type="logic_boolean" id="[bM:wp|h2Zx0AW8./G$m">
                                  <field name="BOOL">FALSE</field>
                                </block>
                              </value>
                              <next>
                                <block type="timeouts_cleartimeout" id="7nkI4!dq?.#k+ckCvZG?">
                                  <field name="NAME">timeout</field>
                                  <next>
                                    <block type="variables_set" id="$T)y,}q,fG~fJNAScoEV">
                                      <field name="VAR" id="fmsvuCY]{e/#T8[}1jx8">i</field>
                                      <value name="VALUE">
                                        <block type="math_number" id="im1daq~HD%`:rzsfp?kY">
                                          <field name="NUM">0</field>
                                        </block>
                                      </value>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </statement>
                    </block>
                  </statement>
                </block>
                <block type="on_ext" id="i!-t9dF;~LZUZD1hob%n" x="188" y="113">
                  <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="wLfd.qlnE-m,yW(`%G`^">
                      <field name="oid">linkeddevices.0.Schalter.Kinderzimmer</field>
                    </shadow>
                  </value>
                  <statement name="STATEMENT">
                    <block type="controls_if" id="ENkIcXtgv[FY:S!tw{2#">
                      <mutation else="1"></mutation>
                      <value name="IF0">
                        <block type="on_source" id="Xc?)#(kWmetn0#oAeezY">
                          <field name="ATTR">state.val</field>
                        </block>
                      </value>
                      <statement name="DO0">
                        <block type="variables_set" id="+]]v{W2-l(SssUuRo={9">
                          <field name="VAR" id="fmsvuCY]{e/#T8[}1jx8">i</field>
                          <value name="VALUE">
                            <block type="math_number" id="ab^`Qd`DhpE?FmqkrjE=">
                              <field name="NUM">1</field>
                            </block>
                          </value>
                          <next>
                            <block type="timeouts_setinterval" id=";c47]K,#./7Jo(C4}@[g">
                              <field name="NAME">Intervall</field>
                              <field name="INTERVAL">800</field>
                              <field name="UNIT">ms</field>
                              <statement name="STATEMENT">
                                <block type="procedures_callnoreturn" id="c/Z71R`xxW9N?dL8#o#G">
                                  <mutation name="umschalten"></mutation>
                                  <next>
                                    <block type="math_change" id="w:zW|;IX};dlHX)lb+!p">
                                      <field name="VAR" id="fmsvuCY]{e/#T8[}1jx8">i</field>
                                      <value name="DELTA">
                                        <shadow type="math_number" id="(1uMur*.y8G[7jN*WV{,">
                                          <field name="NUM">1</field>
                                        </shadow>
                                      </value>
                                    </block>
                                  </next>
                                </block>
                              </statement>
                            </block>
                          </next>
                        </block>
                      </statement>
                      <statement name="ELSE">
                        <block type="timeouts_clearinterval" id="^3;J$-#OGiV`@pK.rQ#r">
                          <field name="NAME">Intervall</field>
                        </block>
                      </statement>
                    </block>
                  </statement>
                </block>
              </xml>
              

              T I 2 Replies Last reply Reply Quote 0
              • T
                tim210 @e-s last edited by

                @e-s Vielen Dank die Lösung ist super. Danke für die Hilfe

                1 Reply Last reply Reply Quote 0
                • I
                  iobroker_Alex @e-s last edited by

                  @e-s Gleiches Problem nervt mich auch. Hast du nen Github Issue offen was man unterstützen kann? Möchte das ungern mit Blockly lösen...

                  harrym E 2 Replies Last reply Reply Quote 0
                  • harrym
                    harrym @iobroker_Alex last edited by

                    @iobroker_Alex wir liefern das, was wir von dem jeweiligen shelly via CoAP bekommen. Also State S/L, den Eventcounter und zusätzlich stellen wir auch noch die eingestellte Longpushtime zu Verfügung.

                    Gerne kannst du diesbezüglich ein Ticket bei Allterco direkt erstellen.

                    1 Reply Last reply Reply Quote 0
                    • E
                      e-s @iobroker_Alex last edited by

                      @iobroker_Alex
                      Lies dir mal die ganzen shelly 1.8 und shelly adapter 4.0x threads durch.
                      Für mqtt gibt es da jetzt auch eine Einstellung im Adapter die dies Problem beseitigen soll, wenn ich das richtig verstanden habe.

                      1 Reply Last reply Reply Quote 0
                      • Boris Holowka
                        Boris Holowka last edited by Boris Holowka

                        Funktioniert der Longpush nur mit MQTT? Bei meinen Shellys mit coap, ändert sich der Status von Longpush nicht egal welche Zeit ich einstelle

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate
                        FAQ Cloud / IOT
                        HowTo: Node.js-Update
                        HowTo: Backup/Restore
                        Downloads
                        BLOG

                        508
                        Online

                        31.7k
                        Users

                        79.9k
                        Topics

                        1.3m
                        Posts

                        shelly longpush
                        6
                        15
                        2440
                        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