- ioBroker Community Home
- Deutsch
- Skripten / Logik
- Blockly
- Steuerung WLAN Lampe mit BWM und Alexa
Steuerung WLAN Lampe mit BWM und Alexa
-
@smarthome2020 sagte: Oder liege ich da falsch?
Wenn die Lampe durch das Skript eingeschaltet wird, muss der erste Logeintrag mit Quelle = Javascript sein, worauf der Sonoff-Adapter erst reagiert. Bei Dir weiß der Adapter schon ca. 60 ms vorher, dass eingeschaltet werden soll.
@paul53 sagte in Steuerung WLAN Lampe mit BWM und Alexa:
@smarthome2020 sagte: Oder liege ich da falsch?
Wenn die Lampe durch das Skript eingeschaltet wird, muss der erste Logeintrag mit Quelle = Javascript sein, worauf der Sonoff-Adapter erst reagiert. Bei Dir weiß der Adapter schon ca. 60 ms vorher, dass eingeschaltet werden soll.
Skurril. Mein System kann also in die Zukunft schauen?
Also es läuft nur das eine Skript. Wenn ich es ausschalte, geht die Lampe auch nicht an.
Was also kann ich nun tun? -
@paul53 sagte in Steuerung WLAN Lampe mit BWM und Alexa:
@smarthome2020 sagte: Oder liege ich da falsch?
Wenn die Lampe durch das Skript eingeschaltet wird, muss der erste Logeintrag mit Quelle = Javascript sein, worauf der Sonoff-Adapter erst reagiert. Bei Dir weiß der Adapter schon ca. 60 ms vorher, dass eingeschaltet werden soll.
Skurril. Mein System kann also in die Zukunft schauen?
Also es läuft nur das eine Skript. Wenn ich es ausschalte, geht die Lampe auch nicht an.
Was also kann ich nun tun?@smarthome2020 sagte: Was also kann ich nun tun?
Keine Ahnung, da bin ich mit meinem Latein am Ende.
Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs -
@smarthome2020 sagte: Was also kann ich nun tun?
Keine Ahnung, da bin ich mit meinem Latein am Ende.
14:26:42.182 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: true, bestätigt: false, Quelle: system.adapter.javascript.0Der Eintrag bedeutet:
Lampe ist anBefehl oder Aktualisierung:
wurde nicht erteilt
--> aus Quelle: system.adapter.javascript.0oder?
-
14:26:42.182 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: true, bestätigt: false, Quelle: system.adapter.javascript.0Der Eintrag bedeutet:
Lampe ist anBefehl oder Aktualisierung:
wurde nicht erteilt
--> aus Quelle: system.adapter.javascript.0oder?
@smarthome2020 sagte: Der Eintrag bedeutet:
Lampe ist an
aus Quelle: system.adapter.javascript.0Ja, und ack = false, also Befehl.
Aber die Lampe war bereits an, weshalb der untere Trigger "auf Änderung" nicht mehr reagiert.
Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs -
@smarthome2020 sagte: Der Eintrag bedeutet:
Lampe ist an
aus Quelle: system.adapter.javascript.0Ja, und ack = false, also Befehl.
Aber die Lampe war bereits an, weshalb der untere Trigger "auf Änderung" nicht mehr reagiert.
Also finde ich alles sehr komisch. Hab gerade nochmal geschaut. Es läuft kein anderes Skript mehr.
Wie das so sein kann, weiß ich nicht.Es ging halt damals alles, als der Thread entstanden ist. Und zwar einwandfrei.
Im Verlauf ging es dann aber auf einmal nicht mehr. Geändert hatte ich nichts. -
Also finde ich alles sehr komisch. Hab gerade nochmal geschaut. Es läuft kein anderes Skript mehr.
Wie das so sein kann, weiß ich nicht.Es ging halt damals alles, als der Thread entstanden ist. Und zwar einwandfrei.
Im Verlauf ging es dann aber auf einmal nicht mehr. Geändert hatte ich nichts.@smarthome2020 sagte: Geändert hatte ich nichts.
Irgend etwas muss sich geändert haben.
Versuche es mal mit "wurde aktualisiert" und Verzögerung:

