Hallo zusammen,
ich möchte in Blockly eine Lampe für eine bestimmte Zeit ein- und nach Ablauf dieser Zeit dann wieder ausschalten. Wie wird so etwas gelöst? Mit einem Timeout?
Das Ganze soll auch nur in einem bestimmten Zeitraum (jeden Tag zwischen 23:00 und 6:30 Uhr) passieren.
Ich weiß nicht, ob das so korrekt ist?
Gruß surfer ;-)
@surfer09
so etwas in der Art könnte bei dir passen
Spoiler
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable type="timeout" id="timeout">timeout</variable>
</variables>
<block type="on_ext" id="1%U2gZWUg(;+%%Gfq7m8" x="-12" y="-162">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="J@CkHbT3B2{D%I:}2k#6">
<field name="oid">0_userdata.0.test.BWM-2</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="controls_if" id="5|GH(4Q6~0Z=(Vpvz7Q6">
<value name="IF0">
<block type="logic_operation" id="}UY9z]5Aei~`idvz6_uT" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="on_source" id="6L]3Ymc@dZiIlWJ!uY=h">
<field name="ATTR">id</field>
</block>
</value>
<value name="B">
<block type="time_compare_ex" id="^Ca[Wsp(LX;}r?behXFY">
<mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true" actual_time="true"></mutation>
<field name="USE_ACTUAL_TIME">TRUE</field>
<field name="OPTION">between</field>
<value name="START_TIME">
<shadow type="text" id="^+V1v-Ck^sL9:J]i5jWm">
<field name="TEXT">12:00</field>
</shadow>
</value>
<value name="END_TIME">
<shadow type="text" id="3)Kz,@T-`4)mn}3A[N.3">
<field name="TEXT">18:00</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="timeouts_cleartimeout" id="~@g;V[pprh,wX5rlc8rf">
<field name="NAME">timeout</field>
<next>
<block type="control" id="tHl7RQx2JsF%Vev$E/lM">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.test.Lampe</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id=";G%QdhH6`Y|ED$~UPEDi">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="timeouts_settimeout" id="d81Oikn0nU}*=X[|tan]">
<field name="NAME">timeout</field>
<field name="DELAY">2</field>
<field name="UNIT">min</field>
<statement name="STATEMENT">
<block type="control" id="CQupwdw]kq-1+t=Ak~me">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.test.Lampe</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="{763oPFwce-w8tc==6G)">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>
@surfer09
so etwas in der Art könnte bei dir passen
Spoiler
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable type="timeout" id="timeout">timeout</variable>
</variables>
<block type="on_ext" id="1%U2gZWUg(;+%%Gfq7m8" x="-12" y="-162">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="J@CkHbT3B2{D%I:}2k#6">
<field name="oid">0_userdata.0.test.BWM-2</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="controls_if" id="5|GH(4Q6~0Z=(Vpvz7Q6">
<value name="IF0">
<block type="logic_operation" id="}UY9z]5Aei~`idvz6_uT" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="on_source" id="6L]3Ymc@dZiIlWJ!uY=h">
<field name="ATTR">id</field>
</block>
</value>
<value name="B">
<block type="time_compare_ex" id="^Ca[Wsp(LX;}r?behXFY">
<mutation xmlns="http://www.w3.org/1999/xhtml" end_time="true" actual_time="true"></mutation>
<field name="USE_ACTUAL_TIME">TRUE</field>
<field name="OPTION">between</field>
<value name="START_TIME">
<shadow type="text" id="^+V1v-Ck^sL9:J]i5jWm">
<field name="TEXT">12:00</field>
</shadow>
</value>
<value name="END_TIME">
<shadow type="text" id="3)Kz,@T-`4)mn}3A[N.3">
<field name="TEXT">18:00</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="timeouts_cleartimeout" id="~@g;V[pprh,wX5rlc8rf">
<field name="NAME">timeout</field>
<next>
<block type="control" id="tHl7RQx2JsF%Vev$E/lM">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.test.Lampe</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id=";G%QdhH6`Y|ED$~UPEDi">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="timeouts_settimeout" id="d81Oikn0nU}*=X[|tan]">
<field name="NAME">timeout</field>
<field name="DELAY">2</field>
<field name="UNIT">min</field>
<statement name="STATEMENT">
<block type="control" id="CQupwdw]kq-1+t=Ak~me">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.test.Lampe</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="{763oPFwce-w8tc==6G)">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>
@bbtown
Fast :)
Der Block
muss noch auf "Wert" umgestellt werden, sonst geht es nicht.
A.
@bbtown
Fast :)
Der Block
muss noch auf "Wert" umgestellt werden, sonst geht es nicht.
A.
@asgothian So funktioniert es jetzt. Habe ich den Timeout hier richtig zurückgesetzt? Ich bin mir nicht sicher, ob der hier an der richtigen Stelle steht?
@bbtown
Fast :)
Der Block
muss noch auf "Wert" umgestellt werden, sonst geht es nicht.
A.
@asgothian sagte in Licht für bestimmte Zeit einschalten, danach aus :
@bbtown
Fast :)
Der Block
muss noch auf "Wert" umgestellt werden, sonst geht es nicht.
A.
erwischt
@asgothian So funktioniert es jetzt. Habe ich den Timeout hier richtig zurückgesetzt? Ich bin mir nicht sicher, ob der hier an der richtigen Stelle steht?
@surfer09
Fast, du musst bei der Zeit "NICHT zwischen 6.30 und 23 Uhr" nehmen, da über MItternacht nicht funktioniert
@asgothian So funktioniert es jetzt. Habe ich den Timeout hier richtig zurückgesetzt? Ich bin mir nicht sicher, ob der hier an der richtigen Stelle steht?
@surfer09
Spoiler
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable type="timeout" id="timeout">timeout</variable>
</variables>
<block type="on_ext" id="1%U2gZWUg(;+%%Gfq7m8" x="113" y="-87">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="J@CkHbT3B2{D%I:}2k#6">
<field name="oid">0_userdata.0.test.BWM-2</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="controls_if" id="5|GH(4Q6~0Z=(Vpvz7Q6">
<value name="IF0">
<block type="logic_operation" id="}UY9z]5Aei~`idvz6_uT" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="on_source" id="6L]3Ymc@dZiIlWJ!uY=h">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="time_compare_ex" id="^Ca[Wsp(LX;}r?behXFY">
<mutation xmlns="http://www.w3.org/1999/xhtml" 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="^+V1v-Ck^sL9:J]i5jWm">
<field name="TEXT">06:31</field>
</shadow>
</value>
<value name="END_TIME">
<shadow type="text" id="3)Kz,@T-`4)mn}3A[N.3">
<field name="TEXT">22:59</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="timeouts_cleartimeout" id="~@g;V[pprh,wX5rlc8rf">
<field name="NAME">timeout</field>
<next>
<block type="control" id="tHl7RQx2JsF%Vev$E/lM">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.test.Lampe</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id=";G%QdhH6`Y|ED$~UPEDi">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="timeouts_settimeout" id="d81Oikn0nU}*=X[|tan]">
<field name="NAME">timeout</field>
<field name="DELAY">2</field>
<field name="UNIT">min</field>
<statement name="STATEMENT">
<block type="control" id="CQupwdw]kq-1+t=Ak~me">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.test.Lampe</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="{763oPFwce-w8tc==6G)">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>
@surfer09
Spoiler
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable type="timeout" id="timeout">timeout</variable>
</variables>
<block type="on_ext" id="1%U2gZWUg(;+%%Gfq7m8" x="113" y="-87">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="J@CkHbT3B2{D%I:}2k#6">
<field name="oid">0_userdata.0.test.BWM-2</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="controls_if" id="5|GH(4Q6~0Z=(Vpvz7Q6">
<value name="IF0">
<block type="logic_operation" id="}UY9z]5Aei~`idvz6_uT" inline="false">
<field name="OP">AND</field>
<value name="A">
<block type="on_source" id="6L]3Ymc@dZiIlWJ!uY=h">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="time_compare_ex" id="^Ca[Wsp(LX;}r?behXFY">
<mutation xmlns="http://www.w3.org/1999/xhtml" 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="^+V1v-Ck^sL9:J]i5jWm">
<field name="TEXT">06:31</field>
</shadow>
</value>
<value name="END_TIME">
<shadow type="text" id="3)Kz,@T-`4)mn}3A[N.3">
<field name="TEXT">22:59</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="timeouts_cleartimeout" id="~@g;V[pprh,wX5rlc8rf">
<field name="NAME">timeout</field>
<next>
<block type="control" id="tHl7RQx2JsF%Vev$E/lM">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.test.Lampe</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id=";G%QdhH6`Y|ED$~UPEDi">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="timeouts_settimeout" id="d81Oikn0nU}*=X[|tan]">
<field name="NAME">timeout</field>
<field name="DELAY">2</field>
<field name="UNIT">min</field>
<statement name="STATEMENT">
<block type="control" id="CQupwdw]kq-1+t=Ak~me">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.test.Lampe</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="{763oPFwce-w8tc==6G)">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>
@bbtown Danke für den Hinweis, das war mir so auch noch nicht bekannt! ;-)
@bbtown Danke für den Hinweis, das war mir so auch noch nicht bekannt! ;-)
@surfer09
Der Hinweis kam von @Nordischerjung ;-)
@surfer09
Fast, du musst bei der Zeit "NICHT zwischen 6.30 und 23 Uhr" nehmen, da über MItternacht nicht funktioniert
@nordischerjung Danke für den Hinweis! :-)
@surfer09
Fast, du musst bei der Zeit "NICHT zwischen 6.30 und 23 Uhr" nehmen, da über MItternacht nicht funktioniert
@nordischerjung sagte: "NICHT zwischen 6.30 und 23 Uhr" nehmen, da über MItternacht nicht funktioniert
Über Mitternacht funktioniert nur mit Astrozeiten nicht.
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren
Anmelden