Hallo liebe Community,
ich erweitere mittlerweile ständig mein Smart Home und diesmal möchte ich das Klima im Badezimmer verbessern. Fenster ist leider keines vorhanden deswegen muss ein Lüfter dafür sorgen dass die feuchte Luft abtransportiert wird.
Ich habe eine Aqara Temperatur- und Feuchtigkeitssensor.
Wenn die Feuchtigkeit über 60% steigt dann soll die Lüftung für 10min (in meinen Skript 10s fürs Testen) aktiviert werden. Wenn die Feuchtigkeit danach immer noch über 60% beträgt dann soll die Lüftung für weitere 10min aktiv sein. Das soll so lange laufen bis die Feuchtigkeit unter 60% fällt.
Wenn die Lüftung jedoch bereits vorher läuft, dann soll dieses Skript nicht aktiviert werden.
Ich nehem an man arbeitet in diesem Fall mit Variablen nur leider stehe ich ein bisschen an.
LG
Das ist mein derzeit erstelltes Skript.
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="undefined" id="timeout">timeout</variable>
</variables>
<block type="on_ext" id="a3r3_!N#*$/9TCFkKNX[" x="88" y="-187">
<mutation items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="HQ;okbu$SI;|n;Dkk1S6">
<field name="oid">deconz.0.Sensors.4.humidity</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="controls_if" id="e{F%Pg/.X.Rn;t[KE_!@">
<value name="IF0">
<block type="logic_operation" id="5E3wav(lgtg(9=XLX^eW" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="98bAjIc~og[$6lZv0Oq7">
<field name="OP">GT</field>
<value name="A">
<block type="get_value" id="a`R5#[5gNHnDZau%nx~]">
<field name="ATTR">val</field>
<field name="OID">deconz.0.Sensors.4.humidity</field>
</block>
</value>
<value name="B">
<block type="math_number" id="0I8CZmyI#Lpgf?#.ML(l">
<field name="NUM">60</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="5-l.dSX,iJn7rlkxY5~@">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="]EXDXZLE_nupQDL=9UD!">
<field name="ATTR">val</field>
<field name="OID">sonoff.0.SH_Dachboden_Wohnraumlueftumg.POWER</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="hAEfk}$pYCZ03ykkB%)u">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="Tb1m79?4)}=VDR[vRw-;">
<mutation delay_input="false"></mutation>
<field name="OID">sonoff.0.SH_Dachboden_Wohnraumlueftumg.POWER</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="]/D4vbwt?)ZT$^RRs$t8">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="timeouts_settimeout" id="P,3P)V4JUV.x1UB.6FL{">
<field name="NAME">timeout</field>
<field name="DELAY">10</field>
<field name="UNIT">sec</field>
<statement name="STATEMENT">
<block type="controls_if" id="DenH/.VC+x?@,T~S~$W~">
<value name="IF0">
<block type="logic_operation" id="+ti;rez)!M3lcy4m9fZs" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="Q8d1ND=qLNT@XzM?DFq`">
<field name="OP">LT</field>
<value name="A">
<block type="get_value" id="EOMn,OB)[R6_TTB,JXn$">
<field name="ATTR">val</field>
<field name="OID">deconz.0.Sensors.4.humidity</field>
</block>
</value>
<value name="B">
<block type="math_number" id="RY0llEkkBD=%sfc3GZGv">
<field name="NUM">60</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="1udT4.q?6b`8=1EO!nm1">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="3Us|JG/fR|syg~gM}8nU">
<field name="ATTR">val</field>
<field name="OID">sonoff.0.SH_Dachboden_Wohnraumlueftumg.POWER</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="n%281v#~@;ug{P!`y:F6">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="xP/jLW)NSY[ReUwJadXi">
<mutation delay_input="false"></mutation>
<field name="OID">sonoff.0.SH_Dachboden_Wohnraumlueftumg.POWER</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="ezS%/@xR^|O}PQ:]$o1+">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
</block>
</statement>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>