<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</variable> <variable type="timeout" id="Timer">Timer</variable> <variable id="9U;#;v9^5RiyC(|[ql^J">sperre</variable> <variable type="timeout" id="timeout">timeout</variable> </variables> <block type="on_ext" id="*+LWvR9x0(v4w60=to?1" x="138" 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="#0Pe?QmkrwGg;@a)yTBh"> <field name="oid">zigbee.0.00158d00047b9993.occupancy</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="Tp1k`tjdQjZard`)iZEp"> <value name="IF0"> <block type="logic_negate" id="j4MgM)}nn]hu{(Db[|d)"> <value name="BOOL"> <block type="variables_get" id="5f$){THuc4/Eb9k-q{gF"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> </block> </value> </block> </value> <statement name="DO0"> <block type="controls_if" id="lNu~B^QbjXmM(vE)5(;+"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="GI(yPzZ$4s.)eqe~{GhR"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="UBp2f8jER$h~~WOVohp-"> <field name="NAME">Timer</field> <next> <block type="control" id="0rkfos]M(Iz9yOiOJ2]-"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.Dimmer</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="Y~QCC3q4.#;5@`KV8TH`"> <field name="NUM">60</field> </block> </value> <next> <block type="control" id="mlKt=@ZHH9C$twZog5M@"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.POWER</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">100</field> <field name="UNIT">ms</field> <field name="CLEAR_RUNNING">TRUE</field> <value name="VALUE"> <block type="logic_boolean" id="dNH7K{%E,s;r7f=GM_n/"> <field name="BOOL">TRUE</field> </block> </value> </block> </next> </block> </next> </block> </statement> <statement name="ELSE"> <block type="timeouts_settimeout" id="o=wP0PZM]mCAg8sUou?O"> <field name="NAME">Timer</field> <field name="DELAY">15</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="control" id="Zm$7J4:?m1v:cRULh@7y"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.POWER</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="q,}[{Vs4sT7^i|ZUFIsk"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> </block> </statement> </block> </statement> </block> </statement> <next> <block type="on_ext" id="wX1WJnlnjny^_[e:7nen"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id=",U-sYv_4R!-e3dX8x_Bt"> <field name="oid">sonoff.0.Kinderzimmerlampe.POWER</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="o$C)KB=il6xv,F(ervF9"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="@oNqJ:3:`!p6cL3bONY~"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="controls_if" id=";6vsXSD{(ALi`!4o5n,T"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_compare" id="niC]_crc_4`]d2qdbKY`"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="G4cYNnn6W*bI^f-zlnNk"> <field name="ATTR">state.from</field> </block> </value> <value name="B"> <block type="text" id="cy^(;3Aa,1gooWK}I_q-"> <field name="TEXT">system.adapter.javascript.0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="6?Dy!-?SqNrN$FAzHC#r"> <field name="NAME">timeout</field> </block> </statement> <value name="IF1"> <block type="logic_negate" id="zMFLfxuUL-PX?(;R:bUX"> <value name="BOOL"> <block type="variables_get" id="xtcFx63g`mqCNvir9V5D"> <field name="VAR" id="9U;#;v9^5RiyC(|[ql^J">sperre</field> </block> </value> </block> </value> <statement name="DO1"> <block type="variables_set" id="bl8D:wJR;i7VcD:+ha7w"> <field name="VAR" id="9U;#;v9^5RiyC(|[ql^J">sperre</field> <value name="VALUE"> <block type="logic_boolean" id="~L^do$PuS4Fq6VIL+c=h"> <field name="BOOL">TRUE</field> </block> </value> <next> <block type="timeouts_settimeout" id="^FYtV({%+Q03;uE@A^8_"> <field name="NAME">timeout</field> <field name="DELAY">100</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="8oi6M;,Ms8vX(@Savk/u"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> <value name="VALUE"> <block type="logic_boolean" id=",ut1I0/Q=F#gKM*@=j`q"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> </block> </next> </block> </statement> </block> </statement> <statement name="ELSE"> <block type="variables_set" id="(0TmLV~o6x;z5/mzVV#P"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> <value name="VALUE"> <block type="logic_boolean" id="#w+v-Gtx}MJnS*4v#J)u"> <field name="BOOL">FALSE</field> </block> </value> <next> <block type="variables_set" id="ZHkTO+B%PEujHe3Aj)$;"> <field name="VAR" id="9U;#;v9^5RiyC(|[ql^J">sperre</field> <value name="VALUE"> <block type="logic_boolean" id="qszga(O0$6j^g/O7tGy!"> <field name="BOOL">FALSE</field> </block> </value> </block> </next> </block> </statement> </block> </statement> <next> <block type="on_ext" id="pmaHi#^+HC1CpObIjp_]"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="cQ;mnb$$IeoSEIoQCVzU"> <field name="oid">sonoff.0.Kinderzimmerlampe.POWER</field> </shadow> </value> <statement name="STATEMENT"> <block type="debug" id="?*[#%ev=0dk;?{hHM;BE"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="=%iyyg|9YIgwYwX@J{m*"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="r?#.g0F0-3J2.Jm.viEA"> <mutation items="6"></mutation> <value name="ADD0"> <block type="text" id="nSK!os%Y_q01Ild=FJ}E"> <field name="TEXT">Lampe ein: </field> </block> </value> <value name="ADD1"> <block type="on_source" id="|0m8F4.)5bcLeql`ew-M"> <field name="ATTR">state.val</field> </block> </value> <value name="ADD2"> <block type="text" id="phz=TXZef4!Dko8n=G!j"> <field name="TEXT">, bestätigt: </field> </block> </value> <value name="ADD3"> <block type="on_source" id="?)3?GVa~=_`UT6j6.Lm9"> <field name="ATTR">state.ack</field> </block> </value> <value name="ADD4"> <block type="text" id="Es.W2Onvi60Yjn#jEc57"> <field name="TEXT">, Quelle: </field> </block> </value> <value name="ADD5"> <block type="on_source" id="f:fC_mmIa%6noJp]Qd=("> <field name="ATTR">state.from</field> </block> </value> </block> </value> </block> </statement> </block> </next> </block> </next> </block> </xml>Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs -
Also finde ich alles sehr komisch. Hab gerade nochmal geschaut. Es läuft kein anderes Skript mehr.
Wie das so sein kann, weiß ich nicht.Es ging halt damals alles, als der Thread entstanden ist. Und zwar einwandfrei.
Im Verlauf ging es dann aber auf einmal nicht mehr. Geändert hatte ich nichts.@smarthome2020
Mit einer zusätzlichen Verzögerung sollte sich auch erreichen lassen, dass man mit Alexa nachträglich das Ausschalten verhindern kann.
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</variable> <variable type="timeout" id="Timer">Timer</variable> <variable type="timeout" id="timeout">timeout</variable> <variable type="timeout" id="sperre">sperre</variable> </variables> <block type="on_ext" id="*+LWvR9x0(v4w60=to?1" x="138" 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="#0Pe?QmkrwGg;@a)yTBh"> <field name="oid">zigbee.0.00158d00047b9993.occupancy</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="Tp1k`tjdQjZard`)iZEp"> <value name="IF0"> <block type="logic_negate" id="j4MgM)}nn]hu{(Db[|d)"> <value name="BOOL"> <block type="variables_get" id="5f$){THuc4/Eb9k-q{gF"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> </block> </value> </block> </value> <statement name="DO0"> <block type="controls_if" id="lNu~B^QbjXmM(vE)5(;+"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="GI(yPzZ$4s.)eqe~{GhR"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="UBp2f8jER$h~~WOVohp-"> <field name="NAME">Timer</field> <next> <block type="control" id="0rkfos]M(Iz9yOiOJ2]-"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.Dimmer</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="Y~QCC3q4.#;5@`KV8TH`"> <field name="NUM">60</field> </block> </value> <next> <block type="control" id="mlKt=@ZHH9C$twZog5M@"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.POWER</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">100</field> <field name="UNIT">ms</field> <field name="CLEAR_RUNNING">TRUE</field> <value name="VALUE"> <block type="logic_boolean" id="dNH7K{%E,s;r7f=GM_n/"> <field name="BOOL">TRUE</field> </block> </value> </block> </next> </block> </next> </block> </statement> <statement name="ELSE"> <block type="timeouts_settimeout" id="o=wP0PZM]mCAg8sUou?O"> <field name="NAME">Timer</field> <field name="DELAY">15</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="control" id="Zm$7J4:?m1v:cRULh@7y"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.POWER</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="q,}[{Vs4sT7^i|ZUFIsk"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> </block> </statement> </block> </statement> </block> </statement> <next> <block type="on_ext" id="wX1WJnlnjny^_[e:7nen"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id=",U-sYv_4R!-e3dX8x_Bt"> <field name="oid">sonoff.0.Kinderzimmerlampe.POWER</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="o$C)KB=il6xv,F(ervF9"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="@oNqJ:3:`!p6cL3bONY~"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="controls_if" id=";6vsXSD{(ALi`!4o5n,T"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_compare" id="niC]_crc_4`]d2qdbKY`"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="G4cYNnn6W*bI^f-zlnNk"> <field name="ATTR">state.from</field> </block> </value> <value name="B"> <block type="text" id="cy^(;3Aa,1gooWK}I_q-"> <field name="TEXT">system.adapter.javascript.0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="6?Dy!-?SqNrN$FAzHC#r"> <field name="NAME">timeout</field> </block> </statement> <value name="IF1"> <block type="logic_negate" id="zMFLfxuUL-PX?(;R:bUX"> <value name="BOOL"> <block type="variables_get" id="xtcFx63g`mqCNvir9V5D"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> </block> </value> </block> </value> <statement name="DO1"> <block type="timeouts_settimeout" id="^FYtV({%+Q03;uE@A^8_"> <field name="NAME">timeout</field> <field name="DELAY">150</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="8oi6M;,Ms8vX(@Savk/u"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> <value name="VALUE"> <block type="logic_boolean" id=",ut1I0/Q=F#gKM*@=j`q"> <field name="BOOL">TRUE</field> </block> </value> <next> <block type="timeouts_cleartimeout" id="XlRhaV;z0T8A6`_?r-V."> <field name="NAME">Timer</field> </block> </next> </block> </statement> </block> </statement> <next> <block type="controls_if" id="mYuFsDl5([p8enIRJdaW"> <value name="IF0"> <block type="logic_negate" id="6pAlh;.}.wrIo(7o2bce"> <value name="BOOL"> <block type="variables_get" id=";vfD/RPB=C)e_[|lIx{/"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_settimeout" id="@)DCOI1Sk3o3#n-G,O;z"> <field name="NAME">sperre</field> <field name="DELAY">300</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="ZHkTO+B%PEujHe3Aj)$;"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> <value name="VALUE"> <block type="logic_null" id="_A;q}fUmhB??ry%!Hl_K"></block> </value> </block> </statement> </block> </statement> </block> </next> </block> </statement> <statement name="ELSE"> <block type="variables_set" id="(0TmLV~o6x;z5/mzVV#P"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> <value name="VALUE"> <block type="logic_boolean" id="#w+v-Gtx}MJnS*4v#J)u"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> <next> <block type="debug" id="?*[#%ev=0dk;?{hHM;BE"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="=%iyyg|9YIgwYwX@J{m*"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="r?#.g0F0-3J2.Jm.viEA"> <mutation items="6"></mutation> <value name="ADD0"> <block type="text" id="nSK!os%Y_q01Ild=FJ}E"> <field name="TEXT">Lampe ein: </field> </block> </value> <value name="ADD1"> <block type="on_source" id="|0m8F4.)5bcLeql`ew-M"> <field name="ATTR">state.val</field> </block> </value> <value name="ADD2"> <block type="text" id="phz=TXZef4!Dko8n=G!j"> <field name="TEXT">, bestätigt: </field> </block> </value> <value name="ADD3"> <block type="on_source" id="?)3?GVa~=_`UT6j6.Lm9"> <field name="ATTR">state.ack</field> </block> </value> <value name="ADD4"> <block type="text" id="Es.W2Onvi60Yjn#jEc57"> <field name="TEXT">, Quelle: </field> </block> </value> <value name="ADD5"> <block type="on_source" id="f:fC_mmIa%6noJp]Qd=("> <field name="ATTR">state.from</field> </block> </value> </block> </value> </block> </next> </block> </statement> </block> </next> </block> </xml>Anmerkung: Das beobachtete Verhalten kann ich mir nur dadurch erklären, dass der BWM direkt mit der Lampe kommuniziert - es ist ja beides Zigbee?
Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs -
@smarthome2020
Mit einer zusätzlichen Verzögerung sollte sich auch erreichen lassen, dass man mit Alexa nachträglich das Ausschalten verhindern kann.
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</variable> <variable type="timeout" id="Timer">Timer</variable> <variable type="timeout" id="timeout">timeout</variable> <variable type="timeout" id="sperre">sperre</variable> </variables> <block type="on_ext" id="*+LWvR9x0(v4w60=to?1" x="138" 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="#0Pe?QmkrwGg;@a)yTBh"> <field name="oid">zigbee.0.00158d00047b9993.occupancy</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="Tp1k`tjdQjZard`)iZEp"> <value name="IF0"> <block type="logic_negate" id="j4MgM)}nn]hu{(Db[|d)"> <value name="BOOL"> <block type="variables_get" id="5f$){THuc4/Eb9k-q{gF"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> </block> </value> </block> </value> <statement name="DO0"> <block type="controls_if" id="lNu~B^QbjXmM(vE)5(;+"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="GI(yPzZ$4s.)eqe~{GhR"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="UBp2f8jER$h~~WOVohp-"> <field name="NAME">Timer</field> <next> <block type="control" id="0rkfos]M(Iz9yOiOJ2]-"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.Dimmer</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="Y~QCC3q4.#;5@`KV8TH`"> <field name="NUM">60</field> </block> </value> <next> <block type="control" id="mlKt=@ZHH9C$twZog5M@"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.POWER</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">100</field> <field name="UNIT">ms</field> <field name="CLEAR_RUNNING">TRUE</field> <value name="VALUE"> <block type="logic_boolean" id="dNH7K{%E,s;r7f=GM_n/"> <field name="BOOL">TRUE</field> </block> </value> </block> </next> </block> </next> </block> </statement> <statement name="ELSE"> <block type="timeouts_settimeout" id="o=wP0PZM]mCAg8sUou?O"> <field name="NAME">Timer</field> <field name="DELAY">15</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="control" id="Zm$7J4:?m1v:cRULh@7y"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.POWER</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="q,}[{Vs4sT7^i|ZUFIsk"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> </block> </statement> </block> </statement> </block> </statement> <next> <block type="on_ext" id="wX1WJnlnjny^_[e:7nen"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id=",U-sYv_4R!-e3dX8x_Bt"> <field name="oid">sonoff.0.Kinderzimmerlampe.POWER</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="o$C)KB=il6xv,F(ervF9"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="@oNqJ:3:`!p6cL3bONY~"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="controls_if" id=";6vsXSD{(ALi`!4o5n,T"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_compare" id="niC]_crc_4`]d2qdbKY`"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="G4cYNnn6W*bI^f-zlnNk"> <field name="ATTR">state.from</field> </block> </value> <value name="B"> <block type="text" id="cy^(;3Aa,1gooWK}I_q-"> <field name="TEXT">system.adapter.javascript.0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="6?Dy!-?SqNrN$FAzHC#r"> <field name="NAME">timeout</field> </block> </statement> <value name="IF1"> <block type="logic_negate" id="zMFLfxuUL-PX?(;R:bUX"> <value name="BOOL"> <block type="variables_get" id="xtcFx63g`mqCNvir9V5D"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> </block> </value> </block> </value> <statement name="DO1"> <block type="timeouts_settimeout" id="^FYtV({%+Q03;uE@A^8_"> <field name="NAME">timeout</field> <field name="DELAY">150</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="8oi6M;,Ms8vX(@Savk/u"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> <value name="VALUE"> <block type="logic_boolean" id=",ut1I0/Q=F#gKM*@=j`q"> <field name="BOOL">TRUE</field> </block> </value> <next> <block type="timeouts_cleartimeout" id="XlRhaV;z0T8A6`_?r-V."> <field name="NAME">Timer</field> </block> </next> </block> </statement> </block> </statement> <next> <block type="controls_if" id="mYuFsDl5([p8enIRJdaW"> <value name="IF0"> <block type="logic_negate" id="6pAlh;.}.wrIo(7o2bce"> <value name="BOOL"> <block type="variables_get" id=";vfD/RPB=C)e_[|lIx{/"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_settimeout" id="@)DCOI1Sk3o3#n-G,O;z"> <field name="NAME">sperre</field> <field name="DELAY">300</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="ZHkTO+B%PEujHe3Aj)$;"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> <value name="VALUE"> <block type="logic_null" id="_A;q}fUmhB??ry%!Hl_K"></block> </value> </block> </statement> </block> </statement> </block> </next> </block> </statement> <statement name="ELSE"> <block type="variables_set" id="(0TmLV~o6x;z5/mzVV#P"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> <value name="VALUE"> <block type="logic_boolean" id="#w+v-Gtx}MJnS*4v#J)u"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> <next> <block type="debug" id="?*[#%ev=0dk;?{hHM;BE"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="=%iyyg|9YIgwYwX@J{m*"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="r?#.g0F0-3J2.Jm.viEA"> <mutation items="6"></mutation> <value name="ADD0"> <block type="text" id="nSK!os%Y_q01Ild=FJ}E"> <field name="TEXT">Lampe ein: </field> </block> </value> <value name="ADD1"> <block type="on_source" id="|0m8F4.)5bcLeql`ew-M"> <field name="ATTR">state.val</field> </block> </value> <value name="ADD2"> <block type="text" id="phz=TXZef4!Dko8n=G!j"> <field name="TEXT">, bestätigt: </field> </block> </value> <value name="ADD3"> <block type="on_source" id="?)3?GVa~=_`UT6j6.Lm9"> <field name="ATTR">state.ack</field> </block> </value> <value name="ADD4"> <block type="text" id="Es.W2Onvi60Yjn#jEc57"> <field name="TEXT">, Quelle: </field> </block> </value> <value name="ADD5"> <block type="on_source" id="f:fC_mmIa%6noJp]Qd=("> <field name="ATTR">state.from</field> </block> </value> </block> </value> </block> </next> </block> </statement> </block> </next> </block> </xml>Anmerkung: Das beobachtete Verhalten kann ich mir nur dadurch erklären, dass der BWM direkt mit der Lampe kommuniziert - es ist ja beides Zigbee?
@paul53
Also die Lampe ist WLAN und der BWM ist Zigbee . Da ist keine Kopplung vorhanden wie es zB bei den Ikea Geräten mit Zigbee möglich wäre. Deswegen bin ich da auch ahnungslos, warum die Lampe vor dem Script geschaltet wird ….
Ich probiere das von dir zur Verfügung gestellte Script morgen mal aus .
Vielen Dank schon einmal für deine Mühen. -
@smarthome2020
Mit einer zusätzlichen Verzögerung sollte sich auch erreichen lassen, dass man mit Alexa nachträglich das Ausschalten verhindern kann.
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</variable> <variable type="timeout" id="Timer">Timer</variable> <variable type="timeout" id="timeout">timeout</variable> <variable type="timeout" id="sperre">sperre</variable> </variables> <block type="on_ext" id="*+LWvR9x0(v4w60=to?1" x="138" 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="#0Pe?QmkrwGg;@a)yTBh"> <field name="oid">zigbee.0.00158d00047b9993.occupancy</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="Tp1k`tjdQjZard`)iZEp"> <value name="IF0"> <block type="logic_negate" id="j4MgM)}nn]hu{(Db[|d)"> <value name="BOOL"> <block type="variables_get" id="5f$){THuc4/Eb9k-q{gF"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> </block> </value> </block> </value> <statement name="DO0"> <block type="controls_if" id="lNu~B^QbjXmM(vE)5(;+"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="GI(yPzZ$4s.)eqe~{GhR"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="UBp2f8jER$h~~WOVohp-"> <field name="NAME">Timer</field> <next> <block type="control" id="0rkfos]M(Iz9yOiOJ2]-"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.Dimmer</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="Y~QCC3q4.#;5@`KV8TH`"> <field name="NUM">60</field> </block> </value> <next> <block type="control" id="mlKt=@ZHH9C$twZog5M@"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.POWER</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">100</field> <field name="UNIT">ms</field> <field name="CLEAR_RUNNING">TRUE</field> <value name="VALUE"> <block type="logic_boolean" id="dNH7K{%E,s;r7f=GM_n/"> <field name="BOOL">TRUE</field> </block> </value> </block> </next> </block> </next> </block> </statement> <statement name="ELSE"> <block type="timeouts_settimeout" id="o=wP0PZM]mCAg8sUou?O"> <field name="NAME">Timer</field> <field name="DELAY">15</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="control" id="Zm$7J4:?m1v:cRULh@7y"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.POWER</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="q,}[{Vs4sT7^i|ZUFIsk"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> </block> </statement> </block> </statement> </block> </statement> <next> <block type="on_ext" id="wX1WJnlnjny^_[e:7nen"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id=",U-sYv_4R!-e3dX8x_Bt"> <field name="oid">sonoff.0.Kinderzimmerlampe.POWER</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="o$C)KB=il6xv,F(ervF9"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="@oNqJ:3:`!p6cL3bONY~"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="controls_if" id=";6vsXSD{(ALi`!4o5n,T"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_compare" id="niC]_crc_4`]d2qdbKY`"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="G4cYNnn6W*bI^f-zlnNk"> <field name="ATTR">state.from</field> </block> </value> <value name="B"> <block type="text" id="cy^(;3Aa,1gooWK}I_q-"> <field name="TEXT">system.adapter.javascript.0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="6?Dy!-?SqNrN$FAzHC#r"> <field name="NAME">timeout</field> </block> </statement> <value name="IF1"> <block type="logic_negate" id="zMFLfxuUL-PX?(;R:bUX"> <value name="BOOL"> <block type="variables_get" id="xtcFx63g`mqCNvir9V5D"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> </block> </value> </block> </value> <statement name="DO1"> <block type="timeouts_settimeout" id="^FYtV({%+Q03;uE@A^8_"> <field name="NAME">timeout</field> <field name="DELAY">150</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="8oi6M;,Ms8vX(@Savk/u"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> <value name="VALUE"> <block type="logic_boolean" id=",ut1I0/Q=F#gKM*@=j`q"> <field name="BOOL">TRUE</field> </block> </value> <next> <block type="timeouts_cleartimeout" id="XlRhaV;z0T8A6`_?r-V."> <field name="NAME">Timer</field> </block> </next> </block> </statement> </block> </statement> <next> <block type="controls_if" id="mYuFsDl5([p8enIRJdaW"> <value name="IF0"> <block type="logic_negate" id="6pAlh;.}.wrIo(7o2bce"> <value name="BOOL"> <block type="variables_get" id=";vfD/RPB=C)e_[|lIx{/"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_settimeout" id="@)DCOI1Sk3o3#n-G,O;z"> <field name="NAME">sperre</field> <field name="DELAY">300</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="ZHkTO+B%PEujHe3Aj)$;"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> <value name="VALUE"> <block type="logic_null" id="_A;q}fUmhB??ry%!Hl_K"></block> </value> </block> </statement> </block> </statement> </block> </next> </block> </statement> <statement name="ELSE"> <block type="variables_set" id="(0TmLV~o6x;z5/mzVV#P"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> <value name="VALUE"> <block type="logic_boolean" id="#w+v-Gtx}MJnS*4v#J)u"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> <next> <block type="debug" id="?*[#%ev=0dk;?{hHM;BE"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="=%iyyg|9YIgwYwX@J{m*"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="r?#.g0F0-3J2.Jm.viEA"> <mutation items="6"></mutation> <value name="ADD0"> <block type="text" id="nSK!os%Y_q01Ild=FJ}E"> <field name="TEXT">Lampe ein: </field> </block> </value> <value name="ADD1"> <block type="on_source" id="|0m8F4.)5bcLeql`ew-M"> <field name="ATTR">state.val</field> </block> </value> <value name="ADD2"> <block type="text" id="phz=TXZef4!Dko8n=G!j"> <field name="TEXT">, bestätigt: </field> </block> </value> <value name="ADD3"> <block type="on_source" id="?)3?GVa~=_`UT6j6.Lm9"> <field name="ATTR">state.ack</field> </block> </value> <value name="ADD4"> <block type="text" id="Es.W2Onvi60Yjn#jEc57"> <field name="TEXT">, Quelle: </field> </block> </value> <value name="ADD5"> <block type="on_source" id="f:fC_mmIa%6noJp]Qd=("> <field name="ATTR">state.from</field> </block> </value> </block> </value> </block> </next> </block> </statement> </block> </next> </block> </xml>Anmerkung: Das beobachtete Verhalten kann ich mir nur dadurch erklären, dass der BWM direkt mit der Lampe kommuniziert - es ist ja beides Zigbee?
@paul53 sagte in Steuerung WLAN Lampe mit BWM und Alexa:
@smarthome2020
Mit einer zusätzlichen Verzögerung sollte sich auch erreichen lassen, dass man mit Alexa nachträglich das Ausschalten verhindern kann.
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</variable> <variable type="timeout" id="Timer">Timer</variable> <variable type="timeout" id="timeout">timeout</variable> <variable type="timeout" id="sperre">sperre</variable> </variables> <block type="on_ext" id="*+LWvR9x0(v4w60=to?1" x="138" 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="#0Pe?QmkrwGg;@a)yTBh"> <field name="oid">zigbee.0.00158d00047b9993.occupancy</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="Tp1k`tjdQjZard`)iZEp"> <value name="IF0"> <block type="logic_negate" id="j4MgM)}nn]hu{(Db[|d)"> <value name="BOOL"> <block type="variables_get" id="5f$){THuc4/Eb9k-q{gF"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> </block> </value> </block> </value> <statement name="DO0"> <block type="controls_if" id="lNu~B^QbjXmM(vE)5(;+"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="GI(yPzZ$4s.)eqe~{GhR"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="UBp2f8jER$h~~WOVohp-"> <field name="NAME">Timer</field> <next> <block type="control" id="0rkfos]M(Iz9yOiOJ2]-"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.Dimmer</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="Y~QCC3q4.#;5@`KV8TH`"> <field name="NUM">60</field> </block> </value> <next> <block type="control" id="mlKt=@ZHH9C$twZog5M@"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.POWER</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">100</field> <field name="UNIT">ms</field> <field name="CLEAR_RUNNING">TRUE</field> <value name="VALUE"> <block type="logic_boolean" id="dNH7K{%E,s;r7f=GM_n/"> <field name="BOOL">TRUE</field> </block> </value> </block> </next> </block> </next> </block> </statement> <statement name="ELSE"> <block type="timeouts_settimeout" id="o=wP0PZM]mCAg8sUou?O"> <field name="NAME">Timer</field> <field name="DELAY">15</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="control" id="Zm$7J4:?m1v:cRULh@7y"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.POWER</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="q,}[{Vs4sT7^i|ZUFIsk"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> </block> </statement> </block> </statement> </block> </statement> <next> <block type="on_ext" id="wX1WJnlnjny^_[e:7nen"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id=",U-sYv_4R!-e3dX8x_Bt"> <field name="oid">sonoff.0.Kinderzimmerlampe.POWER</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="o$C)KB=il6xv,F(ervF9"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="@oNqJ:3:`!p6cL3bONY~"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="controls_if" id=";6vsXSD{(ALi`!4o5n,T"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_compare" id="niC]_crc_4`]d2qdbKY`"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="G4cYNnn6W*bI^f-zlnNk"> <field name="ATTR">state.from</field> </block> </value> <value name="B"> <block type="text" id="cy^(;3Aa,1gooWK}I_q-"> <field name="TEXT">system.adapter.javascript.0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="6?Dy!-?SqNrN$FAzHC#r"> <field name="NAME">timeout</field> </block> </statement> <value name="IF1"> <block type="logic_negate" id="zMFLfxuUL-PX?(;R:bUX"> <value name="BOOL"> <block type="variables_get" id="xtcFx63g`mqCNvir9V5D"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> </block> </value> </block> </value> <statement name="DO1"> <block type="timeouts_settimeout" id="^FYtV({%+Q03;uE@A^8_"> <field name="NAME">timeout</field> <field name="DELAY">150</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="8oi6M;,Ms8vX(@Savk/u"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> <value name="VALUE"> <block type="logic_boolean" id=",ut1I0/Q=F#gKM*@=j`q"> <field name="BOOL">TRUE</field> </block> </value> <next> <block type="timeouts_cleartimeout" id="XlRhaV;z0T8A6`_?r-V."> <field name="NAME">Timer</field> </block> </next> </block> </statement> </block> </statement> <next> <block type="controls_if" id="mYuFsDl5([p8enIRJdaW"> <value name="IF0"> <block type="logic_negate" id="6pAlh;.}.wrIo(7o2bce"> <value name="BOOL"> <block type="variables_get" id=";vfD/RPB=C)e_[|lIx{/"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_settimeout" id="@)DCOI1Sk3o3#n-G,O;z"> <field name="NAME">sperre</field> <field name="DELAY">300</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="ZHkTO+B%PEujHe3Aj)$;"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> <value name="VALUE"> <block type="logic_null" id="_A;q}fUmhB??ry%!Hl_K"></block> </value> </block> </statement> </block> </statement> </block> </next> </block> </statement> <statement name="ELSE"> <block type="variables_set" id="(0TmLV~o6x;z5/mzVV#P"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> <value name="VALUE"> <block type="logic_boolean" id="#w+v-Gtx}MJnS*4v#J)u"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> <next> <block type="debug" id="?*[#%ev=0dk;?{hHM;BE"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="=%iyyg|9YIgwYwX@J{m*"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="r?#.g0F0-3J2.Jm.viEA"> <mutation items="6"></mutation> <value name="ADD0"> <block type="text" id="nSK!os%Y_q01Ild=FJ}E"> <field name="TEXT">Lampe ein: </field> </block> </value> <value name="ADD1"> <block type="on_source" id="|0m8F4.)5bcLeql`ew-M"> <field name="ATTR">state.val</field> </block> </value> <value name="ADD2"> <block type="text" id="phz=TXZef4!Dko8n=G!j"> <field name="TEXT">, bestätigt: </field> </block> </value> <value name="ADD3"> <block type="on_source" id="?)3?GVa~=_`UT6j6.Lm9"> <field name="ATTR">state.ack</field> </block> </value> <value name="ADD4"> <block type="text" id="Es.W2Onvi60Yjn#jEc57"> <field name="TEXT">, Quelle: </field> </block> </value> <value name="ADD5"> <block type="on_source" id="f:fC_mmIa%6noJp]Qd=("> <field name="ATTR">state.from</field> </block> </value> </block> </value> </block> </next> </block> </statement> </block> </next> </block> </xml>Anmerkung: Das beobachtete Verhalten kann ich mir nur dadurch erklären, dass der BWM direkt mit der Lampe kommuniziert - es ist ja beides Zigbee?
Einschalten durch BWM und ausschalten geht wieder:
12:39:07.122 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: true, bestätigt: false, Quelle: system.adapter.javascript.0 12:39:07.126 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: true, bestätigt: true, Quelle: system.adapter.sonoff.0 12:39:07.214 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: true, bestätigt: true, Quelle: system.adapter.sonoff.0 12:39:37.031 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: false, bestätigt: false, Quelle: system.adapter.javascript.0 12:39:37.058 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: false, bestätigt: true, Quelle: system.adapter.sonoff.0Ein- und Ausschalten durch Alexa ebenso:
12:41:12.364 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: true, bestätigt: true, Quelle: system.adapter.sonoff.0 12:41:46.140 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: false, bestätigt: true, Quelle: system.adapter.sonoff.0 -
@paul53 sagte in Steuerung WLAN Lampe mit BWM und Alexa:
@smarthome2020
Mit einer zusätzlichen Verzögerung sollte sich auch erreichen lassen, dass man mit Alexa nachträglich das Ausschalten verhindern kann.
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</variable> <variable type="timeout" id="Timer">Timer</variable> <variable type="timeout" id="timeout">timeout</variable> <variable type="timeout" id="sperre">sperre</variable> </variables> <block type="on_ext" id="*+LWvR9x0(v4w60=to?1" x="138" 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="#0Pe?QmkrwGg;@a)yTBh"> <field name="oid">zigbee.0.00158d00047b9993.occupancy</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="Tp1k`tjdQjZard`)iZEp"> <value name="IF0"> <block type="logic_negate" id="j4MgM)}nn]hu{(Db[|d)"> <value name="BOOL"> <block type="variables_get" id="5f$){THuc4/Eb9k-q{gF"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> </block> </value> </block> </value> <statement name="DO0"> <block type="controls_if" id="lNu~B^QbjXmM(vE)5(;+"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="GI(yPzZ$4s.)eqe~{GhR"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="UBp2f8jER$h~~WOVohp-"> <field name="NAME">Timer</field> <next> <block type="control" id="0rkfos]M(Iz9yOiOJ2]-"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.Dimmer</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="Y~QCC3q4.#;5@`KV8TH`"> <field name="NUM">60</field> </block> </value> <next> <block type="control" id="mlKt=@ZHH9C$twZog5M@"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="true"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.POWER</field> <field name="WITH_DELAY">TRUE</field> <field name="DELAY_MS">100</field> <field name="UNIT">ms</field> <field name="CLEAR_RUNNING">TRUE</field> <value name="VALUE"> <block type="logic_boolean" id="dNH7K{%E,s;r7f=GM_n/"> <field name="BOOL">TRUE</field> </block> </value> </block> </next> </block> </next> </block> </statement> <statement name="ELSE"> <block type="timeouts_settimeout" id="o=wP0PZM]mCAg8sUou?O"> <field name="NAME">Timer</field> <field name="DELAY">15</field> <field name="UNIT">sec</field> <statement name="STATEMENT"> <block type="control" id="Zm$7J4:?m1v:cRULh@7y"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">sonoff.0.Kinderzimmerlampe.POWER</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="logic_boolean" id="q,}[{Vs4sT7^i|ZUFIsk"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> </block> </statement> </block> </statement> </block> </statement> <next> <block type="on_ext" id="wX1WJnlnjny^_[e:7nen"> <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id=",U-sYv_4R!-e3dX8x_Bt"> <field name="oid">sonoff.0.Kinderzimmerlampe.POWER</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="o$C)KB=il6xv,F(ervF9"> <mutation else="1"></mutation> <value name="IF0"> <block type="on_source" id="@oNqJ:3:`!p6cL3bONY~"> <field name="ATTR">state.val</field> </block> </value> <statement name="DO0"> <block type="controls_if" id=";6vsXSD{(ALi`!4o5n,T"> <mutation elseif="1"></mutation> <value name="IF0"> <block type="logic_compare" id="niC]_crc_4`]d2qdbKY`"> <field name="OP">EQ</field> <value name="A"> <block type="on_source" id="G4cYNnn6W*bI^f-zlnNk"> <field name="ATTR">state.from</field> </block> </value> <value name="B"> <block type="text" id="cy^(;3Aa,1gooWK}I_q-"> <field name="TEXT">system.adapter.javascript.0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_cleartimeout" id="6?Dy!-?SqNrN$FAzHC#r"> <field name="NAME">timeout</field> </block> </statement> <value name="IF1"> <block type="logic_negate" id="zMFLfxuUL-PX?(;R:bUX"> <value name="BOOL"> <block type="variables_get" id="xtcFx63g`mqCNvir9V5D"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> </block> </value> </block> </value> <statement name="DO1"> <block type="timeouts_settimeout" id="^FYtV({%+Q03;uE@A^8_"> <field name="NAME">timeout</field> <field name="DELAY">150</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="8oi6M;,Ms8vX(@Savk/u"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> <value name="VALUE"> <block type="logic_boolean" id=",ut1I0/Q=F#gKM*@=j`q"> <field name="BOOL">TRUE</field> </block> </value> <next> <block type="timeouts_cleartimeout" id="XlRhaV;z0T8A6`_?r-V."> <field name="NAME">Timer</field> </block> </next> </block> </statement> </block> </statement> <next> <block type="controls_if" id="mYuFsDl5([p8enIRJdaW"> <value name="IF0"> <block type="logic_negate" id="6pAlh;.}.wrIo(7o2bce"> <value name="BOOL"> <block type="variables_get" id=";vfD/RPB=C)e_[|lIx{/"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_settimeout" id="@)DCOI1Sk3o3#n-G,O;z"> <field name="NAME">sperre</field> <field name="DELAY">300</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="ZHkTO+B%PEujHe3Aj)$;"> <field name="VAR" id="sperre" variabletype="timeout">sperre</field> <value name="VALUE"> <block type="logic_null" id="_A;q}fUmhB??ry%!Hl_K"></block> </value> </block> </statement> </block> </statement> </block> </next> </block> </statement> <statement name="ELSE"> <block type="variables_set" id="(0TmLV~o6x;z5/mzVV#P"> <field name="VAR" id="`F$W^to?v_+Mu_sf53:N">Lampe_manuell_eingeschaltet</field> <value name="VALUE"> <block type="logic_boolean" id="#w+v-Gtx}MJnS*4v#J)u"> <field name="BOOL">FALSE</field> </block> </value> </block> </statement> <next> <block type="debug" id="?*[#%ev=0dk;?{hHM;BE"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="=%iyyg|9YIgwYwX@J{m*"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="r?#.g0F0-3J2.Jm.viEA"> <mutation items="6"></mutation> <value name="ADD0"> <block type="text" id="nSK!os%Y_q01Ild=FJ}E"> <field name="TEXT">Lampe ein: </field> </block> </value> <value name="ADD1"> <block type="on_source" id="|0m8F4.)5bcLeql`ew-M"> <field name="ATTR">state.val</field> </block> </value> <value name="ADD2"> <block type="text" id="phz=TXZef4!Dko8n=G!j"> <field name="TEXT">, bestätigt: </field> </block> </value> <value name="ADD3"> <block type="on_source" id="?)3?GVa~=_`UT6j6.Lm9"> <field name="ATTR">state.ack</field> </block> </value> <value name="ADD4"> <block type="text" id="Es.W2Onvi60Yjn#jEc57"> <field name="TEXT">, Quelle: </field> </block> </value> <value name="ADD5"> <block type="on_source" id="f:fC_mmIa%6noJp]Qd=("> <field name="ATTR">state.from</field> </block> </value> </block> </value> </block> </next> </block> </statement> </block> </next> </block> </xml>Anmerkung: Das beobachtete Verhalten kann ich mir nur dadurch erklären, dass der BWM direkt mit der Lampe kommuniziert - es ist ja beides Zigbee?
Einschalten durch BWM und ausschalten geht wieder:
12:39:07.122 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: true, bestätigt: false, Quelle: system.adapter.javascript.0 12:39:07.126 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: true, bestätigt: true, Quelle: system.adapter.sonoff.0 12:39:07.214 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: true, bestätigt: true, Quelle: system.adapter.sonoff.0 12:39:37.031 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: false, bestätigt: false, Quelle: system.adapter.javascript.0 12:39:37.058 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: false, bestätigt: true, Quelle: system.adapter.sonoff.0Ein- und Ausschalten durch Alexa ebenso:
12:41:12.364 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: true, bestätigt: true, Quelle: system.adapter.sonoff.0 12:41:46.140 info javascript.0 (842) script.js.Peripherie.Lampen.Maras_Zimmer.Test: Lampe ein: false, bestätigt: true, Quelle: system.adapter.sonoff.0@smarthome2020 sagte: Einschalten durch BWM und ausschalten geht wieder:
Komisch: Jetzt kommt als Quelle "Javascript" zuerst - so wie es sein soll; danach aber zweimal die Bestätigung vom "Sonoff". Ist es nun immer so?
Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs -
@smarthome2020 sagte: Einschalten durch BWM und ausschalten geht wieder:
Komisch: Jetzt kommt als Quelle "Javascript" zuerst - so wie es sein soll; danach aber zweimal die Bestätigung vom "Sonoff". Ist es nun immer so?
@paul53
Ja, geht noch nicht optimal. Ich kann gerade nicht simulieren, die Kleine schläft.
Die ersten paar Male lief es wie es sollte, nun geht die Lampe nach BWM-Einschaltung nicht mehr aus.Ich werde später berichten.
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