NEWS
Dachfenster - Automatisierung, wie triggern?
-
Hallo zusammen, ich brauche mal euer geballtes Wissen, denn ich wage mich zum ersten mal an ein etwas komplexeres Projekt.
Und zwar soll im Sommer (wenn es denn mal einer wird) das Dachfenster in unserem Schlafzimmer automatisch lüften, sobald draußen die Temperatur etwas kühler wird als im inneren. Dafür habe ich ein Blockly zusammengeklickt, welches auf Temperaturveränderung triggert (s.u.). Leider kann ich momentan nicht auf die Testmethode zurückgreifen, da sich ja die Temperatur z.Z. nicht großartig ändert.
Für die Programmierer hier nochmal der Code, vielleicht ist es für sie besser nachzuvollziehen:
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</variable> <variable id="*_-GmR@MCKPKv:J@BmX9">Außentemperatur</variable> <variable type="interval" id="Intervall">Intervall</variable> <variable type="interval" id="Intervall2">Intervall2</variable> </variables> <block type="on_ext" id="nCFf$5D~RW7-Ymg+*/U8" x="255" y="-517"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id=",,EX.PPu/%+]#l-y!i3_"> <field name="oid">netatmo.0.Lohgrund-(Indoor).Indoor.Temperature.Temperature</field> </shadow> </value> <value name="OID1"> <shadow type="field_oid" id="pC9Rt(X=ab]p5B{kJXk{"> <field name="oid">weatherunderground.0.forecast.current.temp</field> </shadow> </value> <statement name="STATEMENT"> <block type="variables_set" id="I@*Ccdo_WIBN!jh;sdxL"> <field name="VAR" id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</field> <value name="VALUE"> <block type="get_value" id="hvv_Nn9@#z?)G?%pmpl)"> <field name="ATTR">val</field> <field name="OID">netatmo.0.Lohgrund-(Indoor).Indoor.Temperature.Temperature</field> </block> </value> <next> <block type="variables_set" id="A:R?pMh{[(e!|=V~db@F"> <field name="VAR" id="*_-GmR@MCKPKv:J@BmX9">Außentemperatur</field> <value name="VALUE"> <block type="get_value" id="{=*xq:dTi)iovx:FL7:N"> <field name="ATTR">val</field> <field name="OID">weatherunderground.0.forecast.current.temp</field> </block> </value> </block> </next> </block> </statement> <next> <block type="controls_if" id="rkMDuk]ov53B**7{D=rT"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_operation" id=")5wBgQGT8.%kNI~A$7a$" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="time_compare" id="KP)RRP)pRVLf:P]G1{fK"> <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true"></mutation> <field name="OPTION">between</field> <field name="START_TIME">19:00</field> <field name="END_TIME">23:00</field> </block> </value> <value name="B"> <block type="logic_compare" id="}BbpaKun0@:1J2,tkjg="> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="4Vv@+9-y3L;0r,PRuczE"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Schlafzimmersteuerung.Automatisierung_Dachfenster</field> </block> </value> <value name="B"> <block type="logic_boolean" id=")m4kmR9Qn;-RR@W,6~sW"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_setinterval" id="NRXy/YvZe1tizX9u*B(j"> <field name="NAME">Intervall</field> <field name="INTERVAL">10</field> <field name="UNIT">min</field> <statement name="STATEMENT"> <block type="controls_if" id="=8]uN+vX+D2QDw8s{hV)"> <mutation elseif="1" else="1"></mutation> <value name="IF0"> <block type="logic_operation" id="9MKBOjnE3U$hBBy~q^NH" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="%]YtubWyjW#Y.7~MQf`V"> <field name="OP">LTE</field> <value name="A"> <block type="variables_get" id="z9Gl*js:giKNRSiU@Pn0"> <field name="VAR" id="*_-GmR@MCKPKv:J@BmX9">Außentemperatur</field> </block> </value> <value name="B"> <block type="variables_get" id="vc$QvfW~T0=TGz2c*uY3"> <field name="VAR" id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="+sM6;77(yB)5jE)dqi^k"> <field name="OP">GT</field> <value name="A"> <block type="get_value" id="5y43TxyG3Mr0;$}2$)5;"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.value.temperature</field> </block> </value> <value name="B"> <block type="math_number" id="ES`T+)~B:Tp_b}gG5)++"> <field name="NUM">10</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="controls_if" id="bLk+=,kgiZP^PmtZ?Uv#"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_operation" id="~ZSJl3MTu@v)2|fdMJ*E" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="t;T~=x$Uu9A{|ma^tnap"> <field name="OP">GT</field> <value name="A"> <block type="variables_get" id="KWjz+S*z2hZ4WB-BADW%"> <field name="VAR" id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</field> </block> </value> <value name="B"> <block type="math_number" id="N#=={sp:`]vJSHz$@D@H"> <field name="NUM">20</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id=",nSG@.t}P!6y*HTP*6tA"> <field name="OP">LT</field> <value name="A"> <block type="get_value" id=":pO5YL,l;h|*p3G2PL?C"> <field name="ATTR">val</field> <field name="OID">weatherunderground.0.forecast.current.relativeHumidity</field> </block> </value> <value name="B"> <block type="math_number" id="!NXEa@,k0b94(yX:(I2P"> <field name="NUM">90</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="?Ckn7e{ixd7THa_,n}H+"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hm-rpc.1.OEQ0888649.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="`ULK(Ue@.S{aq?OIH`]+"> <field name="NUM">100</field> </block> </value> </block> </statement> <value name="IF1"> <block type="logic_operation" id="XO^A1F^m.=B6pf=#4~V4" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="lN]b9*aqcJdXfy2+N?ji"> <field name="OP">LTE</field> <value name="A"> <block type="variables_get" id="@vjCJcgkKJT_tkPy8V@."> <field name="VAR" id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</field> </block> </value> <value name="B"> <block type="math_number" id="fi@QYSTh#z@1@#jj3%Oc"> <field name="NUM">20</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="ap5b+V70z6FqcK{H%;)O"> <field name="OP">LT</field> <value name="A"> <block type="get_value" id="V8:~$3hi~`8;/BTPcEY0"> <field name="ATTR">val</field> <field name="OID">weatherunderground.0.forecast.current.relativeHumidity</field> </block> </value> <value name="B"> <block type="math_number" id="1c5[?])O$K_wZoipHJoa"> <field name="NUM">90</field> </block> </value> </block> </value> </block> </value> <statement name="DO1"> <block type="control" id="Kmy-8.QVyhzXp(9Ko-No"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hm-rpc.1.OEQ0888649.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="~MZ:A3Pc+8F5G=~TF4:a"> <field name="NUM">48</field> </block> </value> </block> </statement> </block> </statement> <value name="IF1"> <block type="logic_operation" id="]F/D.#]kb/nFtNhTa7Xi" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="ldSJpVj?YI{KC|G^}h}:"> <field name="OP">GT</field> <value name="A"> <block type="variables_get" id="wZ~i:ybv[y2}|p=e`u/,"> <field name="VAR" id="*_-GmR@MCKPKv:J@BmX9">Außentemperatur</field> </block> </value> <value name="B"> <block type="variables_get" id="3C9;K}E@4)6hVVD=*6$K"> <field name="VAR" id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="~u[+-V}_/7;wg{#/YH%Y"> <field name="OP">GT</field> <value name="A"> <block type="get_value" id="~:)(dz8e07+:DRN@|bT;"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.value.temperature</field> </block> </value> <value name="B"> <block type="math_number" id=".l.umYcjAG[|a`1TK,?="> <field name="NUM">10</field> </block> </value> </block> </value> </block> </value> <statement name="DO1"> <block type="control" id="wQky+wM^bF/bIyhxi|w|"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hm-rpc.1.OEQ0888649.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id=".mp-/S_c27}nq={.qf0P"> <field name="NUM">0</field> </block> </value> </block> </statement> <statement name="ELSE"> <block type="control" id="GqCCc;C#Frm@@y/*sCnr"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hm-rpc.1.OEQ0888649.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="F=_cZArg`8x!BpU?s}}z"> <field name="NUM">0</field> </block> </value> </block> </statement> </block> </statement> </block> </statement> <value name="IF1"> <block type="logic_operation" id=",0hNr{(Uk%Uw,`}~~}G|" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="time_compare" id="v3/]k@0XNu%9tY,Cu;A8"> <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true"></mutation> <field name="OPTION">between</field> <field name="START_TIME">7:00</field> <field name="END_TIME">19:00</field> </block> </value> <value name="B"> <block type="logic_compare" id="SlK@5zD|K{ILAS}waMF+"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="f!rAbc`@zXzn`K)TVuMy"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.Schlafzimmersteuerung.Automatisierung_Dachfenster</field> </block> </value> <value name="B"> <block type="logic_boolean" id="S)@g+!_0pF9f];N%uS^]"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> </block> </value> <statement name="DO1"> <block type="timeouts_setinterval" id="VL=Pv51!Q_hc8{(gv{:7"> <field name="NAME">Intervall2</field> <field name="INTERVAL">10</field> <field name="UNIT">min</field> <statement name="STATEMENT"> <block type="controls_if" id="_W#h|:v[KZc8Q|@yj}O~"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_operation" id="%QKJ[#O^k8~BtKEn[mWS" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="jmB,PpgD%],4MgR0,OqC"> <field name="OP">LTE</field> <value name="A"> <block type="variables_get" id="GVcHB9vf~0|u3D$)gN0%"> <field name="VAR" id="*_-GmR@MCKPKv:J@BmX9">Außentemperatur</field> </block> </value> <value name="B"> <block type="variables_get" id="JjT4yrP;qJ=0BbGoEmye"> <field name="VAR" id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="El.j|;FMCNKU]$Na)2Fi"> <field name="OP">GT</field> <value name="A"> <block type="get_value" id="r78WNTqWeUzX4=#KY[cf"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.value.temperature</field> </block> </value> <value name="B"> <block type="math_number" id="#EF.L]294,^ru3cF3:z,"> <field name="NUM">10</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="controls_if" id="ASp-hyK,lRg~)IoB)B[{"> <mutation elseif="2"></mutation> <value name="IF0"> <block type="logic_operation" id="@!d.S7Dx}jM0.gAF8H)|" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_operation" id="Xv-;SC~eC2L7|~r#K.86"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="rjmZatx%YrPO7[T~yl8G"> <field name="OP">GT</field> <value name="A"> <block type="variables_get" id=".asb:CMRE!t|9VeXd/Nf"> <field name="VAR" id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</field> </block> </value> <value name="B"> <block type="math_number" id="W70YuY1%zs*!s(mC(6Yz"> <field name="NUM">20</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="mQF%PCvyz;BdTlRVnlLL"> <field name="OP">LT</field> <value name="A"> <block type="get_value" id=":/U!fmy:A{/c(rzF8Pox"> <field name="ATTR">val</field> <field name="OID">weatherunderground.0.forecast.current.relativeHumidity</field> </block> </value> <value name="B"> <block type="math_number" id="E83=#A3gjFBb,OD/n1%K"> <field name="NUM">90</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="hm,Pd/kd{R[ayjtft{#_"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="5?j?bAK7Sz.!eZlO$,9a"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.value.wetterbedingung_sonne_wind</field> </block> </value> <value name="B"> <block type="math_number" id="B*(1%TO:Ad7+#j/N3$a#"> <field name="NUM">3</field> </block> </value> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="K;T;6[rogBRgL4L;08(r"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hm-rpc.1.OEQ0888649.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="m_h0_K;%U)$+/M5pfJ9D"> <field name="NUM">100</field> </block> </value> </block> </statement> <value name="IF1"> <block type="logic_operation" id="W)|CgY2h.5s18E-Es]4S" inline="false"> <field name="OP">OR</field> <value name="A"> <block type="logic_operation" id="QR)as%-.8uN0+W~kB*0," inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_operation" id="~;VAK@uj/C#+0rs=Qz@/"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="aD5S@2:JwEE!~%u)X`:l"> <field name="OP">LTE</field> <value name="A"> <block type="variables_get" id="`%eD|d@b{;X/KgWqH`(-"> <field name="VAR" id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</field> </block> </value> <value name="B"> <block type="math_number" id="tttO!jV%**XZ^qdg3cY4"> <field name="NUM">20</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="nMz?_{68_w@jlH-5yTE-"> <field name="OP">LT</field> <value name="A"> <block type="get_value" id="Q}T)g,:=4))|7y5ddOek"> <field name="ATTR">val</field> <field name="OID">weatherunderground.0.forecast.current.relativeHumidity</field> </block> </value> <value name="B"> <block type="math_number" id="/|Iy+t-9qfjO,|s1P|o("> <field name="NUM">90</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="aVa)KWA1-5#0D_;:K:5]"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="4Sio%/7P$~~P2o5FbPpO"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.value.wetterbedingung_sonne_wind</field> </block> </value> <value name="B"> <block type="math_number" id="oQX$4wt%P?Jje9kyH5B%"> <field name="NUM">3</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="qa!S_Pqdtr6,;@5:OLl)" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_operation" id="_Z=q`f17igN=2AG#{@EF"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="{d2:V~+/5L7Q!Z7hRRzp"> <field name="OP">GT</field> <value name="A"> <block type="variables_get" id=":[RWlz+?y:FLS3bhf!fZ"> <field name="VAR" id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</field> </block> </value> <value name="B"> <block type="math_number" id="C#XZyTJ54?K4?U;y8Lv^"> <field name="NUM">20</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="rInwWw6_-gDF@J2)ukSm"> <field name="OP">LT</field> <value name="A"> <block type="get_value" id="E[AFC3Cde)|3lS}hvH?i"> <field name="ATTR">val</field> <field name="OID">weatherunderground.0.forecast.current.relativeHumidity</field> </block> </value> <value name="B"> <block type="math_number" id="F~^O@_2Yw*EP(1ooCALD"> <field name="NUM">90</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="U8S~ZnIgu7VI8$l[qYtP"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="R)Ssnor+36Om,!bHm)fi"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.value.wetterbedingung_sonne_wind</field> </block> </value> <value name="B"> <block type="math_number" id="2CQtMFEjhkRx9IH%W^]_"> <field name="NUM">2</field> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO1"> <block type="control" id="X48XALmjJF=R9~at[b-e"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hm-rpc.1.OEQ0888649.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="@`+l$-E~?Vj=3WWut!A-"> <field name="NUM">48</field> </block> </value> </block> </statement> <value name="IF2"> <block type="logic_operation" id=",^Da9FMWJ=3x|:O=Qh{^" inline="false"> <field name="OP">OR</field> <value name="A"> <block type="logic_operation" id="cy!-6Xdgy~y(x9E;!ol}" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_operation" id="DMAEwqX{F.O9LM?I4R`e"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="BtSy?Iw@REOzEx6D;`2$"> <field name="OP">LTE</field> <value name="A"> <block type="variables_get" id="vgYrGOGgJ_=@l;ZU%p(("> <field name="VAR" id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</field> </block> </value> <value name="B"> <block type="math_number" id="[zXNik$.V*![uv(5/42T"> <field name="NUM">20</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="v{f!|y7qWT84!TM8!~8="> <field name="OP">LT</field> <value name="A"> <block type="get_value" id=";`591SfT#W^_un#MFyl."> <field name="ATTR">val</field> <field name="OID">weatherunderground.0.forecast.current.relativeHumidity</field> </block> </value> <value name="B"> <block type="math_number" id="aby)pSo;6CXV^::slSSp"> <field name="NUM">90</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id=":cB9;ZdL-8kUDe|e5p/Z" inline="false"> <field name="OP">OR</field> <value name="A"> <block type="logic_compare" id="AvXKJS7,3}(I)`W/Pf=U"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="ribkb)$.Ap6)Q(5gIF{-"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.value.wetterbedingung_sonne_wind</field> </block> </value> <value name="B"> <block type="math_number" id="#%zRxl@+SS,KghLDOV2b"> <field name="NUM">2</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="5HDMS1d9|pH*Y8E*Yhb["> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="Qj?8eWxwL!6|*P;phS|I"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.value.wetterbedingung_sonne_wind</field> </block> </value> <value name="B"> <block type="math_number" id="?;;pDXAdy7+OLajdu!q}"> <field name="NUM">3</field> </block> </value> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_operation" id="5@MFP=rgfT32~5ajmFC`" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_operation" id="s{x3%)L`H~M5j}[ceP(0"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="2-*X+pq`]`C;qarz09Sz"> <field name="OP">GT</field> <value name="A"> <block type="variables_get" id="F-!~N^-x],HhJDiMp5LZ"> <field name="VAR" id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</field> </block> </value> <value name="B"> <block type="math_number" id="M`|1cHJT{3bWOABk2|(G"> <field name="NUM">20</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="G9v!]n+G|7GCC?~GoP4b"> <field name="OP">LT</field> <value name="A"> <block type="get_value" id="XS:/6;iZIHS[Xvc;.tOq"> <field name="ATTR">val</field> <field name="OID">weatherunderground.0.forecast.current.relativeHumidity</field> </block> </value> <value name="B"> <block type="math_number" id="5L:s,az,nk0ZXVOb6fr*"> <field name="NUM">90</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="z|VsmE|NJ?-Ss!9cF}a,"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="~9i4-,8^3@jxm6#o=$yV"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.value.wetterbedingung_sonne_wind</field> </block> </value> <value name="B"> <block type="math_number" id="@~0tkS4C)u._Pmxd(+r+"> <field name="NUM">1</field> </block> </value> </block> </value> </block> </value> </block> </value> <statement name="DO2"> <block type="control" id="GT6S-*UwR[RXM?*sN#Qg"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hm-rpc.1.OEQ0888649.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="xM|5I9n#e@jEB=VDf:FG"> <field name="NUM">40</field> </block> </value> </block> </statement> </block> </statement> <value name="IF1"> <block type="logic_operation" id="BCKn}h6Zlmq+1^hVnG_F" inline="false"> <field name="OP">OR</field> <value name="A"> <block type="logic_operation" id="F=c|1kWLPjf@g6{V[xFb" inline="false"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id="FhY8j9}-s49ah]P70e(!"> <field name="OP">GT</field> <value name="A"> <block type="variables_get" id="JJ8olm3[T1|.aHK.?+L7"> <field name="VAR" id="*_-GmR@MCKPKv:J@BmX9">Außentemperatur</field> </block> </value> <value name="B"> <block type="variables_get" id="3WdpxkLyrVT#,%4j5[%."> <field name="VAR" id="Q0]Lq],ip{HX/6~Fp30x">Innentemperatur</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="O;l/!a!Fu%uiATiV8FVP"> <field name="OP">GT</field> <value name="A"> <block type="get_value" id="Y!G-sDwyi9KJfr?l[pp6"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.value.temperature</field> </block> </value> <value name="B"> <block type="math_number" id="qqwF(bQTM;4TrO4!!t}n"> <field name="NUM">10</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="5(;JmMw8`t6KJlw~4xX$"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="oNK@Re1)WU%,1`KF^KZQ"> <field name="ATTR">val</field> <field name="OID">0_userdata.0.value.wetterbedingung_sonne_wind</field> </block> </value> <value name="B"> <block type="math_number" id="p9{FdGtw0WPJj`406dD?"> <field name="NUM">0</field> </block> </value> </block> </value> </block> </value> <statement name="DO1"> <block type="controls_if" id="E|wK$qzQrJ-;kvuC.`tz"> <value name="IF0"> <block type="logic_compare" id="bDz#/i/;m7twt=mxA9Bh"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="*@2cS?+zZ3X:!_g{FXpc"> <field name="ATTR">val</field> <field name="OID">hm-rpc.1.LEQ0756941.1.STATE</field> </block> </value> <value name="B"> <block type="logic_boolean" id="!e.oEMO=:11y(+r~WPx)"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="0uf(cr;-2TrelUuSY7$/"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">hm-rpc.1.OEQ0888649.1.LEVEL</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id=":-%2svcC+q{/f!7UK?$o"> <field name="NUM">0</field> </block> </value> </block> </statement> </block> </statement> </block> </statement> </block> </statement> </block> </next> </block> <block type="debug" id="rD_4ccWaCqGF9ClNNg.#" x="513" y="458"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="SZdl[/inxqFHydgI?Gue"> <field name="TEXT">Dachfenster geschlossen</field> </shadow> </value> </block> </xml>
Das Programm ist auf zwei Uhrzeiten aufgebaut. Eines soll tagsüber laufen und eines am Abend bis zum Schlafengehen. Für die Version Tagsüber habe ich einen Datenpunkt angelegt, welcher die Intensität des Sonnenscheins und die Windstärke in 4 Werte aufteilt, die ich dann im unteren Teil des Skriptes zur Auswertung hinzu ziehe.
Nun meine Frage an euch: würde prinzipiell das Skript so laufen?
Oder wäre es besser auf einen Zeitplan zu triggern, dass die Temperaturen und das andere Geraffel aller x Minuten abgefragt und ausgewertet werden?
Oder ist das Ganze zu komplex aufgebaut und ihr würdet es lieber zerpflücken...
Ich wäre euch sehr dankbar für einige Anregungen zur Verbesserung. Das Log spuckt übrigens keinen Fehler aus - aber ich kann halt auch nichts testen (im Original lasse ich mir momentan Pushover - Nachrichten anstatt der Ansteuerung des Fensters schicken. Aber da tut sich halt nix...). -
@gezi70 sagte: Eines soll tagsüber laufen und eines am Abend bis zum Schlafengehen.
Was soll in der Nacht passieren?
-
@paul53 da soll der Stellmotor uns gefälligst in Ruhe schlafen lassen. Also nix...
-
@gezi70 sagte: da soll der Stellmotor uns gefälligst in Ruhe schlafen lassen.
Das Fenster soll in der Stellung bleiben, die es zum Schlafen gehen hat?
-
@paul53 ja, im Prinzip schon. Da sind wir eh im Schlafzimmer und können es in die Stellung bringen, in der wir es haben wollen. Bei Regen geht es eh automatisch zu...
-
@gezi70
Was bewirkt die unterste Abfrage? -
@paul53 wenn die Außentemperatur höher als die Innentemperatur ist..., und der Magnetkontakt erkennt, dass das Fenster geöffnet ist (braucht man nicht unbedingt, oder?), dann soll es geschlossen werden. Hab ich rein genommen, weil ein Jalousieaktor angesteuert wird, und das Fenster nicht unbedingt genau die Prozentzahl hat, die angezeigt wird.
Außerdem wird durch ein weiteres Skript (welches sogar funktioniert!
) bewirkt, dass, wenn der Aktor 0% meldet, der Magnetkontakt aber ein offenes Fenster erkennt, das Fenster quasi eine Initialisierung durchmacht. Es fährt so oft zwischen 0% und 100% hin und her, bis es stimmt.
-
@gezi70
Mit den Intervallen funktioniert es nicht. Die Temperaturen ändern sich oft genug, so dass diese als Trigger genügen.
Ohne auf Sinnhaftigkeit der Verknüpfungen zu prüfen, habe ich mal einige Prüfungen (z.B. Automatisierung_Dachfenster und rH < 90) zusammengefasst und den Duty cycle berücksichtigt: -
@gezi70 sagte: das Fenster quasi eine Initialisierung durchmacht. Es fährt so oft zwischen 0% und 100% hin und her, bis es stimmt.
Geht das nicht intelligenter?
-
@paul53 danke erstmal, das muss ich mir heute Abend mal in Ruhe anschauen.
Eine Frage hätte ich noch. Wie könnte ich es bewerkstelligen, dass das Fenster - sollte es aller paar Minuten die Stellung wechselt, dies nur aller, sagen wir mal 30 Minuten, macht? Mit einem Timeout in der Abfrage? -
@paul53 vielleicht schon - aber die Automatisierung ist halt nur so intelligent wie der Programmierer...
-
@gezi70 sagte: sollte es aller paar Minuten die Stellung wechselt, dies nur aller, sagen wir mal 30 Minuten, macht?
-
@paul53 der Timeout ist quasi noch mal als Variable angelegt?
-
@gezi70 sagte: der Timeout ist quasi noch mal als Variable angelegt?
timeout ist der Variablenbezeichner für das rückgegebene Timerobjekt von setTimeout().
Nach Einfügen von "Ausführen timeout" muss erst einmal in die Javascript-Ansicht und wieder zurück gewechselt werden, um auf die Variable timeout zugreifen zu können. -
@paul53 danke, und wo kriege ich die Variable von "level' her? Sorry wenn ich so dämlich frage...
Oder könntest du mir bitte deine Version als Code geben? Danke... -
@gezi70 sagte: deine Version als Code geben?
-
@paul53 ich danke dir!
-
@gezi70
Was beinhaltet eigentlich die "Differenz-Temperatur", die auf > 10 geprüft wird? -
@paul53 Differenz zwischen Innen- und Außentemperatur
-
@gezi70 sagte: Differenz zwischen Innen- und Außentemperatur
Die Differenz soll > 10 Grad sein, damit das Fenster geöffnet wird?