Hallo zusammen,
Ich bin vor kurzen von OpenHAB auf ioBroker umgestiegen. Bis jetzt bin ich hoch zufrieden.
Nun bin ich im Moment dabei mir ein Script mit Blockly zu erstellen das mir nach Sonnenuntergang bei erkennender Bewegung im Flur das Licht einschaltet. Wird keine Bewegung mehr erkannt soll das Licht wieder ausgeschaltet werden. Das funktioniert im großen und ganzen auch schon ganz gut. Allerdings hat es noch ein paar kleine Macken. Schalte ich das Licht zwischenzeitlich zum Beispiel über Alexa aus geht das Licht in gedimmter Form irgendwann wieder an. Und zwar immer dann wenn das Script genau an der Stelle angekommen ist das Licht zu dimmen bevor es dann endgültig ausgeht. Auch werden in der Phase in der das Licht auf 100% an ist, weitere Bewegungen ignoriert.
Das Script sieht im Moment folgendermaßen aus und ich komme leider nicht wirklich weiter.
Bin für jeden Vorschlag offen und dankbar.
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="undefined" id="timeout">timeout</variable>
<variable type="undefined" id="timeout2">timeout2</variable>
</variables>
<block type="on_ext" id="uB/[ZC%y:g~{/AvhTw?M" x="12" y="-12">
<mutation items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="QLI5S)(XYvqx}MQ$zdUJ">
<field name="oid">hue.0.Flur_Lampe_Sensor.presence</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="controls_if" id=")r=Kz~I`:AZ.Aa@a%qW/">
<mutation elseif="1"></mutation>
<value name="IF0">
<block type="logic_operation" id=")74D(l$xMk.X#algRcX+">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="|(b+Ui2RSpq)2Jj+mW4D">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="]a-11RcI3nzTTEy8sV^x">
<field name="ATTR">val</field>
<field name="OID">hue.0.Flur_Lampe_Sensor.presence</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="F)9b5(X22$HSASC0?_1A">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="MFHd7g{[t3N/Y#L1*.i$">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="cR)ZHisP61k`(Yl2yWMO">
<field name="ATTR">val</field>
<field name="OID">User.0.Sonnenuntzergang</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="ZM{yWjtcNfR}C.}]=_Z,">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id=";JP7k:]|J~h$b;PNFqp/">
<mutation delay_input="false"></mutation>
<field name="OID">hue.0.Flur_Lampe.level</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="SDVB#ZWT`!R2o6AHk3MF">
<field name="TEXT">50</field>
</block>
</value>
</block>
</statement>
<value name="IF1">
<block type="logic_operation" id="KrIwj.;_-7Q$$($+0le%">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="qFP{X87W}}Kfz5Ez-j(^">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="Y#g38aU$qwDiOd(0lPTe">
<field name="ATTR">val</field>
<field name="OID">hue.0.Flur_Lampe_Sensor.presence</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="+~yZMj|5[!1!w~DuuN_n">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id=";#2a|rT~X@D!PNPtsKg]">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="7cJdA^|Q:r4ZrtC3@Afr">
<field name="ATTR">val</field>
<field name="OID">User.0.Sonnenuntzergang</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="{72_v+#d{^o6j6lRz]Vl">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="timeouts_cleartimeout" id="V3sG{;xxVGccy8^^QI/[">
<field name="NAME">timeout</field>
<next>
<block type="timeouts_settimeout" id="E=a2J[dPAMg#8{CP}:Li">
<field name="NAME">timeout</field>
<field name="DELAY">45</field>
<field name="UNIT">sec</field>
<statement name="STATEMENT">
<block type="control" id="8i,$Tjec,b*qe}p^$?8s">
<mutation delay_input="false"></mutation>
<field name="OID">hue.0.Flur_Lampe.level</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="-=-~[IKB#/D{a/Vw,y6N">
<field name="TEXT">10</field>
</block>
</value>
</block>
</statement>
<next>
<block type="timeouts_cleartimeout" id="uz60m}[Zg;iPi]*plr`u">
<field name="NAME">timeout2</field>
<next>
<block type="timeouts_settimeout" id="TZj7%6DjO_Iy;xB}k1~e">
<field name="NAME">timeout2</field>
<field name="DELAY">1</field>
<field name="UNIT">min</field>
<statement name="STATEMENT">
<block type="control" id="i3N`X8qCv*_p;4hB0O5z">
<mutation delay_input="false"></mutation>
<field name="OID">hue.0.Flur_Lampe.on</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="RtE.Zy_e[=AzkCAR4Nj0">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>
Alles anzeigen