NEWS
Script Hilfe licht über Xiaomi Switch anschalten.
-
Wenn du was lernen willst, als Anfang zum einarbeiten:
-
@iomountain Dankeschön. Aber wieso ist oben Quad und many Klick? ich probiere mal meine Werte einzusetzen und zu verstehen wie alles funktioniert. Ist das aber nicht auch nur für einen Switch?
-
meiner ist über einen Zigbee Stick angebunden und in den Objekten gibt es
Wobei vierfach und many Click für mich schwer zu treffen sind.
Zeig mal wie deiner in den Objekten aussieht. -
So sieht es bei mir bei den Objekten aus. Ich habe jetzt einfach mal probiert über einen Klick das Licht anzuschalten, leider funktioniert es nicht. Muss ich noch irgendwo was ändern in dem Script?
-
Kümmern wir uns erst mal um den simple click.
Über den Falls Teil fragst du ob das Licht schon an ist
Bei mir sogar zwei Lampen.
Denke da müsste dein Licht Power rein -
Dann muss dort der Power State von dem Sonoff rein oder? Licht wird ja über einen Sonoff ein und aus geschaltet.
-
sieht gut aus, jetzt an diesen debug Baustein
einen steuere Baustein mit false anhängen. -
@iomountain Wo soll ich da einen Baustein anhängen?
-
-
@iomountain
so also? Welches Objekt kommt dort rein? -
das, welches dein Licht an aus schaltet
-
@iomountain Hab ich jetzt drin. Passiert leider nichts.
-
mach mal einen Export von deinem Code
-
@iomountain <xml xmlns="http://www.w3.org/1999/xhtml">
<block type="comment" id="@cY?z8Mo[rp~6xjYRB9" x="88" y="-462">
<field name="COMMENT">Taster XIAOMI Nr. 3</field>
<next>
<block type="on_ext" id="PB-24CkO9W+A,wx(U/~p">
<mutation items="6"></mutation>
<field name="CONDITION">gt</field>
<field name="ACK_CONDITION">true</field>
<value name="OID0">
<shadow type="field_oid" id=")QiF{:XZIsphth0IP^H">
<field name="oid">default</field>
</shadow>
<block type="field_oid" id="rgjNSi2xzP32iFTE[Zr"> <field name="oid">mihome.0.devices.switch_158d0001e5c139.click</field> </block> </value> <value name="OID1"> <shadow type="field_oid" id="iaF=)P=-;PAAd,)/4%vi"> <field name="oid">default</field> </shadow> <block type="field_oid" id="ea3t6_MlYEPR}*?yzCqA"> <field name="oid">zigbee.0.00158d0002b02f86.double_click</field> </block> </value> <value name="OID2"> <shadow type="field_oid" id="^US+uZxi^vOuQI|KuALq"> <field name="oid">default</field> </shadow> <block type="field_oid" id="Ro15Nv;8Sl9+.0nGHq^%"> <field name="oid">zigbee.0.00158d0002b02f86.triple_click</field> </block> </value> <value name="OID3"> <shadow type="field_oid" id="R2Lb}B~M^5V1#^vXl,xw"> <field name="oid">default</field> </shadow> <block type="field_oid" id="=?EUmg0.O3+z.RryC=xB"> <field name="oid">zigbee.0.00158d0002b02f86.quad_click</field> </block> </value> <value name="OID4"> <shadow type="field_oid" id="9i}=7+CVZh@d7@#)C3;}"> <field name="oid">default</field> </shadow> <block type="field_oid" id="?ojg03%rW]}Gl-_0!
1x">
<field name="oid">zigbee.0.00158d0002b02f86.many_click</field>
</block>
</value>
<value name="OID5">
<shadow type="field_oid" id="?EarP}N#oxmuZYcD#w?A">
<field name="oid">default</field>
</shadow>
<block type="field_oid" id="Qn6/h8f3[DPd@i5_M
8">
<field name="oid">zigbee.0.00158d0002b02f86.long_click</field>
</block>
</value>
<statement name="STATEMENT">
<block type="debug" id="r/YqCq!4BPo^D%562f@H">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="5hv99z~G)
/zHUNWPf~">
<field name="TEXT">es wurde geklickt</field>
</shadow>
</value>
<next>
<block type="controls_if" id="^%rfwf,9(7^?Gd1W(2rH">
<mutation elseif="5"></mutation>
<value name="IF0">
<block type="logic_compare" id="B7oHd]+ob+83AYT#!UOR">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="%l[Ebz+^3abG+/nZ_|%6">
<field name="ATTR">val</field>
<field name="OID">zigbee.0.00158d0002b02f86.click</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="ciW[o-HOq!fpNWr0GQx">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="debug" id="77)Pc:(kqD!l@AdFktg"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="?D:soVS]Ik_MSh,2sepk"> <field name="TEXT">click</field> </shadow> </value> <next> <block type="comment" id="i*jra%1wLggjCGzi/q{W"> <field name="COMMENT">je nach click</field> <next> <block type="controls_if" id="EG3ol;@J!t^@8
umkneD">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_operation" id="K{W%]KSw7P4gp:O[UgD">
<field name="OP">OR</field>
<value name="A">
<block type="logic_compare" id="h^93g38,nk?n5B7-T|-2">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="{LHVnt1Z}O9p}y;p9yW)">
<field name="ATTR">val</field>
<field name="OID">sonoff.0.Licht.POWER</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="i]3e]XF.PqOq6jySU-7A">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="Q_d6K+s7Xy3z=yM8JKI"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="N:?5:-:R9O-Gf(9;Y4*4"> <field name="ATTR">val</field> <field name="OID">sonoff.0.Licht.POWER</field> </block> </value> <value name="B"> <block type="logic_boolean" id="[2d@d1(/KA:U_9qBxzt|"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="comment" id="5{]Wn0u@#w@rdTXb)SiY"> <field name="COMMENT">Wenn eine Lampe an dann alle aus</field> <next> <block type="debug" id="D1jJ!hg8?416.fo8A]Ig"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="EQV5T+^(Oc^%jddr?Ed/"> <field name="TEXT">ausschalten</field> </shadow> </value> <next> <block type="control" id="QyX=!8$VR$)D=UhC1sa1"> <mutation delay_input="false"></mutation> <field name="OID">sonoff.0.Licht.POWER</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="V2End:lo3Xwl#Gp^:9ne"> <field name="BOOL">FALSE</field> </block> </value> </block> </next> </block> </next> </block> </statement> <statement name="ELSE"> <block type="comment" id=":x2uA2sM^Tb!]7~%Y@3."> <field name="COMMENT">Objekt schalten, bitte anpassen</field> <next> <block type="control" id="79;%-wMLM(l4pnH}_Ug?"> <mutation delay_input="false"></mutation> <field name="OID">sonoff.0.Licht.POWER</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="OqQ-6Zdl=qm``H}c+r
1">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="comment" id="L?|+,b8)F9%Bpv]ZlSK/">
<field name="COMMENT">Sonst lampe an</field>
<next>
<block type="debug" id="[7.r]dibVzq:nExle;C"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="AjqibEkM(*A
Uc-I[Fh.">
<field name="TEXT">einschalten</field>
</shadow>
</value>
<next>
<block type="comment" id="khXz:g:a01UL0NVB(/0A">
<field name="COMMENT">Objekt schalten, bitte anpassen</field>
<next>
<block type="control" id="i4iv,I2$Lg=Y3
hXGM">
<mutation delay_input="false"></mutation>
<field name="OID">sonoff.0.Licht.POWER</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="$7ncThkUUTn~-05X$uEg">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
<value name="IF1">
<block type="logic_compare" id="{RB1T]6_|We%X^x8y,e3">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="]JqpodS[1k}8wvU%ljY"> <field name="ATTR">val</field> <field name="OID">zigbee.0.00158d0002b02f86.double_click</field> </block> </value> <value name="B"> <block type="logic_boolean" id="D({5v+n5fghCkGs68}ch"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO1"> <block type="debug" id="]OGemcpFY;b;lh4Z[aK/"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="fO(2D5-!_m|U:zj[5fsa"> <field name="TEXT">double click</field> </shadow> </value> <next> <block type="comment" id="B7Y#DekBTX23lCB-|,L]"> <field name="COMMENT">je nach click</field> </block> </next> </block> </statement> <value name="IF2"> <block type="logic_compare" id="Awyl1ugjhBcRcUAJOL+l"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="l4xIsUA
ecIpJqodgO-4">
<field name="ATTR">val</field>
<field name="OID">zigbee.0.00158d0002b02f86.triple_click</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="g]#YKK0GlZp2U(E|G|(">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO2">
<block type="debug" id="gr9O^S~?R+-0b:S-sb!L">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="1[hmvn+t^pr2j.fEi2rb">
<field name="TEXT">tripple click</field>
</shadow>
</value>
<next>
<block type="comment" id="0,;Y]y4[u[]+Bs1s=Epw">
<field name="COMMENT">je nach click</field>
</block>
</next>
</block>
</statement>
<value name="IF3">
<block type="logic_compare" id="5Ultno,QEkbPOIz4+x="> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="^,!TJk?QHXNhp0f24SIM"> <field name="ATTR">val</field> <field name="OID">zigbee.0.00158d0002b02f86.quad_click</field> </block> </value> <value name="B"> <block type="logic_boolean" id="^0tE{Uw^Aw9]{aM4v%#,"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO3"> <block type="debug" id="uM,~
ogj7YUW+_9GH@qK">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="vf-TRBU!EW^99MhKz-^D">
<field name="TEXT">vierfach click</field>
</shadow>
</value>
<next>
<block type="comment" id="b)rKt;
?q#O/WQ!S8W">
<field name="COMMENT">je nach click</field>
</block>
</next>
</block>
</statement>
<value name="IF4">
<block type="logic_compare" id="5P6jpTQ+SQg)Z-ZWuBCK">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="LPfGX2rys@=v3mC2^-73">
<field name="ATTR">val</field>
<field name="OID">zigbee.0.00158d0002b02f86.many_click</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="ris=X#TgK=1+0COq?uuC">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO4">
<block type="debug" id="Br~kIi5^8x!xr.94.PB:">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="ZrcdR6T{YcUD=]O;S+-"> <field name="TEXT">viele click</field> </shadow> </value> <next> <block type="comment" id="@d7VxOC1QmAoaKcahHk3"> <field name="COMMENT">je nach click</field> </block> </next> </block> </statement> <value name="IF5"> <block type="logic_compare" id="Gt2b(|.gt?d1z,%g%99I"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="4[
vb;-7^8ow]IE0ZF~[">
<field name="ATTR">val</field>
<field name="OID">zigbee.0.00158d0002b02f86.long_click</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="ay}{%b(r.^GlnijvJuN^">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO5">
<block type="debug" id="OU:gQT3@u=HQrMl8Hq+%">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="M(F:?:]%Jg?msY]k^F)n">
<field name="TEXT">lang click</field>
</shadow>
</value>
<next>
<block type="comment" id="8R^HYo2yE!:l@set:4i">
<field name="COMMENT">je nach click </field>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</xml> -
@iomountain Wie mache ich das denn eigentlich in so nem Kasten
?
-
@Noé1237
erst auf Spoiler drücken, dann auf Code, dann einfügenhab's mal ein wenig gekürzt und aufgeräumt
-
@iomountain achso okey, danke. Weißt du woran es liegt?
-
@Noé1237 sagte in Script Hilfe licht über Xiaomi Switch anschalten.:
Weißt du woran es liegt?
was?
funktioniert dein "simple click" -
@iomountain Ne ich frage ja ob du weißt wieso es nicht funktioniert. Aktuell passiert gar nichts wenn ich drücke.
-
so ist das Script gestoppt.
was sagt das Log?
Das was in den Debug Baustein steht müsste im LOG auftauchen.