Hallo Zusammen,
Ich bin jetzt dann langsam völlig am Verzweifeln. Habe nun schon einiges im Forum gefunden (und dabei auch über die 12-stunden bzw. Nicht-zwischen-Regel gestolpert), aber ich bekomm mein Script einfach nicht zum laufen.
Beschreibung der Funktion:
Existierende Alexa-Routine würde durch ein virtuelles Gerät (iot-Adapter) "xyzHMFlur" erweitert. Routine soll alle Steuerbaren Geräte ausschalten, die ausgeschalten werden müssen (Alles-Aus).
Nun ist aufgefallen das es speziell im Flur ungeschickt ist, dass wenn man im Flur steht, und die Routine anwirft, eben man dann im Dunkeln steht. Also war der Plan folgendes:
Routine Aktiviert xyzHMFlur. Im Blocklyskript wird dann Zeitgesteuert folgendes Abgefragt:
Fall 1: Ist es denn Tagsüber (nicht zwischen Sonnenuntergang und Sonnenaufgang)? wenn ja mache setze Flurlicht auf False
Fall 2: Ist es Nacht ( nicht zwischen Sonnenaufgang und Sonnenuntergang) dann Schalte das Licht an.
Fall 3: ist es Nacht (wie oben) und das Licht ist an (ist es jetzt ja auf jeden fall), dann mache es verzögert aus.
Ich teste das Skript aktuell ( 00:20 Uhr) und er springt mir in den Fall 1, und macht eben das Licht aus.
Egal wie ich Sonnenaufgang oder Sonnenuntergang hin und hin und herwechsle macht er immer irgendwie nichts...
Was mache ich Falsch?
grüße
Spoiler
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="comment" id="9H@^2*ZxZC}Zfqzev{[z" x="-212" y="-313">
<field name="COMMENT">v1.0</field>
<next>
<block type="comment" id="xZc#_.V{Y=UU{$3Jy,?q">
<field name="COMMENT">Getestet: 07.12.2019</field>
<next>
<block type="comment" id="[!4UC_`Rya{~hxv-@9i8">
<field name="COMMENT">Gucken ob was passiert</field>
<next>
<block type="on" id="^T5-6l?3LNzjWTZ{OVq8">
<field name="OID">SmartHomeMerkler.0.Flur.xyzHMFlur</field>
<field name="CONDITION">any</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="controls_if" id="~1=5?CT4)lxxREA4ScxZ">
<mutation elseif="2"></mutation>
<value name="IF0">
<block type="logic_operation" id="MOn;$bHb]w|:KkM$K5$7">
<field name="OP">AND</field>
<value name="A">
<block type="time_compare_ex" id="]j.ZwMlow%,,cE:e]}9W">
<mutation end_time="true" actual_time="true"></mutation>
<field name="USE_ACTUAL_TIME">TRUE</field>
<field name="OPTION">not between</field>
<value name="START_TIME">
<shadow type="text" id="){^SoyoMx$$R*}pqmzy}">
<field name="TEXT">12:00</field>
</shadow>
<block type="time_astro" id=":4CY8{Onq%BG3fsS`7`f">
<field name="TYPE">sunsetStart</field>
<field name="OFFSET">0</field>
</block>
</value>
<value name="END_TIME">
<shadow type="text" id="0-8=#zAFwIO!JD8?]kLX">
<field name="TEXT">18:00</field>
</shadow>
<block type="time_astro" id="Rq_hSu)SYkMaq)kx*2N9">
<field name="TYPE">sunriseEnd</field>
<field name="OFFSET">0</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="PR7apOB|J4hZU5m+S7f(">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="#@TEDN9eRnnWjZ!:kZQ0">
<field name="ATTR">val</field>
<field name="OID">SmartHomeMerkler.0.Flur.xyzHMFlur</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="7XUHVTZtu+r*=2Ko~{;w">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="SYm-KRp|S#{DD;T`hnVV">
<mutation delay_input="false"></mutation>
<field name="OID">sonoff.0.CorridorTouchTasmota.POWER</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="Y[Or)}CI26OMsh01D,Vo">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="control" id="hgV}[QyLIXz]iO_b]jpS">
<mutation delay_input="false"></mutation>
<field name="OID">SmartHomeMerkler.0.Flur.xyzHMFlur</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="|QhzvxED`A;bVoaIceCQ">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="debug" id="Mps.Yza!X=@jrw@jUu?t">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id=";30bEgOhabl_%3k_2tE]">
<field name="TEXT">keine Aktion</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
<value name="IF1">
<block type="logic_operation" id="F/PdT,JQ+:Ce[!]iiGd7">
<field name="OP">AND</field>
<value name="A">
<block type="time_compare_ex" id="=FHgm5?c~0T`2C11f$cA">
<mutation end_time="true" actual_time="true"></mutation>
<field name="USE_ACTUAL_TIME">TRUE</field>
<field name="OPTION">not between</field>
<value name="START_TIME">
<shadow type="text" id="){^SoyoMx$$R*}pqmzy}">
<field name="TEXT">12:00</field>
</shadow>
<block type="time_astro" id="k4L~?{E!RU7[hrMZu?UP">
<field name="TYPE">sunriseEnd</field>
<field name="OFFSET">0</field>
</block>
</value>
<value name="END_TIME">
<shadow type="text" id="0-8=#zAFwIO!JD8?]kLX">
<field name="TEXT">18:00</field>
</shadow>
<block type="time_astro" id=")*#}8Ws+g(@UgpGgCC+)">
<field name="TYPE">sunsetStart</field>
<field name="OFFSET">0</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="$Twemu!i8cfTC.B^_{U+">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="!C)XBjB9AZklmr.nA__Z">
<field name="ATTR">val</field>
<field name="OID">SmartHomeMerkler.0.Flur.xyzHMFlur</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="p@H=7Tj/-~-o4{mtn+?C">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="control" id="a9uQa+c~2.{RXs*-hXI_">
<mutation delay_input="false"></mutation>
<field name="OID">sonoff.0.CorridorTouchTasmota.POWER</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="9q,2e{u5aE9nw74lzbn@">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="debug" id="zgKhQ}?wFlWR5B~~{-!8">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="Q)fXbuIZ]748%~5ln?-?">
<field name="TEXT">5 min Angeworfen</field>
</shadow>
</value>
</block>
</next>
</block>
</statement>
<value name="IF2">
<block type="logic_operation" id="(w4]PDx_R)bFAxCu*8VT" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="logic_operation" id="pgkX+M*F|}7i[iKtaxPR">
<field name="OP">AND</field>
<value name="A">
<block type="time_compare_ex" id="CSGl!fI/{G@g5)W[AtCL">
<mutation end_time="true" actual_time="true"></mutation>
<field name="USE_ACTUAL_TIME">TRUE</field>
<field name="OPTION">not between</field>
<value name="START_TIME">
<shadow type="text" id="){^SoyoMx$$R*}pqmzy}">
<field name="TEXT">12:00</field>
</shadow>
<block type="time_astro" id=",ZDx[h$)*ur4*f!9W/k]">
<field name="TYPE">sunriseEnd</field>
<field name="OFFSET">0</field>
</block>
</value>
<value name="END_TIME">
<shadow type="text" id="0-8=#zAFwIO!JD8?]kLX">
<field name="TEXT">18:00</field>
</shadow>
<block type="time_astro" id="{d~4+}q9quI:L$TBLQD2">
<field name="TYPE">sunsetStart</field>
<field name="OFFSET">0</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="TzzpC?oHe@t{IW~tQ8T|">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="(OhZMFCxDFw),eUv2Xo_">
<field name="ATTR">val</field>
<field name="OID">SmartHomeMerkler.0.Flur.xyzHMFlur</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="a~Unh`7iC]W;g%N{*z2W">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="M|=6?e^NF|z1@e4xh_TB">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="%.lpW2j,W)DkxO]S_5TO">
<field name="ATTR">val</field>
<field name="OID">sonoff.0.CorridorTouchTasmota.POWER</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="?98+iIeFMfYS4M9o|Wm~">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO2">
<block type="control" id="@l=9PP#@uptYzX8}Q@-/">
<mutation delay_input="true"></mutation>
<field name="OID">sonoff.0.CorridorTouchTasmota.POWER</field>
<field name="WITH_DELAY">TRUE</field>
<field name="DELAY_MS">3</field>
<field name="UNIT">min</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="uz1R(kPx8|U8XCJ#=.G/">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="control" id="zq`m_zv|(Qv=C+d2K-+.">
<mutation delay_input="false"></mutation>
<field name="OID">SmartHomeMerkler.0.Flur.xyzHMFlur</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="oP.n6i4+9kj2^pWM#0H)">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="debug" id="5Vg^IwRMZNv]P#n)0lR@">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="#?~f2]6*/QNr[x=55m;m">
<field name="TEXT">5 min ausgelaufen</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</xml>