NEWS
Dimmbare Lampe mit mehren Tastern schalten Blockly/Szene
-
@kusi am liebsten wäre mir die Variante des einzeln Schaltens mit der Option die Lampen gemeinsam anzuschalten.
Aber wenn dann in etwa so : S = Lampe1 an, SS = Lampe 2 an, L = Lampe 1 und 2 an, S = aus.
-
@grace13 Versuche mal dieses Blockly... Natürlich noch die Datenpunkte anpassen.. Hier geht es vor allem darum, ob sich die Lampen einwandfrei schalten lassen. Das Blockly würden wir danach anpassen, unter anderem 3 Schalter, Dimmen, usw...
<xml xmlns="https://developers.google.com/blockly/xml"> <block type="on_ext" id=";ah|4FyM8XdtTF@nrJ4v" x="453" y="72"> <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 type="field_oid" id="%eta3H,,1]apG$Jy|A.T"> <field name="oid">0_userdata.0.aa_-_Licht.T1_-_Event</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="Woj6#jb`9-RR5pfpL,db"> <mutation elseif="2"></mutation> <value name="IF0"> <block type="logic_compare" id="riX$Q^.0~PqIx(-8TTko"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id=",fZ40FT/.Y+pF-ZpFJeK"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="text" id="SEK,Cz{GKJCb#Jy8v{(A"> <field name="TEXT">S</field> </block> </value> </block> </value> <statement name="DO0"> <block type="controls_if" id=".CGRHUKjat!i2pOmtKG."> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_operation" id="7:;F?rI+jqA3Z:=S3lKd" inline="false"> <field name="OP">OR</field> <value name="A"> <block type="logic_compare" id="Yn,@XPaLaND=BM[KeE]A"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="wa3WmVaFa.wJ$kntpQ!."> <field name="ATTR">val</field> <field name="OID">0_userdata.0.aa_-_Licht.L1_Switch</field> </block> </value> <value name="B"> <block type="logic_boolean" id="Ag58?ogd$AO9.7e1q%Wn"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="QsjCTYFc-A]_($t/OV.;"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="yT_Xc_@(Y=/Y,q-,6jeh"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.aa_-_Licht.L2_Switch</field> </block> </value> <value name="B"> <block type="logic_boolean" id="7=%)fx-gxn0g)7YWORWO"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="comment" id="wEuma7]u]Ie)7ihOp+@)"> <field name="COMMENT">ausschalten wenn mind. 1 Lampe eingeschaltet</field> <next> <block type="control" id="vk{;+lHKszJCP:ewE:|v"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.aa_-_Licht.L1_Switch</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="ISM_/ShR!8HBJ}H]wler"> <field name="BOOL">FALSE</field> </block> </value> <next> <block type="control" id="aEd4{J-f|@JmRJoH^;X:"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.aa_-_Licht.L2_Switch</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="#zXY@.=6R@p;Py(%((-V"> <field name="BOOL">FALSE</field> </block> </value> </block> </next> </block> </next> </block> </statement> <statement name="ELSE"> <block type="comment" id="%kj!::$LaPd!q^W`=Xh8"> <field name="COMMENT">ansonsten Lampe 1 einschalten</field> <next> <block type="control" id="%B^mOp5hU=p,3[f1AHi#"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.aa_-_Licht.L1_Switch</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="o.2!2isp?]`7/IR*q)kl"> <field name="BOOL">TRUE</field> </block> </value> </block> </next> </block> </statement> </block> </statement> <value name="IF1"> <block type="logic_compare" id="q*3m2KzcoD;VR8@MfLCc"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="u=00k/LKt[,x4//4;RQv"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="text" id="8u66]k5qNWM)T[VG?]9*"> <field name="TEXT">SS</field> </block> </value> </block> </value> <statement name="DO1"> <block type="control" id="9Mo)g;Mi5ZX8e(:.*9H^"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.aa_-_Licht.L2_Switch</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="kIq~+R6pI#]5TdTWhUQM"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> <value name="IF2"> <block type="logic_compare" id="MazqTj|fl.`LK$7B=;!:"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="OxsMEy`G+4_xaXrlY9?#"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="text" id="L_MwIpG9SNgQ.8!i3r;j"> <field name="TEXT">L</field> </block> </value> </block> </value> <statement name="DO2"> <block type="control" id="ZZQ0s[y@T@k`5.N{80Gn"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.aa_-_Licht.L1_Switch</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="UbfsyZ];=e-]xzopv+Wb"> <field name="BOOL">TRUE</field> </block> </value> <next> <block type="control" id="U:0W9ys}502w;sj(SxQY"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.aa_-_Licht.L2_Switch</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="mZo{?z3=Qnf(HD=ljzA;"> <field name="BOOL">TRUE</field> </block> </value> </block> </next> </block> </statement> </block> </statement> </block> </xml>
-
@Kusi habe es so wie du getestet, funktioniert allerdings genauso wie die bisheringer versuche. Heißt, wenn beim Taster Status "S" gesetzt ist und ich erneuet "S (Short Push)" drücke passiert nichts. Von L zu S oder SS zu S funktioniert alles wie gewollt.
Ich glaube man kommt um die Verwendung des Datenpunktes "Evenet Counter" nicht rum? -
@grace13 sagte in Dimmbare Lampe mit mehren Tastern schalten Blockly/Szene:
erneuet "S (Short Push)" drücke passiert nichts
Und du hast wirklich "wurde aktualisiert" angewählt und NICHT "wurde geändert"???
Hast du mein Blockly importiert oder nachgebaut??
-
@kusi ich habe es importiert und die Datenpunkte angepasst.
Habe es mit "wurde aktualisiert" und "wurde geändert" versucht. -
@grace13 sagte in Dimmbare Lampe mit mehren Tastern schalten Blockly/Szene:
Evenet Counter
Was macht der Datenpunkt "Event Counter" genau? Ändert der sich bei jedem Tastendruck??
-
@kusi genau, der Event Counter vom Shelly i3 erhöht sich bei jedem Tasten druck egal ob S, SS oder L um eins.
-
@grace13 sagte in Dimmbare Lampe mit mehren Tastern schalten Blockly/Szene:
erhöht sich bei jedem Tasten druck
Zu meinem Verständnis:
Wenn du mehrmals die gleiche Taste (z.B. S) drücksz, dann erhöht sich der Counter.
Wenn du dann eine andere Taste drückst, dann geht dieser wieder auf 1.Stimmt diese Annahme??
-
@kusi Nein, der Counter erhört sich bei jedem Tasten druck egal ob S, SS oder L.
Die Spots in der Küche werden bsp. so gesteuert. ( wahrscheinlich verbesserungswürdig)
-
@grace13 sagte in Dimmbare Lampe mit mehren Tastern schalten Blockly/Szene:
Counter erhört sich bei jedem Tasten
Bis zur Unendlichkeit??
-
Ich finde es auch etwas seltsam das sich die Datenpunkte nicht Aktualisieren, das ist mir rätselhaft.
Dann trigger doch auf die Counter der Schalter und mach "größer als letztes".
Ich glaube du hattest es auch anfangs schon so gell. -
-
@grace13 sagte in Dimmbare Lampe mit mehren Tastern schalten Blockly/Szene:
Die Spots in der Küche werden bsp. so gesteuert
Wenn es so klappt, dann wäre das ja gut so...
-
@kusi ja, immerhin etwas
nur stell ich mich etwas schwer bei dem anpassen des bisherigen Skriptes.. werde mich heute Abend mal dran setzen.
-
@grace13
Sofern sich die Lampen mit dem Dimmwert 0 ausschalten, dann könnte es so gelöst werden.<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="w$,5eohj54+sLUicSMBm">Lampe 1</variable> <variable id=",UwtB-e~WJ7)BJ$W@:}*">Lampe 2</variable> <variable id="Szs/v50CXOqEe@/69%l6">Taste</variable> </variables> <block type="comment" id="oju=07HwUA6b8lwV25[O" x="12" y="-87"> <field name="COMMENT">Counter Taste 1</field> <next> <block type="on_ext" id="-At(yzVr53|/*DG@C$t8"> <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="oolYED60n8[dt*-J/cvH"> <field name="oid">default</field> </shadow> </value> <statement name="STATEMENT"> <block type="procedures_callnoreturn" id="XA#uI7bJ3d-*iaWiE)Vk"> <mutation name="Taste gedrückt"> <arg name="Taste"></arg> </mutation> <value name="ARG0"> <block type="get_value" id="SRz4_1mmfv7)!jFhdl/y"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.aa_-_Licht.T1_-_Event</field> </block> </value> </block> </statement> </block> </next> </block> <block type="procedures_defnoreturn" id="z3tkIeTxS*fx:Pr=5Tl)" x="537" y="-62"> <mutation> <arg name="Taste" varid="Szs/v50CXOqEe@/69%l6"></arg> </mutation> <field name="NAME">Taste gedrückt</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="logic_switch_case" id="SDzJ6fh`#o}_i4x2-5,^"> <mutation xmlns="http://www.w3.org/1999/xhtml" case="2"></mutation> <value name="CONDITION"> <block type="variables_get" id="v:@+;cYH$C!lmuW~.M(B"> <field name="VAR" id="Szs/v50CXOqEe@/69%l6">Taste</field> </block> </value> <value name="CASECONDITION0"> <block type="text" id="wof%+tLmyn^6|HYJNuUe"> <field name="TEXT">S</field> </block> </value> <statement name="CASE0"> <block type="controls_if" id=".CGRHUKjat!i2pOmtKG."> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_operation" id="7:;F?rI+jqA3Z:=S3lKd" inline="false"> <field name="OP">OR</field> <value name="A"> <block type="get_value" id="wa3WmVaFa.wJ$kntpQ!."> <field name="ATTR">val</field> <field name="OID">0_userdata.0.aa_-_Licht.L1_Switch</field> </block> </value> <value name="B"> <block type="get_value" id="yT_Xc_@(Y=/Y,q-,6jeh"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.aa_-_Licht.L2_Switch</field> </block> </value> </block> </value> <statement name="DO0"> <block type="comment" id="wEuma7]u]Ie)7ihOp+@)"> <field name="COMMENT">ausschalten wenn mind. 1 Lampe eingeschaltet</field> <next> <block type="procedures_callnoreturn" id="!Mzez+)K^@^`A()e25jr"> <mutation name="Licht steuern"> <arg name="Lampe 1"></arg> <arg name="Lampe 2"></arg> </mutation> <value name="ARG0"> <block type="math_number" id="`t;N2JJFZH__-/P$XiHN"> <field name="NUM">0</field> </block> </value> <value name="ARG1"> <block type="math_number" id="pBAe/UHe01K$My7;Ol_I"> <field name="NUM">0</field> </block> </value> </block> </next> </block> </statement> <statement name="ELSE"> <block type="comment" id="%kj!::$LaPd!q^W`=Xh8"> <field name="COMMENT">ansonsten Lampe 1 einschalten</field> <next> <block type="procedures_callnoreturn" id="Ua@+]P3K7HRw;(NH[YtM"> <mutation name="Licht steuern"> <arg name="Lampe 1"></arg> <arg name="Lampe 2"></arg> </mutation> <value name="ARG0"> <block type="math_number" id="+[[_]%AS}RLQ2y{*KN|("> <field name="NUM">100</field> </block> </value> <value name="ARG1"> <block type="math_number" id="6.?L8ImF@@lo|Cuv6;|W"> <field name="NUM">0</field> </block> </value> </block> </next> </block> </statement> </block> </statement> <value name="CASECONDITION1"> <block type="text" id="=?Vr)TF^f5PO8[.l,:uS"> <field name="TEXT">SS</field> </block> </value> <statement name="CASE1"> <block type="procedures_callnoreturn" id="hfp$%TybxDO5jpi7wsj:"> <mutation name="Licht steuern"> <arg name="Lampe 1"></arg> <arg name="Lampe 2"></arg> </mutation> <value name="ARG0"> <block type="math_number" id="dGTH~*ezQfvT(W!V`e5H"> <field name="NUM">0</field> </block> </value> <value name="ARG1"> <block type="math_number" id="~H([Oj~+TNF68,K`tMlv"> <field name="NUM">100</field> </block> </value> </block> </statement> <value name="CASECONDITION2"> <block type="text" id="+J4b.u^=Je^}/wF{sPH*"> <field name="TEXT">L</field> </block> </value> <statement name="CASE2"> <block type="procedures_callnoreturn" id="9kp,/F9MN|F]gC;DT/]?"> <mutation name="Licht steuern"> <arg name="Lampe 1"></arg> <arg name="Lampe 2"></arg> </mutation> <value name="ARG0"> <block type="math_number" id="b5DK7vv,=}-n4Pd?6nDF"> <field name="NUM">100</field> </block> </value> <value name="ARG1"> <block type="math_number" id="be*sHHP=}(SUKCiK%-lE"> <field name="NUM">100</field> </block> </value> </block> </statement> </block> </statement> </block> <block type="comment" id="X!A:wB13iz#=^t7=8@Zy" x="12" y="113"> <field name="COMMENT">Counter Taste 2</field> <next> <block type="on_ext" id="]bS!0]ZideX|8N{16U]L"> <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="kodbXh:{ufHsU17(cdaf"> <field name="oid">default</field> </shadow> </value> <statement name="STATEMENT"> <block type="procedures_callnoreturn" id="!VQ2=wTwt$_i4@$BfB)^"> <mutation name="Taste gedrückt"> <arg name="Taste"></arg> </mutation> <value name="ARG0"> <block type="get_value" id="=hfX:|]I(B3l!vb0Nzm{"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.aa_-_Licht.T2_-_Event</field> </block> </value> </block> </statement> </block> </next> </block> <block type="comment" id="mOX~D@O+6C!G$o36bYQY" x="12" y="313"> <field name="COMMENT">Counter Taste 3</field> <next> <block type="on_ext" id="~S|QTMlBb[B5{oXLwiiD"> <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="KrNUw?G9FRG-aC]l7-y5"> <field name="oid">default</field> </shadow> </value> <statement name="STATEMENT"> <block type="procedures_callnoreturn" id="p7Wa8BJPw#m#t3%4Z3}Q"> <mutation name="Taste gedrückt"> <arg name="Taste"></arg> </mutation> <value name="ARG0"> <block type="get_value" id="F@gR0!GT7ZGRs_}x[!vT"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.aa_-_Licht.T3_-_Event</field> </block> </value> </block> </statement> </block> </next> </block> <block type="procedures_defnoreturn" id="+`$SStF:o,WtYrlV69M7" x="537" y="588"> <mutation> <arg name="Lampe 1" varid="w$,5eohj54+sLUicSMBm"></arg> <arg name="Lampe 2" varid=",UwtB-e~WJ7)BJ$W@:}*"></arg> </mutation> <field name="NAME">Licht steuern</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="control" id="oQ[xo3#VVYqMorYULV!v"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.aa_-_Licht.L1_Brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="M[!qW(]]Mq!6zKOL1atP"> <field name="VAR" id="w$,5eohj54+sLUicSMBm">Lampe 1</field> </block> </value> <next> <block type="control" id="%B^mOp5hU=p,3[f1AHi#"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.aa_-_Licht.L2_Brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="n99aHxM{M*Zw`[F15+R_"> <field name="VAR" id=",UwtB-e~WJ7)BJ$W@:}*">Lampe 2</field> </block> </value> </block> </next> </block> </statement> </block> </xml>