NEWS
Tür-Überwachung
-
Hardwaresystem: Virtuelle Maschine auf QNAP Arbeitsspeicher: 16GB Festplattenart: HDD Raid 5 Betriebssystem: Ubuntu Node-Version: 10.x.x Nodejs-Version: 10.x.x NPM-Version: 6.x.x Installationsart: Manuell Image genutzt: Nein Ort/Name der Imagedatei: Link
Auf die Gefahr hin, dass ich das Thema zu x-ten Mal strapziere. Ich möchte eine offene Tür überwachen. Sensor ist HmIP-SWDM. Dazu greife ich den (bestätigten) Zustand xxxx.1.state ab. Die Meldung des Sensors ist 3 Sekunden verzögert um den Sensor zu entprellen. Nun stelle fest, das trotzdem die Meldung "...offen..." 3x kommt. Das bring natürlich mein Programm durcheinander. Woran liegt das? Das Programm läuft richt durch. Wenn dann die Tür wiedser geschlossen ist, wird aber die Meldung wiederholt. Das liegt m. E. daran, dass das Programm mehrfach gestartet wird und nur einmal beendet. 3 Sekunden entprellen sind massig genug.
Hier das Blockly:

<xml xmlns="https://developers.google.com/blockly/xml"> <block type="comment" id="8/[5~4c~(5.,2*E%K~bM" x="-1087" y="-3687"> <field name="COMMENT">Test</field> <next> <block type="on_ext" id="yu}cuzSYpo1AAdg#}R`="> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION">true</field> <value name="OID0"> <shadow type="field_oid" id="bytazo}Mn;cK#PZ4VjaI"> <field name="oid">hm-rpc.2.00155D8993CE0D.1.STATE</field> </shadow> </value> <statement name="STATEMENT"> <block type="debug" id="5w=EU2j}!rgh+JnFs=tx"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="Qr:5T-,S[OHD(2Y?rJjU"> <field name="TEXT">Schiebetür rechts geändert</field> </shadow> <block type="text_join" id="BM`Oa?qi12Wq26t.zH^n"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="zp(v@f?u/)xU~8tY[mI("> <field name="TEXT">Zustand Tür rechts </field> </block> </value> <value name="ADD1"> <block type="on_source" id="ThS`PM_~UzoJ^B2-O[3r"> <field name="ATTR">state.val</field> </block> </value> </block> </value> <next> <block type="debug" id="T`GNL|y?L@Fm5)q8[Hv0"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="Qr:5T-,S[OHD(2Y?rJjU"> <field name="TEXT">Schiebetür rechts geändert</field> </shadow> <block type="text_join" id="}{{R?35rT1zY8RU??67j"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="}zu7nGe!NsH^V4I=K_;w"> <field name="TEXT">Aussentemperatur </field> </block> </value> <value name="ADD1"> <block type="get_value_var" id="ypK[0gdI7%fg]6garPR$"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="eX@e[jzyJS;UU_vfH|pA"> <field name="oid">hm-rpc.2.00185BE9A574BC.1.ACTUAL_TEMPERATURE</field> </shadow> </value> </block> </value> </block> </value> <next> <block type="comment" id="xy84EcK`vt!#M7?6os.P"> <field name="COMMENT">Achtung: Wert des Kontaktes ist 1 bei geöffnetem Zustanand</field> <next> <block type="controls_whileUntil" id="Swvh?9!TUi7ztV#kiO3F"> <field name="MODE">WHILE</field> <value name="BOOL"> <block type="logic_operation" id="`n2LU4rF(qoz7I4QSwdU"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id=";g{?tx$UW])Hz~EL~R9j"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id=",Zc#}kp33re$+).v3K8|"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="math_number" id=":E%MW[W^`VI~|F!T(;o7"> <field name="NUM">1</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="w8N+8=ax0R=09jY44*@D"> <field name="OP">LTE</field> <value name="A"> <block type="get_value_var" id="lX`qgJt*SWL20.ia0LLm"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="fpHn:$yca~xj{XcXjM0I"> <field name="oid">hm-rpc.2.00185BE9A574BC.1.ACTUAL_TEMPERATURE</field> </shadow> </value> </block> </value> <value name="B"> <block type="math_number" id="ENeHh{F#Q~$@sH,#VB/)"> <field name="NUM">20</field> </block> </value> </block> </value> </block> </value> <statement name="DO"> <block type="debug" id="L(Q*uEl{e8];gH7AEE)R"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="ljx0@doVW,3JG|VAFJ?x"> <field name="TEXT">Schiebetür rechts offen</field> </shadow> </value> <next> <block type="comment" id="{^7M}J^8P~M81{;L/N0b"> <field name="COMMENT">Warten</field> <next> <block type="timeouts_wait" id="O__/c0ur3Np[WSWk)/S:"> <field name="DELAY">1</field> <field name="UNIT">min</field> <next> <block type="comment" id="U_fG?f.nV7rpd$+t[qc*"> <field name="COMMENT">Warnung in Küche</field> <next> <block type="control" id="pK![BkV4GX6Dt]lJnP}+"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G2A0P308805402P0.Commands.speak-volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="0=$}M84g}5t81^kv%]O7"> <field name="NUM">50</field> </block> </value> <next> <block type="control" id="OF^D_3}7[V-T|_BZ![u="> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G091GG10150604RE.Commands.speak</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="}LGb~6p8l/QQ/|wM!OfJ"> <field name="TEXT">Schiebetür rechts bitte schliessen</field> </block> </value> <next> <block type="comment" id="_uH61hG9`Pl3W*+Mbd?G"> <field name="COMMENT">Warnung in Büro</field> <next> <block type="control" id="X81ydw*h]|WHOmpmQd6K"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G2A0P308805402P0.Commands.speak-volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="_ZJc0zhfI*sCQ}30S~K3"> <field name="NUM">0</field> </block> </value> <next> <block type="control" id=":]XKy3rOPI/%cnTu~I`p"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G2A0P308805402P0.Commands.speak</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="{71M(F^o$11*;ec?{Bk["> <field name="TEXT">Schiebetür rechts bitte schliessen</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="debug" id="CP|Y4vz!nVUkC!|nRE~x"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="nDh44}+U+nl9(5tFakWp"> <field name="TEXT">Tür rechts geschlossen</field> </shadow> </value> <next> <block type="debug" id="0@;=8aOHF5jaW[`u[^C?"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="Qr:5T-,S[OHD(2Y?rJjU"> <field name="TEXT">Schiebetür rechts geändert</field> </shadow> <block type="text_join" id="]IK,4;Q9NFhg1fU`8E,/"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="y_Ut=yx36)%coq~W}*$z"> <field name="TEXT">Zustand Tür rechts </field> </block> </value> <value name="ADD1"> <block type="on_source" id=",ytR|dBenFMgC[cMkk8}"> <field name="ATTR">state.val</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> <block type="logic_boolean" id="ir+anz-0_EgNN]Rfr_Bq" x="-696" y="-3223"> <field name="BOOL">TRUE</field> </block> </xml>
-
@axel sagte in Tür-Überwachung:
Hardwaresystem: Virtuelle Maschine auf QNAP Arbeitsspeicher: 16GB Festplattenart: HDD Raid 5 Betriebssystem: Ubuntu Node-Version: 10.x.x Nodejs-Version: 10.x.x NPM-Version: 6.x.x Installationsart: Manuell Image genutzt: Nein Ort/Name der Imagedatei: Link
Auf die Gefahr hin, dass ich das Thema zu x-ten Mal strapziere. Ich möchte eine offene Tür überwachen. Sensor ist HmIP-SWDM. Dazu greife ich den (bestätigten) Zustand xxxx.1.state ab. Die Meldung des Sensors ist 3 Sekunden verzögert um den Sensor zu entprellen. Nun stelle fest, das trotzdem die Meldung "...offen..." 3x kommt. Das bring natürlich mein Programm durcheinander. Woran liegt das? Das Programm läuft richt durch. Wenn dann die Tür wiedser geschlossen ist, wird aber die Meldung wiederholt. Das liegt m. E. daran, dass das Programm mehrfach gestartet wird und nur einmal beendet. 3 Sekunden entprellen sind massig genug.
Hier das Blockly:

