NEWS
Blockly für Tradfrij 5Button Remote
-
Hallo zusammen,
ich bin absolut neu im Thema Blockly.
Auch vom Programmieren habe ich soviel Ahnung wie ein Esel von der Raumfahrt.
Ok. Ein wenig mehr schon.Daher freue ich mich total, dank vieler kleiner Schnipsel und Probieren, ein Blockly gebaut zu haben, welches den Ikea 5Button Remote in Verbindung mit den Tradfrij LED Lampen (mit Farbtemperaturwahl) abbildet. Alles was ich sonst so als fertige Skripte im Netz gefunden hat, wollte bei mir nicht richtig laufen.
An / Aus, sowie Dimmen und Temperaturwechsel über "Hold-Button" funktionieren jetzt problemlos.Als nächstes soll jetzt noch das schrittweise Dimmen über den kurzen Tastendruck in definierten Werten (z.B. 25%, 50%,75%,100%), wie auch der Farbtemperaturwechsel (hier aber in einem Kreislauf, z.B. 250, 350,450,250,350,...) durchgeführt werden.
Und genau hier habe ich keine Ahnung, wie ich das realisieren soll.
Hier mal das, was ich bis jetzt habe:
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="%,Mu/V1]WI$={P{!y9U5">an/aus</variable> <variable id="+@3|s8{(xm|l^uDOF`NT">Dimmen</variable> <variable id="Uz=XyzSsU+}oc1c:*7?S">farbtemperatur</variable> <variable type="interval" id="Intervall1">Intervall1</variable> <variable type="interval" id="Intervall2">Intervall2</variable> <variable type="interval" id="Intervall3">Intervall3</variable> <variable type="interval" id="Intervall4">Intervall4</variable> <variable id="@{)(M6aOybu#pajX5Tyh">Dimmer hoch</variable> <variable id="_jCl4Y%U=T++nJhU2x9m">Dimmer runter</variable> <variable id="y-M|Tn7Zxv=,1:f;T{V{">colortemp hoch</variable> <variable id="`-}+s%:QZVgc~n**pN8!">colortemp runter</variable> </variables> <block type="on_ext" id="8?S!FoEso_.pesV4gryq" x="-13" y="-87"> <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="((+tzm`a]n1CC12Ac)A$"> <field name="oid">zigbee.0.5c0272fffe599381.toggle</field> </shadow> </value> <statement name="STATEMENT"> <block type="toggle" id="]q(:2R)?LmS;}.1JA`=2"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ab4.state</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">500</field> <field name="UNIT">ms</field> <field name="CLEAR_RUNNING">FALSE</field> <next> <block type="timeouts_wait" id="dlk5w.$+5,rzM=SKgc}M"> <field name="DELAY">500</field> <field name="UNIT">ms</field> <next> <block type="procedures_callnoreturn" id="bIi(hdgs8GOXDptL-@ls"> <mutation name="etwas tun"> <arg name="an/aus"></arg> </mutation> <value name="ARG0"> <block type="get_value" id="),mZ|VxEMJPrzbZ@9O^3"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe6c6ab4.state</field> </block> </value> </block> </next> </block> </next> </block> </statement> <next> <block type="on_ext" id="chqjG$M@16ldD3V@LW;{"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="4"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="O0RJ4w11xUhp_GPqvK.g"> <field name="oid">zigbee.0.5c0272fffe599381.up_button</field> </shadow> </value> <value name="OID1"> <shadow type="field_oid" id="(*CDT6px}F0:^nS2@rIG"> <field name="oid">zigbee.0.5c0272fffe599381.down_button</field> </shadow> </value> <value name="OID2"> <shadow type="field_oid" id="5c@?$L}gp)[5{G/}?T_,"> <field name="oid">zigbee.0.5c0272fffe599381.right_button</field> </shadow> </value> <value name="OID3"> <shadow type="field_oid" id="7GTlNl$kEmEeaz17VtX2"> <field name="oid">zigbee.0.5c0272fffe599381.left_button</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="Emzixl;CiAwIj4i4v_fD"> <mutation elseif="3" else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="1*qbK=Ag6t=_)x/Itv|F"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="*_`|p#6VcYGB5gOyl`w."> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe599381.up_button</field> </block> </value> <value name="B"> <block type="logic_boolean" id="@YGQjA~VdIT;C|TH?kK."> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_setinterval" id="nQfp4pAljD#:Q.W1c*:L"> <field name="NAME">Intervall1</field> <field name="INTERVAL">500</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="g^vCDF!5/T#0LhI{4)A%"> <field name="VAR" id="@{)(M6aOybu#pajX5Tyh">Dimmer hoch</field> <value name="VALUE"> <block type="get_value" id="l}`Wuy^yw-b9Z0[Mr@lA"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe6c6ab4.brightness</field> </block> </value> <next> <block type="math_change" id="UL^/f-,7ky[eX#S!1?EE"> <field name="VAR" id="@{)(M6aOybu#pajX5Tyh">Dimmer hoch</field> <value name="DELTA"> <shadow type="math_number" id="McIK8yil{Gy}+d:SO=/i"> <field name="NUM">5</field> </shadow> </value> <next> <block type="control" id="du}(+blVv5x.HY7#.tQ8"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ab4.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_constrain" id="|+bJ68IS6K{gAf[Q6-i$"> <value name="VALUE"> <shadow type="math_number" id="}^.wk3,=88uqI6v8o^e7"> <field name="NUM">50</field> </shadow> <block type="variables_get" id="fs|%V!/Q2+0CFPOls)YL"> <field name="VAR" id="@{)(M6aOybu#pajX5Tyh">Dimmer hoch</field> </block> </value> <value name="LOW"> <shadow type="math_number" id="LrN:^]k|u4`]IA#e+{w]"> <field name="NUM">5</field> </shadow> </value> <value name="HIGH"> <shadow type="math_number" id="A%}Lv:b@a^p;K|KVFeJb"> <field name="NUM">100</field> </shadow> </value> </block> </value> <next> <block type="procedures_callnoreturn" id="4Fl4-zqeqx{G8ZI,13yy"> <mutation name="etwas tun2"> <arg name="Dimmen"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="dik5%iL~YU[608[4@NY|"> <field name="VAR" id="@{)(M6aOybu#pajX5Tyh">Dimmer hoch</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </statement> <value name="IF1"> <block type="logic_compare" id="E9J*H3AB^BAw*=^ME$jj"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="{~35r}1g-TCNYK$7_anc"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe599381.down_button</field> </block> </value> <value name="B"> <block type="logic_boolean" id=",]nq?wKkhB^|$uvDk##|"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO1"> <block type="timeouts_setinterval" id="$P1[#ae}:iT$4FDZ%Njr"> <field name="NAME">Intervall2</field> <field name="INTERVAL">500</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="Q:v-n`gP9Q!b,D[-HqX{"> <field name="VAR" id="_jCl4Y%U=T++nJhU2x9m">Dimmer runter</field> <value name="VALUE"> <block type="get_value" id="^$GMwRy1qeNJ.tc5p$U@"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe6c6ab4.brightness</field> </block> </value> <next> <block type="math_change" id="QJfEQL$d{7R^Z)`PGt^j"> <field name="VAR" id="_jCl4Y%U=T++nJhU2x9m">Dimmer runter</field> <value name="DELTA"> <shadow type="math_number" id="Hjea?E,kMI`~sDXo}-31"> <field name="NUM">-5</field> </shadow> </value> <next> <block type="control" id=";v+]:fTdo0jP6GP7V(F~"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ab4.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_constrain" id="~XYWSI[a5:-IhBA:3_]:"> <value name="VALUE"> <shadow type="math_number"> <field name="NUM">50</field> </shadow> <block type="variables_get" id="6cT0Tua]b9/WF=AW*/#("> <field name="VAR" id="_jCl4Y%U=T++nJhU2x9m">Dimmer runter</field> </block> </value> <value name="LOW"> <shadow type="math_number" id="!Ct*c(1WuUT44($i11uj"> <field name="NUM">5</field> </shadow> </value> <value name="HIGH"> <shadow type="math_number" id="Hts0d^=tvEA5_Pj`9qJ6"> <field name="NUM">100</field> </shadow> </value> </block> </value> <next> <block type="procedures_callnoreturn" id="2DZcRp%29yp(b},FSROB"> <mutation name="etwas tun2"> <arg name="Dimmen"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="85E`OAH-zcQEL|RMB7WH"> <field name="VAR" id="_jCl4Y%U=T++nJhU2x9m">Dimmer runter</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </statement> <value name="IF2"> <block type="logic_compare" id="$FNAko#D;KUAOi:S*#[;"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="`Ca0=]/Wd_Cw}~!F`1d_"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe599381.right_button</field> </block> </value> <value name="B"> <block type="logic_boolean" id=";J,eii8fwT$hkYgC0+]p"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO2"> <block type="timeouts_setinterval" id="l_KU7AXrv0A_sonQF2?R"> <field name="NAME">Intervall3</field> <field name="INTERVAL">500</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="?q{O*5$gj954jW3[hXp8"> <field name="VAR" id="y-M|Tn7Zxv=,1:f;T{V{">colortemp hoch</field> <value name="VALUE"> <block type="get_value" id="=247I-U@3B?:s/sc5(Rm"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe6c6ab4.colortemp</field> </block> </value> <next> <block type="math_change" id="E1$Zz[-WYebk%vJyL{p1"> <field name="VAR" id="y-M|Tn7Zxv=,1:f;T{V{">colortemp hoch</field> <value name="DELTA"> <shadow type="math_number" id="$F|}UpHPt|vnYJIvDWN7"> <field name="NUM">20</field> </shadow> </value> <next> <block type="control" id="[q8VKH4_{Kp5bjgFF2C`"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ab4.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_constrain" id="-avz3o?JN8r{|lck~w/M"> <value name="VALUE"> <shadow type="math_number"> <field name="NUM">50</field> </shadow> <block type="variables_get" id=".u[/sk{},C$223iOwtO="> <field name="VAR" id="y-M|Tn7Zxv=,1:f;T{V{">colortemp hoch</field> </block> </value> <value name="LOW"> <shadow type="math_number" id="i6!7_0K=e%I/s/[(3gk]"> <field name="NUM">250</field> </shadow> </value> <value name="HIGH"> <shadow type="math_number" id="[qem;06DjVuYz/]XZdaL"> <field name="NUM">450</field> </shadow> </value> </block> </value> <next> <block type="procedures_callnoreturn" id="~MaA19=apM#,w;cHC9zH"> <mutation name="etwas tun3"> <arg name="farbtemperatur"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="E1z5z|Q$=JrCPXE$MEm{"> <field name="VAR" id="y-M|Tn7Zxv=,1:f;T{V{">colortemp hoch</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </statement> <value name="IF3"> <block type="logic_compare" id="(#9A$|Q=(jahF^at-pfj"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="m-sjXl3Ad[U}fMX`yiU,"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe599381.left_button</field> </block> </value> <value name="B"> <block type="logic_boolean" id="h/vaGkj_}o^xtgL;yY)O"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO3"> <block type="timeouts_setinterval" id="_hw.lkpYFZD~tIe*)on/"> <field name="NAME">Intervall4</field> <field name="INTERVAL">500</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="A0N0fl[g2zE!VD9_Q`:a"> <field name="VAR" id="`-}+s%:QZVgc~n**pN8!">colortemp runter</field> <value name="VALUE"> <block type="get_value" id="stK,Bd$5q`$G,ikGhpZx"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe6c6ab4.colortemp</field> </block> </value> <next> <block type="math_change" id="RN`-DP`)9S!FRgUw2Yay"> <field name="VAR" id="`-}+s%:QZVgc~n**pN8!">colortemp runter</field> <value name="DELTA"> <shadow type="math_number" id="qjWXrW*D{Y[_roz/[`e|"> <field name="NUM">-20</field> </shadow> </value> <next> <block type="control" id="X[Vz,-d(4O:WVUQxm)wL"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ab4.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_constrain" id="jLE9-R!hp:|$PY:+q@]@"> <value name="VALUE"> <shadow type="math_number"> <field name="NUM">50</field> </shadow> <block type="variables_get" id="#D$r)8YvE+#A$rEyc|V."> <field name="VAR" id="`-}+s%:QZVgc~n**pN8!">colortemp runter</field> </block> </value> <value name="LOW"> <shadow type="math_number" id="JG-SLZ-qn4/Nme96G-3Q"> <field name="NUM">250</field> </shadow> </value> <value name="HIGH"> <shadow type="math_number" id="H)9nD~1Na}[`~.Kns#6f"> <field name="NUM">450</field> </shadow> </value> </block> </value> <next> <block type="procedures_callnoreturn" id="~l5MZD-:5hYRpoGX@v.."> <mutation name="etwas tun3"> <arg name="farbtemperatur"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="q@L]jUt)n(!uVz4E#Zf%"> <field name="VAR" id="`-}+s%:QZVgc~n**pN8!">colortemp runter</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </statement> <statement name="ELSE"> <block type="timeouts_clearinterval" id="S[uwJhW.VD)w]kjkT@Mn"> <field name="NAME">Intervall1</field> <next> <block type="timeouts_clearinterval" id="G%_YFB*+~Buh,U4LGl]="> <field name="NAME">Intervall2</field> <next> <block type="timeouts_clearinterval" id="*A};*$_S}ZK!`P,#[|vV"> <field name="NAME">Intervall3</field> <next> <block type="timeouts_clearinterval" id="EF7~GF_Q2gnn;3VM?R_1"> <field name="NAME">Intervall4</field> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </statement> </block> </next> </block> <block type="procedures_defnoreturn" id="Vc;T8mM!uL)09Z1A%YV=" x="688" y="38"> <mutation> <arg name="an/aus" varid="%,Mu/V1]WI$={P{!y9U5"></arg> </mutation> <field name="NAME">etwas tun</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="control" id="-ndE(6X`QaOZN0Gf[?y#"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe7b1783.state</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="Yp1tnvV({Pyo*|x~a@P1"> <field name="VAR" id="%,Mu/V1]WI$={P{!y9U5">an/aus</field> </block> </value> <next> <block type="control" id="Ku-n*Zi3q]okAUPlye_9"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.60a423fffef36eb0.state</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="K:D+m}3Il,z:i6KX,,D^"> <field name="VAR" id="%,Mu/V1]WI$={P{!y9U5">an/aus</field> </block> </value> <next> <block type="control" id="g{XrXibu!J,fJOA#X?t8"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ad7.state</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="I[P-a%m=A0jUXLZ4zCk~"> <field name="VAR" id="%,Mu/V1]WI$={P{!y9U5">an/aus</field> </block> </value> <next> <block type="control" id="N/T4u4zOf3h1YG1j17o8"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe3d0288.state</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="|ekKG:%`KW}|}2c%Dy.S"> <field name="VAR" id="%,Mu/V1]WI$={P{!y9U5">an/aus</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> <block type="procedures_defnoreturn" id="U$`[+h-M4cov^5+]m^XF" x="963" y="513"> <mutation> <arg name="Dimmen" varid="+@3|s8{(xm|l^uDOF`NT"></arg> </mutation> <field name="NAME">etwas tun2</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="control" id="5DZJQ}7JP|$w3@8lR0#N"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe7b1783.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id=",T!w]9X(1y{$;.ZLR4=A"> <field name="VAR" id="+@3|s8{(xm|l^uDOF`NT">Dimmen</field> </block> </value> <next> <block type="control" id=":^Y;Ss}v@FW76%~:NcKO"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.60a423fffef36eb0.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="y!0?)FN]G.ovJl/bpn+A"> <field name="VAR" id="+@3|s8{(xm|l^uDOF`NT">Dimmen</field> </block> </value> <next> <block type="control" id=":s^4|2?l2Yq3))^f~Hg;"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ad7.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="Z)M0)dWp$JdV7=r/[~:T"> <field name="VAR" id="+@3|s8{(xm|l^uDOF`NT">Dimmen</field> </block> </value> <next> <block type="control" id="n!/sR+0,rCk[;*0BZz3@"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe3d0288.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="Nhtz!hYrlgF)mNp(p$2,"> <field name="VAR" id="+@3|s8{(xm|l^uDOF`NT">Dimmen</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> <block type="procedures_defnoreturn" id="zDO4=|/xq~az%KfU37IK" x="963" y="788"> <mutation> <arg name="farbtemperatur" varid="Uz=XyzSsU+}oc1c:*7?S"></arg> </mutation> <field name="NAME">etwas tun3</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="control" id="rc#sC}G@zzNiTg:#Z]q`"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe7b1783.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="8|t~^Q9LMD/;N0q-ziYI"> <field name="VAR" id="Uz=XyzSsU+}oc1c:*7?S">farbtemperatur</field> </block> </value> <next> <block type="control" id="-QD=K!G.~U8FF!^G1QO7"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.60a423fffef36eb0.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="%!Oz|bmY3*,?RU}/;M0A"> <field name="VAR" id="Uz=XyzSsU+}oc1c:*7?S">farbtemperatur</field> </block> </value> <next> <block type="control" id="pY/S@R{T!(ukeJcoCAaO"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ad7.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="?F%c%t}Ry%e6q8nsf+A;"> <field name="VAR" id="Uz=XyzSsU+}oc1c:*7?S">farbtemperatur</field> </block> </value> <next> <block type="control" id="7#0vLj}F+S1=r3`sJRNi"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe3d0288.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="ggj-P@.UCw?~j5^_vCoy"> <field name="VAR" id="Uz=XyzSsU+}oc1c:*7?S">farbtemperatur</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </xml>
Über ein paar kleine Ideen oder Denkanstöße würde ich mich sehr freuen.
-
Nun denn. Habe heute nochmal etwas weiter gebastelt.
Jetzt können die Lampen auch über einen VIS Slider in Farbtemperatur und Helligkeit geregelt werden.Aber ich stehe immer noch vor dem Problem die Farbtemperatur in einem Kreislauf über z.B. 5 Schritte mit der Klick-Funktion des 5-Button durchlaufen zu lassen.
Für die Helligkeit habe ich schon eine Idee. Sollte wie bei den Hold-Button funktionieren, nur ohne Schleife.
Falls es jemanden interessiert, hier mal das Skript. Wer Verbesserungsvorschläge hat, gerne her damit. Ich lerne noch.
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="+@3|s8{(xm|l^uDOF`NT">Dimmen</variable> <variable id="Uz=XyzSsU+}oc1c:*7?S">farbtemperatur</variable> <variable type="interval" id="Intervall1">Intervall1</variable> <variable type="interval" id="Intervall2">Intervall2</variable> <variable type="interval" id="Intervall3">Intervall3</variable> <variable type="interval" id="Intervall4">Intervall4</variable> <variable id="@{)(M6aOybu#pajX5Tyh">Dimmer hoch</variable> <variable id="_jCl4Y%U=T++nJhU2x9m">Dimmer runter</variable> <variable id="y-M|Tn7Zxv=,1:f;T{V{">colortemp hoch</variable> <variable id="`-}+s%:QZVgc~n**pN8!">colortemp runter</variable> </variables> <block type="comment" id="N7n]OH1eDly#U0ME..WX" x="312" y="-1137"> <field name="COMMENT">Alle Lampen über 5-Button oder VIS ein/aus</field> <next> <block type="on_ext" id="8?S!FoEso_.pesV4gryq"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation> <field name="CONDITION">true</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="((+tzm`a]n1CC12Ac)A$"> <field name="oid">zigbee.0.5c0272fffe599381.toggle</field> </shadow> </value> <value name="OID1"> <shadow type="field_oid" id="aPvuKP1i)~xi2h|RGZd("> <field name="oid">0_userdata.0.Vis-Taster-Wohnzimmerhauptlicht</field> </shadow> </value> <statement name="STATEMENT"> <block type="toggle" id="]q(:2R)?LmS;}.1JA`=2"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ab4.state</field> <field name="WITH_DELAY">FALSE</field> <next> <block type="toggle" id="!SS}QXSdZCr55=PD]IUs"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe7b1783.state</field> <field name="WITH_DELAY">FALSE</field> <next> <block type="toggle" id="%/(s)`ycI[LX+3*TchBG"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.60a423fffef36eb0.state</field> <field name="WITH_DELAY">FALSE</field> <next> <block type="toggle" id="Xtwlf,Tdn+-agH4u)3:Z"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ad7.state</field> <field name="WITH_DELAY">FALSE</field> <next> <block type="toggle" id="O.(,gxaJazLk|Z5U??hP"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe3d0288.state</field> <field name="WITH_DELAY">FALSE</field> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="$:yo#bh=R~PRP0~}Pxt0"> <field name="COMMENT">Vis-Dimmer</field> <next> <block type="on" id="ii4q41X$+ZowWkvx-x#@"> <field name="OID">0_userdata.0.VIS-Dimmer-Wohnzimmerhauptlicht</field> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="control" id="*9MYKL*-7U[_r#T8#+y4"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ab4.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="get_value" id="eKs2|h6jD?qvW}$5j4^I"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.VIS-Dimmer-Wohnzimmerhauptlicht</field> </block> </value> <next> <block type="control" id="VU/JJHzgP*sKnR0U!^p7"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe7b1783.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="get_value" id=".^IMcp%N(=wt83d(|.w}"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.VIS-Dimmer-Wohnzimmerhauptlicht</field> </block> </value> <next> <block type="control" id="%{mH%_#G5=i.eyZA;nh3"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.60a423fffef36eb0.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="get_value" id="cpQn$3hANy[:`FXeZ)ML"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.VIS-Dimmer-Wohnzimmerhauptlicht</field> </block> </value> <next> <block type="control" id="zEeG7E?G`6]bYtdT!mZc"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ad7.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="get_value" id="nDi2#6;+lZ3E}]*IZw3I"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.VIS-Dimmer-Wohnzimmerhauptlicht</field> </block> </value> <next> <block type="control" id="*a[_mz1sA3S4o02imX_$"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe3d0288.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="get_value" id="ex_A}.pYx${kk:(P3{Wb"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.VIS-Dimmer-Wohnzimmerhauptlicht</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="wcT;E;#x]:z,*J%HMx)|"> <field name="COMMENT">Vis-Colortemp</field> <next> <block type="on" id="Vg4B@*U~tsH};~U1rQ|_"> <field name="OID">0_userdata.0.VIS-Fambtemperatur</field> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="control" id=":Imy8SgV2TF7UzpuPbc?"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ab4.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="get_value" id="ePhWt{_Xz}d{dnYjVi?S"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.VIS-Fambtemperatur</field> </block> </value> <next> <block type="control" id="et.,5aKJSMuttBtwi-E4"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe7b1783.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="get_value" id="sN.q1-wJwB2ieJ|VA4S4"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.VIS-Fambtemperatur</field> </block> </value> <next> <block type="control" id="EXu]whggVW_0Yxn86@I4"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.60a423fffef36eb0.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="get_value" id="AsF]-,rM+GVH0.iq`!Oc"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.VIS-Fambtemperatur</field> </block> </value> <next> <block type="control" id="sP:x!h{%y+OZH?`Z**FK"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ad7.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="get_value" id="VBaAMd|Z20p:xaBY$uIT"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.VIS-Fambtemperatur</field> </block> </value> <next> <block type="control" id="jxX~`6}gXgnE^9P*$9.)"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe3d0288.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="get_value" id=")3`/]0}r4#I6{]asntox"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.VIS-Fambtemperatur</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="*(:7vn6={%0d2wcuese]"> <field name="COMMENT">Alle Lampen über Ikea 5-Button dimmen und Farbtemp</field> <next> <block type="on_ext" id="chqjG$M@16ldD3V@LW;{"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="4"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="O0RJ4w11xUhp_GPqvK.g"> <field name="oid">zigbee.0.5c0272fffe599381.up_button</field> </shadow> </value> <value name="OID1"> <shadow type="field_oid" id="(*CDT6px}F0:^nS2@rIG"> <field name="oid">zigbee.0.5c0272fffe599381.down_button</field> </shadow> </value> <value name="OID2"> <shadow type="field_oid" id="5c@?$L}gp)[5{G/}?T_,"> <field name="oid">zigbee.0.5c0272fffe599381.right_button</field> </shadow> </value> <value name="OID3"> <shadow type="field_oid" id="7GTlNl$kEmEeaz17VtX2"> <field name="oid">zigbee.0.5c0272fffe599381.left_button</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="Emzixl;CiAwIj4i4v_fD"> <mutation elseif="3" else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="1*qbK=Ag6t=_)x/Itv|F"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="*_`|p#6VcYGB5gOyl`w."> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe599381.up_button</field> </block> </value> <value name="B"> <block type="logic_boolean" id="@YGQjA~VdIT;C|TH?kK."> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_setinterval" id="nQfp4pAljD#:Q.W1c*:L"> <field name="NAME">Intervall1</field> <field name="INTERVAL">500</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="g^vCDF!5/T#0LhI{4)A%"> <field name="VAR" id="@{)(M6aOybu#pajX5Tyh">Dimmer hoch</field> <value name="VALUE"> <block type="get_value" id="l}`Wuy^yw-b9Z0[Mr@lA"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe6c6ab4.brightness</field> </block> </value> <next> <block type="math_change" id="UL^/f-,7ky[eX#S!1?EE"> <field name="VAR" id="@{)(M6aOybu#pajX5Tyh">Dimmer hoch</field> <value name="DELTA"> <shadow type="math_number" id="McIK8yil{Gy}+d:SO=/i"> <field name="NUM">5</field> </shadow> </value> <next> <block type="control" id="du}(+blVv5x.HY7#.tQ8"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ab4.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_constrain" id="|+bJ68IS6K{gAf[Q6-i$"> <value name="VALUE"> <shadow type="math_number" id="}^.wk3,=88uqI6v8o^e7"> <field name="NUM">50</field> </shadow> <block type="variables_get" id="fs|%V!/Q2+0CFPOls)YL"> <field name="VAR" id="@{)(M6aOybu#pajX5Tyh">Dimmer hoch</field> </block> </value> <value name="LOW"> <shadow type="math_number" id="LrN:^]k|u4`]IA#e+{w]"> <field name="NUM">5</field> </shadow> </value> <value name="HIGH"> <shadow type="math_number" id="A%}Lv:b@a^p;K|KVFeJb"> <field name="NUM">100</field> </shadow> </value> </block> </value> <next> <block type="procedures_callnoreturn" id="4Fl4-zqeqx{G8ZI,13yy"> <mutation name="etwas tun2"> <arg name="Dimmen"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="dik5%iL~YU[608[4@NY|"> <field name="VAR" id="@{)(M6aOybu#pajX5Tyh">Dimmer hoch</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </statement> <value name="IF1"> <block type="logic_compare" id="E9J*H3AB^BAw*=^ME$jj"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="{~35r}1g-TCNYK$7_anc"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe599381.down_button</field> </block> </value> <value name="B"> <block type="logic_boolean" id=",]nq?wKkhB^|$uvDk##|"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO1"> <block type="timeouts_setinterval" id="$P1[#ae}:iT$4FDZ%Njr"> <field name="NAME">Intervall2</field> <field name="INTERVAL">500</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="Q:v-n`gP9Q!b,D[-HqX{"> <field name="VAR" id="_jCl4Y%U=T++nJhU2x9m">Dimmer runter</field> <value name="VALUE"> <block type="get_value" id="^$GMwRy1qeNJ.tc5p$U@"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe6c6ab4.brightness</field> </block> </value> <next> <block type="math_change" id="QJfEQL$d{7R^Z)`PGt^j"> <field name="VAR" id="_jCl4Y%U=T++nJhU2x9m">Dimmer runter</field> <value name="DELTA"> <shadow type="math_number" id="Hjea?E,kMI`~sDXo}-31"> <field name="NUM">-5</field> </shadow> </value> <next> <block type="control" id=";v+]:fTdo0jP6GP7V(F~"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ab4.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_constrain" id="~XYWSI[a5:-IhBA:3_]:"> <value name="VALUE"> <shadow type="math_number"> <field name="NUM">50</field> </shadow> <block type="variables_get" id="6cT0Tua]b9/WF=AW*/#("> <field name="VAR" id="_jCl4Y%U=T++nJhU2x9m">Dimmer runter</field> </block> </value> <value name="LOW"> <shadow type="math_number" id="!Ct*c(1WuUT44($i11uj"> <field name="NUM">5</field> </shadow> </value> <value name="HIGH"> <shadow type="math_number" id="Hts0d^=tvEA5_Pj`9qJ6"> <field name="NUM">100</field> </shadow> </value> </block> </value> <next> <block type="procedures_callnoreturn" id="2DZcRp%29yp(b},FSROB"> <mutation name="etwas tun2"> <arg name="Dimmen"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="85E`OAH-zcQEL|RMB7WH"> <field name="VAR" id="_jCl4Y%U=T++nJhU2x9m">Dimmer runter</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </statement> <value name="IF2"> <block type="logic_compare" id="$FNAko#D;KUAOi:S*#[;"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="`Ca0=]/Wd_Cw}~!F`1d_"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe599381.right_button</field> </block> </value> <value name="B"> <block type="logic_boolean" id=";J,eii8fwT$hkYgC0+]p"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO2"> <block type="timeouts_setinterval" id="l_KU7AXrv0A_sonQF2?R"> <field name="NAME">Intervall3</field> <field name="INTERVAL">500</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="?q{O*5$gj954jW3[hXp8"> <field name="VAR" id="y-M|Tn7Zxv=,1:f;T{V{">colortemp hoch</field> <value name="VALUE"> <block type="get_value" id="=247I-U@3B?:s/sc5(Rm"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe6c6ab4.colortemp</field> </block> </value> <next> <block type="math_change" id="E1$Zz[-WYebk%vJyL{p1"> <field name="VAR" id="y-M|Tn7Zxv=,1:f;T{V{">colortemp hoch</field> <value name="DELTA"> <shadow type="math_number" id="$F|}UpHPt|vnYJIvDWN7"> <field name="NUM">20</field> </shadow> </value> <next> <block type="control" id="[q8VKH4_{Kp5bjgFF2C`"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ab4.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_constrain" id="-avz3o?JN8r{|lck~w/M"> <value name="VALUE"> <shadow type="math_number"> <field name="NUM">50</field> </shadow> <block type="variables_get" id=".u[/sk{},C$223iOwtO="> <field name="VAR" id="y-M|Tn7Zxv=,1:f;T{V{">colortemp hoch</field> </block> </value> <value name="LOW"> <shadow type="math_number" id="i6!7_0K=e%I/s/[(3gk]"> <field name="NUM">250</field> </shadow> </value> <value name="HIGH"> <shadow type="math_number" id="[qem;06DjVuYz/]XZdaL"> <field name="NUM">450</field> </shadow> </value> </block> </value> <next> <block type="procedures_callnoreturn" id="~MaA19=apM#,w;cHC9zH"> <mutation name="etwas tun3"> <arg name="farbtemperatur"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="E1z5z|Q$=JrCPXE$MEm{"> <field name="VAR" id="y-M|Tn7Zxv=,1:f;T{V{">colortemp hoch</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </statement> <value name="IF3"> <block type="logic_compare" id="(#9A$|Q=(jahF^at-pfj"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="m-sjXl3Ad[U}fMX`yiU,"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe599381.left_button</field> </block> </value> <value name="B"> <block type="logic_boolean" id="h/vaGkj_}o^xtgL;yY)O"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO3"> <block type="timeouts_setinterval" id="_hw.lkpYFZD~tIe*)on/"> <field name="NAME">Intervall4</field> <field name="INTERVAL">500</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="A0N0fl[g2zE!VD9_Q`:a"> <field name="VAR" id="`-}+s%:QZVgc~n**pN8!">colortemp runter</field> <value name="VALUE"> <block type="get_value" id="stK,Bd$5q`$G,ikGhpZx"> <field name="ATTR">val</field> <field name="OID">zigbee.0.5c0272fffe6c6ab4.colortemp</field> </block> </value> <next> <block type="math_change" id="RN`-DP`)9S!FRgUw2Yay"> <field name="VAR" id="`-}+s%:QZVgc~n**pN8!">colortemp runter</field> <value name="DELTA"> <shadow type="math_number" id="qjWXrW*D{Y[_roz/[`e|"> <field name="NUM">-20</field> </shadow> </value> <next> <block type="control" id="X[Vz,-d(4O:WVUQxm)wL"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ab4.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_constrain" id="jLE9-R!hp:|$PY:+q@]@"> <value name="VALUE"> <shadow type="math_number"> <field name="NUM">50</field> </shadow> <block type="variables_get" id="#D$r)8YvE+#A$rEyc|V."> <field name="VAR" id="`-}+s%:QZVgc~n**pN8!">colortemp runter</field> </block> </value> <value name="LOW"> <shadow type="math_number" id="JG-SLZ-qn4/Nme96G-3Q"> <field name="NUM">250</field> </shadow> </value> <value name="HIGH"> <shadow type="math_number" id="H)9nD~1Na}[`~.Kns#6f"> <field name="NUM">450</field> </shadow> </value> </block> </value> <next> <block type="procedures_callnoreturn" id="~l5MZD-:5hYRpoGX@v.."> <mutation name="etwas tun3"> <arg name="farbtemperatur"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="q@L]jUt)n(!uVz4E#Zf%"> <field name="VAR" id="`-}+s%:QZVgc~n**pN8!">colortemp runter</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </statement> <statement name="ELSE"> <block type="timeouts_clearinterval" id="S[uwJhW.VD)w]kjkT@Mn"> <field name="NAME">Intervall1</field> <next> <block type="timeouts_clearinterval" id="G%_YFB*+~Buh,U4LGl]="> <field name="NAME">Intervall2</field> <next> <block type="timeouts_clearinterval" id="*A};*$_S}ZK!`P,#[|vV"> <field name="NAME">Intervall3</field> <next> <block type="timeouts_clearinterval" id="EF7~GF_Q2gnn;3VM?R_1"> <field name="NAME">Intervall4</field> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> <block type="procedures_defnoreturn" id="U$`[+h-M4cov^5+]m^XF" x="1238" y="62"> <mutation> <arg name="Dimmen" varid="+@3|s8{(xm|l^uDOF`NT"></arg> </mutation> <field name="NAME">etwas tun2</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="control" id="5DZJQ}7JP|$w3@8lR0#N"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe7b1783.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id=",T!w]9X(1y{$;.ZLR4=A"> <field name="VAR" id="+@3|s8{(xm|l^uDOF`NT">Dimmen</field> </block> </value> <next> <block type="control" id=":^Y;Ss}v@FW76%~:NcKO"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.60a423fffef36eb0.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="y!0?)FN]G.ovJl/bpn+A"> <field name="VAR" id="+@3|s8{(xm|l^uDOF`NT">Dimmen</field> </block> </value> <next> <block type="control" id=":s^4|2?l2Yq3))^f~Hg;"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ad7.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="Z)M0)dWp$JdV7=r/[~:T"> <field name="VAR" id="+@3|s8{(xm|l^uDOF`NT">Dimmen</field> </block> </value> <next> <block type="control" id="n!/sR+0,rCk[;*0BZz3@"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe3d0288.brightness</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="Nhtz!hYrlgF)mNp(p$2,"> <field name="VAR" id="+@3|s8{(xm|l^uDOF`NT">Dimmen</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> <block type="procedures_defnoreturn" id="zDO4=|/xq~az%KfU37IK" x="1262" y="513"> <mutation> <arg name="farbtemperatur" varid="Uz=XyzSsU+}oc1c:*7?S"></arg> </mutation> <field name="NAME">etwas tun3</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="control" id="rc#sC}G@zzNiTg:#Z]q`"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe7b1783.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="8|t~^Q9LMD/;N0q-ziYI"> <field name="VAR" id="Uz=XyzSsU+}oc1c:*7?S">farbtemperatur</field> </block> </value> <next> <block type="control" id="-QD=K!G.~U8FF!^G1QO7"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.60a423fffef36eb0.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="%!Oz|bmY3*,?RU}/;M0A"> <field name="VAR" id="Uz=XyzSsU+}oc1c:*7?S">farbtemperatur</field> </block> </value> <next> <block type="control" id="pY/S@R{T!(ukeJcoCAaO"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe6c6ad7.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="?F%c%t}Ry%e6q8nsf+A;"> <field name="VAR" id="Uz=XyzSsU+}oc1c:*7?S">farbtemperatur</field> </block> </value> <next> <block type="control" id="7#0vLj}F+S1=r3`sJRNi"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">zigbee.0.5c0272fffe3d0288.colortemp</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="variables_get" id="ggj-P@.UCw?~j5^_vCoy"> <field name="VAR" id="Uz=XyzSsU+}oc1c:*7?S">farbtemperatur</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </xml>
-
@der-trollo ich würde einen Datenpunkt als Zähler erstellen.
Dazu ein Array mit dem Helligkeitswert des jeweiligen Zählindex.Wenn Button gedrückt, hole Wert von Zähler.
Zähler=Zähler +/-1
Wenn Zähler < 0 dann Zähler =Array-Länge-1
Wenn Zähler > Array-Länge-1 dann Zähler=0
Setzte Farbtemperatur auf Wert von Array mit ID Zähler -
@der-trollo Hey würdest du mir dein Blockly mal etwas erläutern? Vorallem sagen welche Datenpunkte des Schalters und der Lampe sind? Ich bin absoluter Neuling und könnte hierbei einiges lernen. Wäre dir sehr dankbar.
LG Jannis