NEWS
Verständnisfrage Blockly / Trigger <-> mehrere Bedingungen
-
Hallo @all
Bin gerade dabei mich etwas mit Blockly anzufreunden.
Prinzipiell ist es ja recht Anwenderfreundlich, man kann schnell und unkompliziert Automatismen erstellen.
Doch bei der folgenden Aufgabenstellung bin ich mir etwas unsicher, ob man das so umsetzt.
Ziel ist es, eine Lampe mittels drei Trigger, bzw. drei Bedingungen zu schalten.Muss ich dann zu jeder Bedingung einen Trigger in Blockly erstellen, oder geht das auch anders?
Etwas genauer.
Datenpunkte:
Trigger/Bedingungen
0_userdata.0.general.presence.MyPhone11Pro.presence
0_userdata.0.general.presence.iCal_4_Anwesenheit.timer
0_userdata.0.general.sensor.xi_sensor_light_01.isday
Lampe
hue.0.z_hallway_ceiling.on
hue.0.z_hallway_ceiling.scene_entspannen
Was ich bisher umgesetzt habe. (Die Abfrage, ob die Lampe ein oder ausgeschaltet ist, baue ich später noch mit ein)
Wenn iCal_4_Anwesenheit.timer auf true/false wechselt, soll in Abhängigkeit von xi_sensor_light_01.isday und MyPhone11Pro.presence die Lampe geschaltet werden.
Wenn xi_sensor_light_01.isday auf true/false wechselt, soll in Abhängigkeit von iCal_4_Anwesenheit.timer und MyPhone11Pro.presence die Lampe geschaltet werden.
Wenn MyPhone11Pro.presence auf true/false wechselt, soll in Abhängigkeit von iCal_4_Anwesenheit.timer und xi_sensor_light_01.isday die Lampe geschaltet werden.
Kompletter Code
<xml xmlns="https://developers.google.com/blockly/xml"> <block type="on" id="6Gx2G6W~oER|W2wF+4yG" x="313" y="88"> <field name="OID">mqtt.1.zigbee2mqtt.xi_switch_01.action</field> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="controls_if" id="TaZ~a:+mPDAS]%ApmQ4~"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_operation" id="F+-%-)P*z|2Hd(]pvPV^"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="B_dBpt]VkG-bFZvo^mj)"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="NNLTZTkG0V180QD0)YX]"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="text" id="n1nlW|AkJ9rP^J]CR^m$"> <field name="TEXT">single</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id=")?qVx{$`#6b}BL5-u-DN"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="./RXjkI+Lp|7nHFv5~@W"> <field name="ATTR">val</field> <field name="OID">hue.0.z_hallway_ceiling.on</field> </block> </value> <value name="B"> <block type="logic_boolean" id=",C[1Odz*+WDkb$Xs01BL"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="AR%-^;EhDHPNl{vjisV["> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.scene_entspannen</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="UjZc:~NR`x6vXya%t4G0"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> <value name="IF1"> <block type="logic_operation" id="Z%(x==SKFwTA-lVYbT1g"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="k|iY4[jqz8.cy4+[mlFP"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="5R$C#/|;;|(`Ol~Zhou]"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="text" id="-N5z9x_O`DJci)`,)E,W"> <field name="TEXT">single</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="xo1usY2|u0Y8nDAxSn60"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="U:H3`%p^`{|p$B#OA+zO"> <field name="ATTR">val</field> <field name="OID">hue.0.z_hallway_ceiling.on</field> </block> </value> <value name="B"> <block type="logic_boolean" id="1r[M!P6Y:m3-%{sF~b^n"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> <statement name="DO1"> <block type="control" id="s:fs%|AMI?Sx{tBg~%AU"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.on</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="?TSOYus2c10u4S-;n^y="> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> </block> </statement> <next> <block type="on" id="shYCT.Mh_7-k]qWQna]."> <field name="OID">mqtt.1.zigbee2mqtt.xi_switch_02.action</field> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="controls_if" id="b8A?FCryQ)%=K{5I_i|5"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_operation" id="}/gyoQD;Xi(ZAD:9Z30?"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="jRsCsJw)Wb+zNvP,ehCd"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="3,E(_XWD_7n6FomO$!~F"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="text" id=",d+@R,9qY+vfZ`0TV4XZ"> <field name="TEXT">single</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="%6F.F_7:=#7xIG5Ch_Nm"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="-A}-/C]%d:cwv|y#hZ?P"> <field name="ATTR">val</field> <field name="OID">hue.0.z_hallway_ceiling.on</field> </block> </value> <value name="B"> <block type="logic_boolean" id="%(cF|0q.@vrE/?n1h{5F"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="?6y^X4%jP*`bE.wO`A_Z"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.scene_entspannen</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="=ZLy[2W@#LR=giq%|i_W"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> <value name="IF1"> <block type="logic_operation" id=".B5pR=w-Vy:[TfuP,39F"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id=".=eiTd;rT]~S!mh~aZ#C"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="O7|/}m5)7p#_%_v$N9uW"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="text" id="94UL!fN|;.=!X/UmS3r="> <field name="TEXT">single</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="npe*y-vP/tj2.*}IWOaq"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id=".fS{9l*6gPC^}t=;Y_1U"> <field name="ATTR">val</field> <field name="OID">hue.0.z_hallway_ceiling.on</field> </block> </value> <value name="B"> <block type="logic_boolean" id="+m7;C}lmxeoQj(*Gha/6"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> <statement name="DO1"> <block type="control" id="HC9Jl)l*lLt0R*/6U=uL"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.on</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="Hvb._`?u}qhyx?pqmHoC"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> </block> </statement> <next> <block type="comment" id="?2`fm/*aM%)7^sJWttAX"> <field name="COMMENT">hue_dimmer_switch_01</field> <next> <block type="on" id="/tr{w[Q5nNph^03BFG.;"> <field name="OID">mqtt.1.zigbee2mqtt.hue_dimmer_switch_01.action</field> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="controls_if" id="bD1Ls+;F$N)~x0E!8%pn"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_operation" id="q1p?FCzRs?mP+fn)P|#9"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="5QUTUHa;Jr4BI[g}$=cp"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="PBN}S9J,+dIIwVX(=ZU,"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="text" id="g?2wdKwyvUUX%#tWljZ#"> <field name="TEXT">on_press_release</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="FR@.A}i?q=uzZGTav#[C"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="n+/YRfD85:5R[`31@F@Q"> <field name="ATTR">val</field> <field name="OID">hue.0.z_hallway_ceiling.on</field> </block> </value> <value name="B"> <block type="logic_boolean" id="MK1IOmE8$exhZ]J/A8Ka"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="4j%v98D7k40H]klnsNK="> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.scene_entspannen</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="5FkV6gQEn6a2:C!7h8DY"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> <value name="IF1"> <block type="logic_operation" id="|kx]e*}5rEKv5/kWFJKY"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="uU}.dKBfyX1|ly6nLr9^"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="C-}dv!Th@+JzH4]aqi[i"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="text" id="7*d)$:+`!HSQ4_wW1aW_"> <field name="TEXT">off_press_release</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="]9C6o$3QprH0AvbTTDG$"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="mz!bfr*v@.`1/by/p--r"> <field name="ATTR">val</field> <field name="OID">hue.0.z_hallway_ceiling.on</field> </block> </value> <value name="B"> <block type="logic_boolean" id=":MFH5v^o-!vj(BYoKg5$"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> <statement name="DO1"> <block type="control" id="dC89i_#:V@fIwQ-bSi:i"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.on</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="#5:+5#Q_Ju.=d~h7,TIx"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> </block> </statement> <next> <block type="comment" id="|W#|W9Kx3~Uws$Y5!`o-"> <field name="COMMENT">iCal_4_Anwesenheit.timer</field> <next> <block type="on" id="?]?.8Q:/7xJ299cf*6P*"> <field name="OID">0_userdata.0.general.presence.iCal_4_Anwesenheit.timer</field> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="comment" id="6ybo:d}aAhs@X.:}Qw*?"> <field name="COMMENT">xi_sensor_light_01.isday - false</field> <next> <block type="comment" id=":CD@R8u04P=]8T7QH#?w"> <field name="COMMENT">MyPhone11Pro.presence - true</field> <next> <block type="controls_if" id="74ONvKjG#g^t(6Q,?%Vz"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_operation" id="#-ywE|74[Mk]JL2SZZR|"> <field name="OP">AND</field> <value name="A"> <block type="on_source" id="62pQCCgsc6L*exvr?VM*"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="logic_operation" id="NbHR!`:cyQ6=H+CD4B5f" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="4@Yt$YM9?*#WCLty[@m("> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="3h?ChJJZ~C_!{j%w4G}Z"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.sensor.xi_sensor_light_01.isday</field> </block> </value> <value name="B"> <block type="logic_boolean" id="_vDSTn`VctJhcNdWbF4u"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id=":{CLp$%}N5~$0Eq|Mg]w"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="K#}t72~$1Z)r]IW7(Axn"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.MyPhone11Pro.presence</field> </block> </value> <value name="B"> <block type="logic_boolean" id="8.roj?sYokn2}nXc0:Ci"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="comment" id=":4C3(mP!ZYsgZ7NTZ*6O"> <field name="COMMENT">hue.0.z_hallway_ceiling.scene_entspannen - true</field> <next> <block type="control" id="+ug7^gwvlS:}Q1eV.h]^"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.scene_entspannen</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="Fhm7KQ+-.PGo`Sbgw!(2"> <field name="BOOL">TRUE</field> </block> </value> </block> </next> </block> </statement> <value name="IF1"> <block type="logic_negate" id="LvefMg;L0+{saFXB~)}/"> <value name="BOOL"> <block type="on_source" id="r93pz6CF^VbqIih_#k]l"> <field name="ATTR">state.val</field> </block> </value> </block> </value> <statement name="DO1"> <block type="comment" id="Q`KoP;!xq@V^5CwAT@8`"> <field name="COMMENT">hue.0.z_hallway_ceiling.on - false</field> <next> <block type="control" id="LJT|;M3QGf;uj9z/@[LX"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.on</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="Rw3MP$*ay;?|1*.4zVYj"> <field name="BOOL">FALSE</field> </block> </value> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="%wu`{V/ZhiCd.fbcV[*z"> <field name="COMMENT">xi_sensor_light_01.isday</field> <next> <block type="on" id="qq,!e)cO`J*gdxu@{2Bz"> <field name="OID">0_userdata.0.general.sensor.xi_sensor_light_01.isday</field> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="comment" id="xl9LGnZwt(ppT28Hw-{L"> <field name="COMMENT">iCal_4_Anwesenheit.timer - true</field> <next> <block type="comment" id="(vn{~ZgIT!tcAq70B~10"> <field name="COMMENT">MyPhone11Pro.presence - true</field> <next> <block type="controls_if" id="2/=Ag}M%4.e=Q42:{}{E"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_operation" id="-@.4N/awl.3nOp;J%lns"> <field name="OP">AND</field> <value name="A"> <block type="logic_negate" id="#UBJy%EE`kV^mlQDH)va"> <value name="BOOL"> <block type="on_source" id="ZkUurj1;aO]b2OfQ$4R="> <field name="ATTR">state.val</field> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="EX|!i~h{uOkDxOk}G$tP" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="UmaBo5hgP.w|28$UEX]0"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="VU=+kBk03=,,y%k_88jW"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.iCal_4_Anwesenheit.timer</field> </block> </value> <value name="B"> <block type="logic_boolean" id="JbEayaP9:z;9KCrJB:UU"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="(SUFOiG)E)zW+Z*_4U4L"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="O$bKW.3RsqSk}(kuTcci"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.MyPhone11Pro.presence</field> </block> </value> <value name="B"> <block type="logic_boolean" id="]E$(^rb#tcLm?R(-p|!z"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="comment" id=",);M94A,Jf00KLZ`W#T^"> <field name="COMMENT">hue.0.z_hallway_ceiling.scene_entspannen - true</field> <next> <block type="control" id=")I,9P?!E!RO^cbno|!7U"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.scene_entspannen</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="!s(|beogfTZuuXJZTriJ"> <field name="BOOL">TRUE</field> </block> </value> </block> </next> </block> </statement> <value name="IF1"> <block type="on_source" id="x_f`WZMy]a.8i$Pm|qns"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO1"> <block type="comment" id="cfqi*fMOL6zT;#CE|nuN"> <field name="COMMENT">hue.0.z_hallway_ceiling.on - false</field> <next> <block type="control" id="6Gh+GtbS[W62?87tJ^AJ"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.on</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="|]bpuWnxp}C:3VQ8Xci6"> <field name="BOOL">FALSE</field> </block> </value> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="@Xm_i4XICH_nmj@R/48G"> <field name="COMMENT">MyPhone11Pro.presence</field> <next> <block type="on" id="f2d/?P=4gSGDM`e8e2H:"> <field name="OID">0_userdata.0.general.presence.MyPhone11Pro.presence</field> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="comment" id="Z@b]ND7B8n_9WMvc7cXa"> <field name="COMMENT">iCal_4_Anwesenheit.timer - true</field> <next> <block type="comment" id="q!u8$P.M%cPKrrS#I(=2"> <field name="COMMENT">xi_sensor_light_01.isday - false</field> <next> <block type="controls_if" id="o%NEYhfR.OUIi:rm,HnF"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_operation" id="ea]E`/xy;}5NtiWv{ox)"> <field name="OP">AND</field> <value name="A"> <block type="on_source" id="^z-[PdKp4pqZjd2XO-Bj"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="logic_operation" id="7J;mk:s@u1~n,fKBn4KQ" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="m0jx~p=i3KD^E|:UZ.vY"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="2zp2ESNQFs]y6s:^W!Kf"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.iCal_4_Anwesenheit.timer</field> </block> </value> <value name="B"> <block type="logic_boolean" id="QCe2Pb4tBAoXa`$+!F90"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="F5/x/w^OMFvLOTQcozjk"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="2RUw_5O=]*`_f*_;G*cG"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.sensor.xi_sensor_light_01.isday</field> </block> </value> <value name="B"> <block type="logic_boolean" id="v@daY?1`l{mo9j5w,BpI"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="comment" id="{bOw4(Uxv`W.+LwkS:ZH"> <field name="COMMENT">hue.0.z_hallway_ceiling.scene_entspannen - true</field> <next> <block type="control" id="dGArAczn5t7Akifm$%I#"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.scene_entspannen</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="{IXws~W_QJKHyn02^h}]"> <field name="BOOL">TRUE</field> </block> </value> </block> </next> </block> </statement> <value name="IF1"> <block type="logic_negate" id="ZW11dUIiJ/;B/p~o+=~l"> <value name="BOOL"> <block type="on_source" id="(=V3.vq]6Ec-:TC4$cq~"> <field name="ATTR">state.val</field> </block> </value> </block> </value> <statement name="DO1"> <block type="comment" id="Eu3nnc6`@;g+5s_Vqv?K"> <field name="COMMENT">hue.0.z_hallway_ceiling.on - false</field> <next> <block type="control" id="1nmkuYyJD#1hN!7RxO._"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.on</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="!|YW4h;D,]z`(gFhLdQr"> <field name="BOOL">FALSE</field> </block> </value> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </xml>
Für eine freundliche Unterstützung bedanke ich mich schon einmal vorab.
Gruß, Karsten
"hosts": "version": "3.3.18", "platform": "Javascript/Node.js", "type": "linux" "node": "v14.18.1", "npm": "v6.14.15" "arch": "x64", "adapters": "admin": "v5.1.25", "javascript": "v5.2.8"
-
du kannst den andere Trigger Block nehmen, dort auf das Zahnrad, dann kannst dir mehrere darein ziehen. Das sind allerdings nicht alles Bedingungen, sondern einer der Datenpunkte löst den Trigger aus, egal welcher sich verändert.
Als bedingungen musst du dann anschließend Falls benutzten wie du es ja schon in deinem Skript hast.
Du kannst aus dem "und" block auch "oder" machen ... und nimm dann nicht mehr den "wert" block.
-
Dankeschön für die schnelle Rückmeldung.
Werde ich mir mal in Ruhe ansehen, ob es damit einfacher umzusetzen ist.
(Hab da noch weitere Geräte, die ich ähnlich ansteuern möchte)Gruß, Karsten
-
Dein Skript ist ganz schön gewaltig, hab eben mal rein geschaut, das müsste man vielleicht parallel mal nen ganz neues Puzzle´n ... bevor du das funktionierende ganz zerpflückst.
-
Sind eigentlich nur noch drei Schalter davor.
@cinimod sagte in Verständnisfrage Blockly / Trigger <-> mehrere Bedingungen:
... müsste man vielleicht parallel mal nen ganz neues Puzzle´n ...
Meinst du damit, das die Schalter dann auch noch mit in den "Trigger mit Objekt ID Liste" integriert werden sollten?
Wird es dann nicht etwas unübersichtlich?
Schau mir das nachher mal an, wie ich das umsetzen kann.Gruß, Karsten
-
Ich meinte nur bevor du deins was ja mehr oder weniger funktionert, zerlegst, lieber ein zweites aufbauen und dieses nacher weg donnern wenn das neue gut funktioniert.
-
@cinimod
in etwas so?
<xml xmlns="https://developers.google.com/blockly/xml"> <block type="on_ext" id="*|#mcW[?)%S%x[SlEG,a" x="313" y="1138"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="3"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="q,D5hL!um?3EjegVTtJ7"> <field name="oid">0_userdata.0.general.presence.iCal_4_Anwesenheit.timer</field> </shadow> </value> <value name="OID1"> <shadow type="field_oid" id="n}#i8blXZhTv{yU:W?b8"> <field name="oid">0_userdata.0.general.sensor.xi_sensor_light_01.isday</field> </shadow> </value> <value name="OID2"> <shadow type="field_oid" id="mZ[TOtA:Sgg8iI|)5g~?"> <field name="oid">0_userdata.0.general.presence.MyPhone11Pro.presence</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="/L+oZ{ge73[67}1YgoU5"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_operation" id="EAw{Rq(2V_Iag7f?eP5b" inline="false"> <field name="OP">OR</field> <value name="A"> <block type="logic_operation" id="cqy(sqhVhWFV]9mG2,Gf" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="=o^/)A,8ICg$o3@+_$sW" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="u4NXX(yeVKWh#=qbngmW"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.iCal_4_Anwesenheit.timer</field> </block> </value> <value name="B"> <block type="logic_boolean" id="sFVgj5:r.cel1i3;@_P{"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="NbHR!`:cyQ6=H+CD4B5f" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="4@Yt$YM9?*#WCLty[@m(" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="3h?ChJJZ~C_!{j%w4G}Z"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.sensor.xi_sensor_light_01.isday</field> </block> </value> <value name="B"> <block type="logic_boolean" id="_vDSTn`VctJhcNdWbF4u"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id=":{CLp$%}N5~$0Eq|Mg]w" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="K#}t72~$1Z)r]IW7(Axn"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.MyPhone11Pro.presence</field> </block> </value> <value name="B"> <block type="logic_boolean" id="8.roj?sYokn2}nXc0:Ci"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="ml0ADE^d*(Ai2#-u}imi" inline="false"> <field name="OP">OR</field> <value name="A"> <block type="logic_operation" id="q|]NT7$1tn-#}uG{FNV|" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="9#+a!9JOClE5ah*s]-GC" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="-fs,W0hd|W![YEO.v}$w"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.sensor.xi_sensor_light_01.isday</field> </block> </value> <value name="B"> <block type="logic_boolean" id="E-pquXJ`Y{?AFtThKyFw"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="oHGPY9R`6^?`9.?~Ws)0" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id=",{nO|f_hNiBZ8}qk};UO" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="J(/b-/Ixu-d)?|_ebq;N"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.iCal_4_Anwesenheit.timer</field> </block> </value> <value name="B"> <block type="logic_boolean" id="iIXc@=pa8M|9QHk9dt+8"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="rCEv;(*w*fohm$Vc^_Z8" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="p:CcW]25i}fufEXNFjNM"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.MyPhone11Pro.presence</field> </block> </value> <value name="B"> <block type="logic_boolean" id="c}AOvg?qhXQlEm7a,?39"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="N3ZRcSj)CVt^-zH`,L+w" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="5m@Rc5%Y;MsjVG+|4d~}" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="D=)m6[9P7;%I6U$[%nu/"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.MyPhone11Pro.presence</field> </block> </value> <value name="B"> <block type="logic_boolean" id="8B.@}A?,v?tk}F,[imH("> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="8D,]llSFHJN3CBF0@#,^" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="yB|r|[{/UO+T*$fD4:Ks" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="xzRxn#~X57ziEMYc;;kV"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.iCal_4_Anwesenheit.timer</field> </block> </value> <value name="B"> <block type="logic_boolean" id="Zf[t^lZ`/+36{e2s;q17"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="lM%N0swHcj=-f,of5H;~" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="_6A:W~t@+^=ENQXZ5S|O"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.sensor.xi_sensor_light_01.isday</field> </block> </value> <value name="B"> <block type="logic_boolean" id="YjyD9Q*(aDrD1tx7UWG]"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id=")I,9P?!E!RO^cbno|!7U"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.scene_entspannen</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="!s(|beogfTZuuXJZTriJ"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> <statement name="ELSE"> <block type="control" id="7(5]MTf=grqx8#P!tRv`"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.on</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="Gb:jwNvxB]W`?LZkR#qK"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> </block> </statement> </block> </xml>
EDIT: Wenn etwas funktioniert (ganz oder teilweise), und ich möchte Veränderungen anbringen, wird ein Backup gemacht.
Gebranntes Kind...usw -
Ja etwa so, die Prüfung auf wahr kannst du dir allerdings sparen.
Und du kannst auch „sonst falls“ nutzen, anstatt „oder“ Ist etwas unübersichtlich jetzt …
Die Schalter in einem Trigger… weiß auch nicht so recht ob das sinn macht … ggf. schon, weil du immer das selbe Ergebnis haben willst… „aber“ einmal auf „geändert“ und zwei mal auf „aktualisiert“ getriggert wird… wenn das mit dem dritten auch geht auf „aktualisiert “ würd ich‘s vielleicht machen
-
-
Jetzt habe ich mal "sonst falls" mit eingebaut.
<xml xmlns="https://developers.google.com/blockly/xml"> <block type="on_ext" id="*|#mcW[?)%S%x[SlEG,a" x="331" y="1196"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="3"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="q,D5hL!um?3EjegVTtJ7"> <field name="oid">0_userdata.0.general.presence.iCal_4_Anwesenheit.timer</field> </shadow> </value> <value name="OID1"> <shadow type="field_oid" id="n}#i8blXZhTv{yU:W?b8"> <field name="oid">0_userdata.0.general.sensor.xi_sensor_light_01.isday</field> </shadow> </value> <value name="OID2"> <shadow type="field_oid" id="mZ[TOtA:Sgg8iI|)5g~?"> <field name="oid">0_userdata.0.general.presence.MyPhone11Pro.presence</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="/L+oZ{ge73[67}1YgoU5"> <mutation elseif="2" else="1"></mutation> <value name="IF0"> <block type="logic_operation" id="cqy(sqhVhWFV]9mG2,Gf" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="get_value" id="u4NXX(yeVKWh#=qbngmW"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.iCal_4_Anwesenheit.timer</field> </block> </value> <value name="B"> <block type="logic_operation" id="NbHR!`:cyQ6=H+CD4B5f" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="4@Yt$YM9?*#WCLty[@m(" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="3h?ChJJZ~C_!{j%w4G}Z"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.sensor.xi_sensor_light_01.isday</field> </block> </value> <value name="B"> <block type="logic_boolean" id="_vDSTn`VctJhcNdWbF4u"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id=":{CLp$%}N5~$0Eq|Mg]w" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="K#}t72~$1Z)r]IW7(Axn"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.MyPhone11Pro.presence</field> </block> </value> <value name="B"> <block type="logic_boolean" id="8.roj?sYokn2}nXc0:Ci"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id=")I,9P?!E!RO^cbno|!7U"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.scene_entspannen</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="!s(|beogfTZuuXJZTriJ"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> <value name="IF1"> <block type="logic_operation" id="q|]NT7$1tn-#}uG{FNV|" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_negate" id="SZOUWGY(:S.x3g{{i}V2"> <value name="BOOL"> <block type="get_value" id="-fs,W0hd|W![YEO.v}$w"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.sensor.xi_sensor_light_01.isday</field> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="oHGPY9R`6^?`9.?~Ws)0" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id=",{nO|f_hNiBZ8}qk};UO" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="J(/b-/Ixu-d)?|_ebq;N"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.iCal_4_Anwesenheit.timer</field> </block> </value> <value name="B"> <block type="logic_boolean" id="iIXc@=pa8M|9QHk9dt+8"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="rCEv;(*w*fohm$Vc^_Z8" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="p:CcW]25i}fufEXNFjNM"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.MyPhone11Pro.presence</field> </block> </value> <value name="B"> <block type="logic_boolean" id="c}AOvg?qhXQlEm7a,?39"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO1"> <block type="control" id="H)84y#{rFxa6#SJA_UMU"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.scene_entspannen</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="5f$jiJ5qq!QTyXA(OZh4"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> <value name="IF2"> <block type="logic_operation" id="N3ZRcSj)CVt^-zH`,L+w" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="get_value" id="D=)m6[9P7;%I6U$[%nu/"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.MyPhone11Pro.presence</field> </block> </value> <value name="B"> <block type="logic_operation" id="8D,]llSFHJN3CBF0@#,^" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="yB|r|[{/UO+T*$fD4:Ks" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="xzRxn#~X57ziEMYc;;kV"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.presence.iCal_4_Anwesenheit.timer</field> </block> </value> <value name="B"> <block type="logic_boolean" id="Zf[t^lZ`/+36{e2s;q17"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="lM%N0swHcj=-f,of5H;~" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="_6A:W~t@+^=ENQXZ5S|O"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.general.sensor.xi_sensor_light_01.isday</field> </block> </value> <value name="B"> <block type="logic_boolean" id="YjyD9Q*(aDrD1tx7UWG]"> <field name="BOOL">FALSE</field> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO2"> <block type="control" id="/3}i6JCVJwlWd$:sYI]2"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.scene_entspannen</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="4f=iYE@lLAnTDhN9J9sd"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> <statement name="ELSE"> <block type="control" id="7(5]MTf=grqx8#P!tRv`"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hue.0.z_hallway_ceiling.on</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="Gb:jwNvxB]W`?LZkR#qK"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> </block> </statement> </block> </xml>
Bei den Schaltern von Xiaomi musste ich "aktualisiere" nehmen, das sie bei einmaligem betätigen eben nur einen Wert übermitteln. Ansonsten hätte ich noch "double" mit hinzunehmen müssen, und das wollte ich nicht.
-
-
Guten Morgen,
auch dir ein Dankeschön für deinen Hinweis
Mit Variablen kann man das auch noch etwas aufhübschen.
Werde ich mal mit einbauen.Gruß, Karsten
-
-
Vom Prinzip her sogar dreimal.
Ich dachte das ich auf jede Bedingung reagieren muss. Denkfehler
Edit: Du warst schneller
Edit die Zweite:
Das ist noch der Struktur von drei verschiedenen Triggern geschuldet.Bau ich gleich mal um
-
Nein musst du nicht. Nur bei welcher du eine Aktion haben möchtest.
EDIT: Ah verstehe... hast jetzt alles dreifach weil die Trigger zusammen gelegt hast.
Die Variablen machen dann natürlich auch nicht viel Sinn, wenn du sie nicht mehrfach benutzt in dem Skript.
-
@cinimod
Bei allen drei Bedingungen soll auch getriggert werden.Wenn isDay sich ändert, dann soll auch die Lampe geschaltet werden.
Unter der Vorraussetzung das die anderen beiden Bedingungen übereinstimmen.
Und genauso soll es sich bei den beiden anderen Bedingungen auch verhalten.
Also, wenn iCal sich ändert, usw. -
@cinimod sagte in Verständnisfrage Blockly / Trigger <-> mehrere Bedingungen:
EDIT: Ah verstehe... hast jetzt alles dreifach weil die Trigger zusammen gelegt hast.
-
Alle drei Objekte im Trigger lösen den Trigger aus wenn sie sich verändern.
Dann müssen natürlich noch alle drei Bedingungen erfüllt sein zum EINSCHALTEN.
Sollte einer dieser Bedingung nicht erfüllt sein schaltet er aus, nach aktuellem Stand.Du kannst natürlich für das ausschalten auch Bedingungen definieren, dann musst du einen "sonst falls" einbauen, statt dem "sonst"
-
Das ist genau das was ich wollte
Man lernt halt nie aus.
Auf dieser Grundlage kann ich wieder etwas weiter basteln.
Vielen Dank für deine Geduld, und noch einen angenehmen TagGruß, Karsten
-
@hydrotec Immer gern, wünsche ich dir auch.