<xml xmlns="https://developers.google.com/blockly/xml"> <block type="comment" id="8/[5~4c~(5.,2*E%K~bM" x="-1087" y="-3687"> <field name="COMMENT">Test</field> <next> <block type="on_ext" id="yu}cuzSYpo1AAdg#}R`="> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION">true</field> <value name="OID0"> <shadow type="field_oid" id="bytazo}Mn;cK#PZ4VjaI"> <field name="oid">hm-rpc.2.00155D8993CE0D.1.STATE</field> </shadow> </value> <statement name="STATEMENT"> <block type="debug" id="5w=EU2j}!rgh+JnFs=tx"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="Qr:5T-,S[OHD(2Y?rJjU"> <field name="TEXT">Schiebetür rechts geändert</field> </shadow> <block type="text_join" id="BM`Oa?qi12Wq26t.zH^n"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="zp(v@f?u/)xU~8tY[mI("> <field name="TEXT">Zustand Tür rechts </field> </block> </value> <value name="ADD1"> <block type="on_source" id="ThS`PM_~UzoJ^B2-O[3r"> <field name="ATTR">state.val</field> </block> </value> </block> </value> <next> <block type="debug" id="T`GNL|y?L@Fm5)q8[Hv0"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="Qr:5T-,S[OHD(2Y?rJjU"> <field name="TEXT">Schiebetür rechts geändert</field> </shadow> <block type="text_join" id="}{{R?35rT1zY8RU??67j"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="}zu7nGe!NsH^V4I=K_;w"> <field name="TEXT">Aussentemperatur </field> </block> </value> <value name="ADD1"> <block type="get_value_var" id="ypK[0gdI7%fg]6garPR$"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="eX@e[jzyJS;UU_vfH|pA"> <field name="oid">hm-rpc.2.00185BE9A574BC.1.ACTUAL_TEMPERATURE</field> </shadow> </value> </block> </value> </block> </value> <next> <block type="comment" id="xy84EcK`vt!#M7?6os.P"> <field name="COMMENT">Achtung: Wert des Kontaktes ist 1 bei geöffnetem Zustanand</field> <next> <block type="controls_whileUntil" id="Swvh?9!TUi7ztV#kiO3F"> <field name="MODE">WHILE</field> <value name="BOOL"> <block type="logic_operation" id="`n2LU4rF(qoz7I4QSwdU"> <field name="OP">AND</field> <value name="A"> <block type="logic_compare" id=";g{?tx$UW])Hz~EL~R9j"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id=",Zc#}kp33re$+).v3K8|"> <field name="ATTR">state.val</field> </block> </value> <value name="B"> <block type="math_number" id=":E%MW[W^`VI~|F!T(;o7"> <field name="NUM">1</field> </block> </value> </block> </value> <value name="B"> <block type="logic_compare" id="w8N+8=ax0R=09jY44*@D"> <field name="OP">LTE</field> <value name="A"> <block type="get_value_var" id="lX`qgJt*SWL20.ia0LLm"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="fpHn:$yca~xj{XcXjM0I"> <field name="oid">hm-rpc.2.00185BE9A574BC.1.ACTUAL_TEMPERATURE</field> </shadow> </value> </block> </value> <value name="B"> <block type="math_number" id="ENeHh{F#Q~$@sH,#VB/)"> <field name="NUM">20</field> </block> </value> </block> </value> </block> </value> <statement name="DO"> <block type="debug" id="L(Q*uEl{e8];gH7AEE)R"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="ljx0@doVW,3JG|VAFJ?x"> <field name="TEXT">Schiebetür rechts offen</field> </shadow> </value> <next> <block type="comment" id="{^7M}J^8P~M81{;L/N0b"> <field name="COMMENT">Warten</field> <next> <block type="timeouts_wait" id="O__/c0ur3Np[WSWk)/S:"> <field name="DELAY">1</field> <field name="UNIT">min</field> <next> <block type="comment" id="U_fG?f.nV7rpd$+t[qc*"> <field name="COMMENT">Warnung in Küche</field> <next> <block type="control" id="pK![BkV4GX6Dt]lJnP}+"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G2A0P308805402P0.Commands.speak-volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="0=$}M84g}5t81^kv%]O7"> <field name="NUM">50</field> </block> </value> <next> <block type="control" id="OF^D_3}7[V-T|_BZ![u="> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G091GG10150604RE.Commands.speak</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="}LGb~6p8l/QQ/|wM!OfJ"> <field name="TEXT">Schiebetür rechts bitte schliessen</field> </block> </value> <next> <block type="comment" id="_uH61hG9`Pl3W*+Mbd?G"> <field name="COMMENT">Warnung in Büro</field> <next> <block type="control" id="X81ydw*h]|WHOmpmQd6K"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G2A0P308805402P0.Commands.speak-volume</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="_ZJc0zhfI*sCQ}30S~K3"> <field name="NUM">0</field> </block> </value> <next> <block type="control" id=":]XKy3rOPI/%cnTu~I`p"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G2A0P308805402P0.Commands.speak</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="{71M(F^o$11*;ec?{Bk["> <field name="TEXT">Schiebetür rechts bitte schliessen</field> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="debug" id="CP|Y4vz!nVUkC!|nRE~x"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="nDh44}+U+nl9(5tFakWp"> <field name="TEXT">Tür rechts geschlossen</field> </shadow> </value> <next> <block type="debug" id="0@;=8aOHF5jaW[`u[^C?"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="Qr:5T-,S[OHD(2Y?rJjU"> <field name="TEXT">Schiebetür rechts geändert</field> </shadow> <block type="text_join" id="]IK,4;Q9NFhg1fU`8E,/"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="y_Ut=yx36)%coq~W}*$z"> <field name="TEXT">Zustand Tür rechts </field> </block> </value> <value name="ADD1"> <block type="on_source" id=",ytR|dBenFMgC[cMkk8}"> <field name="ATTR">state.val</field> </block> </value> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> <block type="logic_boolean" id="ir+anz-0_EgNN]Rfr_Bq" x="-696" y="-3223"> <field name="BOOL">TRUE</field> </block> </xml>
-
@axel Kommen alle Debug-Meldungen dreimal, oder nur die aus dem grünen Block, und die entsprechend Richtige von darüber nicht?
-
javascript.0 2023-11-24 12:57:36.549 info script.js.common.Meldungen.Test: Schiebetür rechts offen javascript.0 2023-11-24 12:57:22.266 info script.js.common.Meldungen.Test: Schiebetür rechts offen javascript.0 2023-11-24 12:56:36.549 info script.js.common.Meldungen.Test: Schiebetür rechts offen javascript.0 2023-11-24 12:56:36.543 info script.js.common.Meldungen.Test: Zustand Tür rechts 0 javascript.0 2023-11-24 12:56:36.543 info script.js.common.Meldungen.Test: Tür rechts geschlossen javascript.0 2023-11-24 12:56:36.542 info script.js.common.Meldungen.Test: Aussentemperatur 4 javascript.0 2023-11-24 12:56:36.542 info script.js.common.Meldungen.Test: Zustand Tür rechts 0 javascript.0 2023-11-24 12:56:22.264 info script.js.common.Meldungen.Test: Schiebetür rechts offen javascript.0 2023-11-24 12:55:36.549 info script.js.common.Meldungen.Test: Schiebetür rechts offen javascript.0 2023-11-24 12:55:36.549 info script.js.common.Meldungen.Test: Aussentemperatur 4 javascript.0 2023-11-24 12:55:36.548 info script.js.common.Meldungen.Test: Zustand Tür rechts 1 javascript.0 2023-11-24 12:55:28.211 info script.js.common.Meldungen.Test: Zustand Tür rechts 0 javascript.0 2023-11-24 12:55:28.211 info script.js.common.Meldungen.Test: Tür rechts geschlossen javascript.0 2023-11-24 12:55:28.211 info script.js.common.Meldungen.Test: Aussentemperatur 4 javascript.0 2023-11-24 12:55:28.211 info script.js.common.Meldungen.Test: Zustand Tür rechts 0 javascript.0 2023-11-24 12:55:22.263 info script.js.common.Meldungen.Test: Schiebetür rechts offen javascript.0 2023-11-24 12:55:22.263 info script.js.common.Meldungen.Test: Aussentemperatur 4 javascript.0 2023-11-24 12:55:22.263 info script.js.common.Meldungen.Test: Zustand Tür rechts 1
-
@martinp passt nicht genau. Werde neue Meldungen erstellen, dauert etwas.
-
@axel
Anstelle der Schleife verwende besser ein Intervall, das beim Schließen der Tür gestoppt wird. -
@paul53 ok, probiere ich mal. Logik ist klar, Mehrfachaufrufe werden unterbrochen... Danke.
-
@paul53 Funktioniert. Danke. Bei mir sieht das dann so aus:
-
Wenn das tatsächlich Dein aktueller Stand ist, bekommst Du kurz- bis mittelfristig noch ganz andere Probleme.
-
@samson71 Danke für den Hinweis. Ist alles aktualisiert. Den Header kopiere ich immer aus früheren Beiträgen. Ich halte immer alles aktuell. Aber nochmal Danke für den Hinweis, werde auch den Text künfig aktualisieren.
-
@axel sagte: Bei mir sieht das dann so aus:
Wozu soll die Pause gut sein?
-
@paul53 Du hast recht, die muss raus. Ist ein überbleibsel aus der Schleife von vorhin.